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: job test python:
environment:
preprod
script: script:
- virtualenv --python=python3 env - virtualenv --python=python3 env
- source env/bin/activate - source env/bin/activate
...@@ -14,19 +12,41 @@ job test python: ...@@ -14,19 +12,41 @@ job test python:
tags: [preprod] tags: [preprod]
only: only:
- master - 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: environment:
preprod preprod
variables: variables:
GIT_DIR: '/srv/piphone/campaign/.git' BASE_DIR: /srv/piphone/campaign
GIT_WORK_DIR: '/srv/piphone/campaign/'
script: script:
- git reset --hard - rsync -ruvC ./ ${BASE_DIR}
- git pull origin master
- source /srv/piphone/campaign/env/bin/activate - 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/setup.py install
- python /srv/piphone/campaign/manage.py migrate - python /srv/piphone/campaign/manage.py migrate
- python /srv/piphone/campaign/manage.py collectstatic --noinput - python /srv/piphone/campaign/manage.py collectstatic --noinput
...@@ -36,6 +56,8 @@ job deploy: ...@@ -36,6 +56,8 @@ job deploy:
tags: [preprod] tags: [preprod]
only: only:
- master - master
dependencies:
- job build
job deploy prod: job deploy prod:
environment: environment:
...@@ -44,11 +66,8 @@ job deploy prod: ...@@ -44,11 +66,8 @@ job deploy prod:
GIT_DIR: '/srv/piphone/campaign/.git' GIT_DIR: '/srv/piphone/campaign/.git'
GIT_WORK_DIR: '/srv/piphone/campaign/' GIT_WORK_DIR: '/srv/piphone/campaign/'
script: script:
- git reset --hard - rsync -ruvC ./ ${BASE_DIR}
- git pull origin master
- source /srv/piphone/campaign/env/bin/activate - 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/setup.py install
- python /srv/piphone/campaign/manage.py migrate - python /srv/piphone/campaign/manage.py migrate
- python /srv/piphone/campaign/manage.py collectstatic --noinput - python /srv/piphone/campaign/manage.py collectstatic --noinput
...@@ -59,4 +78,5 @@ job deploy prod: ...@@ -59,4 +78,5 @@ job deploy prod:
only: only:
- master - master
when: manual 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