Merged in feature/refactor-bitbucket-pipelines (pull request #105)
Feature/refactor bitbucket pipelines
This commit is contained in:
commit
c43ad9bcf1
|
|
@ -151,8 +151,12 @@ When you run caprover_deploy.sh without arguments, it will deploy the current br
|
||||||
|
|
||||||
### Cleanup caprover feature branch deployments
|
### Cleanup caprover feature branch deployments
|
||||||
|
|
||||||
```
|
```bash
|
||||||
|
# by default it will delete all vbv-feature-* apps
|
||||||
python caprover_cleanup.py
|
python caprover_cleanup.py
|
||||||
|
|
||||||
|
# or specify a specific app regex and delete without confirmation
|
||||||
|
python caprover_cleanup.py --automated -a 'vbv-bugfix*'
|
||||||
```
|
```
|
||||||
|
|
||||||
## IntelliJ Configuration
|
## IntelliJ Configuration
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
# this test is based on the docker image described in env/bitbucket/Dockerfile
|
# this test is based on the docker image described in env/bitbucket/Dockerfile
|
||||||
image: iterativ/vbv-lernwelt-bitbucket
|
image: iterativ/vbv-lernwelt-bitbucket
|
||||||
|
|
||||||
## job definition for running Cypress tests in parallel
|
## job definitions
|
||||||
e2e: &e2e
|
e2e: &e2e
|
||||||
name: cypress test worker
|
name: cypress test worker
|
||||||
max-time: 45
|
max-time: 45
|
||||||
|
|
@ -26,7 +26,6 @@ e2e: &e2e
|
||||||
- cypress/**/*.png
|
- cypress/**/*.png
|
||||||
- cypress/**/*.mp4
|
- cypress/**/*.mp4
|
||||||
|
|
||||||
|
|
||||||
deploy: &deploy
|
deploy: &deploy
|
||||||
name: deploy
|
name: deploy
|
||||||
max-time: 30
|
max-time: 30
|
||||||
|
|
@ -39,71 +38,91 @@ deploy: &deploy
|
||||||
- docker
|
- docker
|
||||||
script:
|
script:
|
||||||
- source ./env/bitbucket/prepare_for_deployment.sh
|
- source ./env/bitbucket/prepare_for_deployment.sh
|
||||||
# it will by default take the branch name, when there is no provided parameter
|
|
||||||
- ./caprover_deploy.sh ${DEPLOY_ENVIRONMENT:-}
|
- ./caprover_deploy.sh ${DEPLOY_ENVIRONMENT:-}
|
||||||
- cat /tmp/caprover_app_url.txt
|
- cat /tmp/caprover_app_url.txt
|
||||||
|
|
||||||
|
python-tests: &python-tests
|
||||||
|
name: python tests
|
||||||
|
max-time: 15
|
||||||
|
services:
|
||||||
|
- postgres
|
||||||
|
caches:
|
||||||
|
- vbvpip
|
||||||
|
script:
|
||||||
|
- source ./env/bitbucket/prepare_for_test.sh
|
||||||
|
- pip install -r server/requirements/requirements-dev.txt
|
||||||
|
- ./server/run_tests_coverage.sh
|
||||||
|
|
||||||
|
python-linting: &python-linting
|
||||||
|
name: python linting
|
||||||
|
max-time: 15
|
||||||
|
services:
|
||||||
|
- postgres
|
||||||
|
caches:
|
||||||
|
- vbvpip
|
||||||
|
script:
|
||||||
|
- source ./env/bitbucket/prepare_for_test.sh
|
||||||
|
- pip install -r server/requirements/requirements-dev.txt
|
||||||
|
- git-crypt status -e | sort > git-crypt-encrypted-files-check.txt && diff -w git-crypt-encrypted-files.txt git-crypt-encrypted-files-check.txt
|
||||||
|
- trufflehog --exclude_paths trufflehog-exclude-patterns.txt --allow trufflehog-allow.json --entropy=True --max_depth=100 .
|
||||||
|
- ufmt check server
|
||||||
|
|
||||||
|
js-tests: &js-tests
|
||||||
|
name: js tests
|
||||||
|
max-time: 15
|
||||||
|
caches:
|
||||||
|
- node
|
||||||
|
- clientnode
|
||||||
|
script:
|
||||||
|
- cd client
|
||||||
|
- pwd
|
||||||
|
- npm install
|
||||||
|
- npm test
|
||||||
|
|
||||||
|
js-linting: &js-linting
|
||||||
|
name: js linting
|
||||||
|
max-time: 15
|
||||||
|
caches:
|
||||||
|
- node
|
||||||
|
- clientnode
|
||||||
|
script:
|
||||||
|
- cd client
|
||||||
|
- pwd
|
||||||
|
- npm install
|
||||||
|
- npm run prettier:check
|
||||||
|
- npm run lint
|
||||||
|
- npm run typecheck
|
||||||
|
|
||||||
|
default-steps: &default-steps
|
||||||
|
- parallel:
|
||||||
|
- step: *e2e
|
||||||
|
- step: *e2e
|
||||||
|
- step: *python-tests
|
||||||
|
- step: *python-linting
|
||||||
|
- step: *js-tests
|
||||||
|
- step: *js-linting
|
||||||
|
- step:
|
||||||
|
<<: *deploy
|
||||||
|
name: deploy feature
|
||||||
|
trigger: manual
|
||||||
|
|
||||||
|
# main pipelines definitions
|
||||||
pipelines:
|
pipelines:
|
||||||
default:
|
default: *default-steps
|
||||||
- parallel:
|
branches:
|
||||||
- step:
|
develop:
|
||||||
<<: *e2e
|
- <<: *default-steps
|
||||||
- step:
|
- step:
|
||||||
<<: *e2e
|
<<: *deploy
|
||||||
- step:
|
name: deploy on develop branch url
|
||||||
name: python tests
|
master:
|
||||||
max-time: 15
|
- <<: *default-steps
|
||||||
services:
|
- step:
|
||||||
- postgres
|
<<: *deploy
|
||||||
caches:
|
name: deploy on master branch url
|
||||||
- vbvpip
|
- step:
|
||||||
script:
|
<<: *deploy
|
||||||
- source ./env/bitbucket/prepare_for_test.sh
|
deployment: dev
|
||||||
- pip install -r server/requirements/requirements-dev.txt
|
|
||||||
- ./server/run_tests_coverage.sh
|
|
||||||
- step:
|
|
||||||
name: python linting
|
|
||||||
max-time: 15
|
|
||||||
services:
|
|
||||||
- postgres
|
|
||||||
caches:
|
|
||||||
- vbvpip
|
|
||||||
script:
|
|
||||||
- source ./env/bitbucket/prepare_for_test.sh
|
|
||||||
- pip install -r server/requirements/requirements-dev.txt
|
|
||||||
- git-crypt status -e | sort > git-crypt-encrypted-files-check.txt && diff -w git-crypt-encrypted-files.txt git-crypt-encrypted-files-check.txt
|
|
||||||
- trufflehog --exclude_paths trufflehog-exclude-patterns.txt --allow trufflehog-allow.json --entropy=True --max_depth=100 .
|
|
||||||
- ufmt check server
|
|
||||||
- step:
|
|
||||||
name: js tests
|
|
||||||
max-time: 15
|
|
||||||
caches:
|
|
||||||
- node
|
|
||||||
- clientnode
|
|
||||||
script:
|
|
||||||
- cd client
|
|
||||||
- pwd
|
|
||||||
- npm install
|
|
||||||
- npm test
|
|
||||||
- step:
|
|
||||||
name: js linting
|
|
||||||
max-time: 15
|
|
||||||
caches:
|
|
||||||
- node
|
|
||||||
- clientnode
|
|
||||||
script:
|
|
||||||
- cd client
|
|
||||||
- pwd
|
|
||||||
- npm install
|
|
||||||
- npm run prettier:check
|
|
||||||
- npm run lint
|
|
||||||
- npm run typecheck
|
|
||||||
- step:
|
|
||||||
<<: *deploy
|
|
||||||
name: deploy feature
|
|
||||||
trigger: manual
|
|
||||||
|
|
||||||
tags:
|
tags:
|
||||||
v202*:
|
v202*:
|
||||||
- step:
|
- step:
|
||||||
|
|
@ -115,11 +134,6 @@ pipelines:
|
||||||
name: deploy prod
|
name: deploy prod
|
||||||
deployment: prod
|
deployment: prod
|
||||||
trigger: manual
|
trigger: manual
|
||||||
branches:
|
|
||||||
develop:
|
|
||||||
- step:
|
|
||||||
<<: *deploy
|
|
||||||
deployment: dev
|
|
||||||
custom:
|
custom:
|
||||||
deploy-stage:
|
deploy-stage:
|
||||||
- step:
|
- step:
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,6 @@ from environs import Env
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
logging.basicConfig(level=logging.DEBUG)
|
||||||
|
|
||||||
env = Env()
|
env = Env()
|
||||||
env.read_env("./env_secrets/caprover_feature.env", recurse=False, override=True)
|
|
||||||
app_name = "vbv-feature-caprover-auto-deploy4"
|
|
||||||
|
|
||||||
cap = caprover_api.CaproverAPI(
|
cap = caprover_api.CaproverAPI(
|
||||||
dashboard_url=env.str("CAPROVER_DOMAIN"),
|
dashboard_url=env.str("CAPROVER_DOMAIN"),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue