Commit cab8d3a2 authored by okhin's avatar okhin 🚴

Merge branch 'ci-cd-branch' into 'rp2'

Ci cd branch

See merge request !5
parents 17abbc2c 2dbc2daf
Pipeline #1049 passed with stages
in 2 minutes and 34 seconds
......@@ -3,7 +3,8 @@ variables:
cache:
paths:
- "$CI_PROJECT_DIR/pip-cache"
- "pip-cache"
- "env"
key: "$CI_PROJECT_ID"
stages:
......@@ -23,4 +24,46 @@ unit tests:
- echo "SECRET_KEY = '$(pwgen 20 1)'" >> ./project/settings/env.py
- ./manage.py migrate
- pytest apps/ --cov=apps/
artifacts:
paths:
- env/
expire_in: 1 day
tags: [preprod]
static build:
stage: build
script:
- virtualenv -p python3 env
- source ./env/bin/activate
- pip install -r requirements.txt
- yarn install
- webpack
- echo "DEBUG = False" > ./project/settings/env.py
- echo "SECRET_KEY = '$(pwgen 20 1)'" >> ./project/settings/env.py
- ./manage.py collectstatic
tags: [preprod]
dependencies:
- unit tests
artifacts:
paths:
- static/
expire_in: 1 day
deploy preprod:
variables:
BASE_PATH: /srv/rp2/src/
VIRTUALENV: /srv/rp2/rp2-env
stage: deploy
script:
- rsync --exclude 'env' --exclude 'pip-cache' --exclude '.git' -ruv ./ ${BASE_PATH}
- source ${VIRTUALENV}/bin/activate
- pip install --upgrade pip
- pip install --upgrade -r requirements.txt
- pip install --upgrade -r requirements-dev.txt
- echo "DEBUG = True" > ${BASE_PATH}/project/settings/env.py
- echo "SECRET_KEY = '$(pwgen 20 1)'" >> ${BASE_PATH}/project/settings/env.py
- ${BASE_PATH}/manage.py migrate
- touch ${BASE_PATH}/ready
only:
- rp2
tags: [preprod]
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment