Skip to content

Commit

Permalink
Feature/gcloud functions (#98)
Browse files Browse the repository at this point in the history
* fixed  merge conflict related bugs

* @wip shit

* @wip cloud function creation, deployment and disable backups

* implemented glcoud setup in viur cli

* fixed pep8 errors

* @wip: need to finalize SETUP and do PEP8 stuff

* refactored Role administration via viur cloud command

* added changelog and readme.md to the project

* bumped version to 2.0.0.dev3

* refinement of gcloud setup script

* Update src/viur_cli/cloud.py

Co-authored-by: Sven Eberth <[email protected]>

* Update src/viur_cli/cloud.py

Co-authored-by: Sven Eberth <[email protected]>

* Update src/viur_cli/cloud.py

Co-authored-by: Jan Max Meyer <[email protected]>

* Update src/viur_cli/cloud.py

Co-authored-by: Jan Max Meyer <[email protected]>

---------

Co-authored-by: Sven Eberth <[email protected]>
Co-authored-by: Jan Max Meyer <[email protected]>
  • Loading branch information
3 people committed Feb 19, 2024
1 parent ecc2a0e commit b8dc8f4
Show file tree
Hide file tree
Showing 10 changed files with 624 additions and 247 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,6 @@ jobs:
name: buildfiles
path: .

pubishtest:
if: "!startsWith(github.ref, 'refs/tags/v')"
name: 📦 publish to TestPyPI
runs-on: ubuntu-latest
needs: [ build ]

steps:
- uses: actions/download-artifact@master
with:
name: buildfiles
path: .

- name: Publish distribution 📦 to Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

publish:
if: "startsWith(github.ref, 'refs/tags/v')"
name: 📦 publish to PyPI
Expand Down
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
# Changelog

This file documents any relevant changes.
## [2.0.0-dev2] 2024-01-09

## [2.0.0.dev3] 2024-02-19
- feature: appengine Setup can now be done via CLI
- feature: Appengine Roles can now be managed via CLI
- feature: `viur package install` and `viur package update` functions

## [2.0.0.dev2] 2024-01-09
- refactor: enabled profile support for all viur-cli functions
- fix: `viur env` now runs without errors
- refactor: project.json functionalities
- feat: `viur package install` and `viur package update` functions
- feature: cloudfunctions creation and deployment via ClI
- feature: backup disabling/ enabling via CLI
- refactor: `viur deploy` is now `viur cloud deploy`

## [1.1.1] 2023-11-28
- chore: updated dependencies
Expand Down
41 changes: 33 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ $ viur check {npm|--dev|--autofix}
```
Runs a security check for the python environment and for each npm project registered under builds.

```sh
$ viur deploy {app|index} [target]
```
you can deploy the app or the index.yaml to a google cloud project target of your choice, though the target is optional.
By default this would be the projectID you gave when initializing the project, but you can add targets to the project.json
if you would like to have an additional system for testing for example.

```sh
$ viur enable {backup}
```
Expand Down Expand Up @@ -89,6 +82,38 @@ $ viur build app [appname]
```
build a specific app

```sh
$ viur cloud deploy {app|index|cloudfunction} {profile} {--ext|--yes|--name}
```
This Function deploys the Google Cloud application and / or different .yaml files
Scripts:
- `app` Deploy application to the Google Appengine
- `index` Deploy index.yaml to Google Appenginge
- `cloudfunction` Deploy Cloudfunction to Google Appengine
Commands:
- `profile` The project.json profile you want to Work from


```sh
$ viur cloud {enable|disable} backup
```
Enable/ Disable the Backup buckets you need to Backup a cloud project in the Google Cloud Console

```sh
$ viur cloud setup {gcloud|gcroles}
```
Scripts:
- `gcloud` This Function setups your project to work on the gcloud plattform
- `gcroles` This function lets you set up Roles for your google appengine Workspace


```sh
$ viur cloud get {gcroles}
```
Scripts:
- `gcroles` This function lets you get Roles for your google appengine Workspace in a readable .json Format


```sh
$ viur env
```
Expand Down Expand Up @@ -219,7 +244,7 @@ viur-cli depends on

## License

Copyright © 2023 by Mausbrand Informationssysteme GmbH.<br>
Copyright © 2024 by Mausbrand Informationssysteme GmbH.<br>
Mausbrand and ViUR are registered trademarks of Mausbrand Informationssysteme GmbH.

This project is free software under the MIT license.<br>
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ install_requires =
semver==3.0.2



[options.packages.find]
where = src

Expand Down
3 changes: 2 additions & 1 deletion src/viur_cli/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from .cli import *
from .conf import *
from .install import *
from .deploy import *
from .package import *
from .local import *
Expand All @@ -9,4 +10,4 @@
from .scriptor import script
from .tool import *
from .update import *
from .package import *
from .cloud import *
7 changes: 5 additions & 2 deletions src/viur_cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import re
import subprocess
import click
from .conf import *
from .version import __version__
from .version import MINIMAL_PIPENV
import semver

import pprint

@click.group(invoke_without_command=True,
no_args_is_help=True,
Expand Down Expand Up @@ -59,7 +60,9 @@ def cli(ctx):
@click.argument("action", type=click.Choice(['list']))
@click.argument("profile", default="default")
def project(action, profile):
"""List your project.json Configuration File"""
project_config = config.get_profile(profile)
if action == "list":
echo_info(f"These are the Settings for {profile} profile")
pprint(project_config)
pprint.pprint(project_config)

Loading

0 comments on commit b8dc8f4

Please sign in to comment.