Commit f2298ca1 authored by okhin's avatar okhin 🚴

New CI not using git to deploy, but rsync

parent ebd83994
Pipeline #1116 failed
job test python:
environment:
preprod
script:
- virtualenv --python=python3 env
- source env/bin/activate
......@@ -14,19 +12,41 @@ job test python:
tags: [preprod]
only:
- master
artifacts:
paths:
- env
expire_in: 1 day
job deploy:
job build:
script:
- source env/bin/activate
- python setup.py develop
- cp picampaign/settings.py.sample picampaign/settings.py
- python manage.py collectstatic --noinput
- python manage.py compilemessages --exclude env
- python manage.py makemessages --exclude env fr
- python manage.py makemessages --exclude env en
- python manage.py makemessages --exclude env de
artifacts:
paths:
- campaign/static
- campaign/locale
expire_in: 1 day
stage: build
tags: [preprod]
only:
- master
dependencies:
- job test python
job deploy preprod:
environment:
preprod
variables:
GIT_DIR: '/srv/piphone/campaign/.git'
GIT_WORK_DIR: '/srv/piphone/campaign/'
BASE_DIR: /srv/piphone/campaign
script:
- git reset --hard
- git pull origin master
- rsync -ruvC ./ ${BASE_DIR}
- source /srv/piphone/campaign/env/bin/activate
- pip install --upgrade pip
- pip install django
- python /srv/piphone/campaign/setup.py install
- python /srv/piphone/campaign/manage.py migrate
- python /srv/piphone/campaign/manage.py collectstatic --noinput
......@@ -36,6 +56,8 @@ job deploy:
tags: [preprod]
only:
- master
dependencies:
- job build
job deploy prod:
environment:
......@@ -44,11 +66,8 @@ job deploy prod:
GIT_DIR: '/srv/piphone/campaign/.git'
GIT_WORK_DIR: '/srv/piphone/campaign/'
script:
- git reset --hard
- git pull origin master
- rsync -ruvC ./ ${BASE_DIR}
- source /srv/piphone/campaign/env/bin/activate
- pip install --upgrade pip
- pip install django
- python /srv/piphone/campaign/setup.py install
- python /srv/piphone/campaign/manage.py migrate
- python /srv/piphone/campaign/manage.py collectstatic --noinput
......@@ -59,4 +78,5 @@ job deploy prod:
only:
- master
when: manual
dependencies:
- job build
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