Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
RECIRCLE
/
portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
11
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
361fcec9
authored
5 years ago
by
Chif Gergő
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add staging deployment stage to CI pipeline
parent
915ac7b4
Pipeline
#1258
failed in 0 seconds
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
6 deletions
+37
-6
.env.example
+1
-1
.gitlab-ci.yml
+34
-5
setup_ci_env.sh
+2
-0
No files found.
.env.example
View file @
361fcec9
...
...
@@ -12,7 +12,7 @@ DJANGO_SETTINGS_MODULE=myproject.settings.local
DATABASE_PASSWORD=database_password
DATABASE_USER=user
DATABASE_NAME=user
DATABASE_HOST=hostname_of_
b
atabase
DATABASE_HOST=hostname_of_
d
atabase
# For channels communication and periodic tasks we need a redis server
REDIS_HOST=redis_host
...
...
This diff is collapsed.
Click to expand it.
.gitlab-ci.yml
View file @
361fcec9
...
...
@@ -6,16 +6,45 @@ before_script:
-
git submodule sync --recursive
-
git submodule update --init --recursive
stages
:
-
testing
-
build
-
deploy
flake8
:
stage
:
-
testing
script
:
-
python3.6 -m pip install flake8
-
flake8
build-local
:
test
:
stage
:
-
testing
script
:
-
docker build --tag recircle-backend:1.0 .
-
docker build --tag recircle-backend-local:latest .
-
docker run recircle-backend-local:latest pipenv run python manage.py test
test
:
build_prod_image
:
stage
:
-
build
script
:
-
docker build --tag recircle-backend:1.0 .
-
docker run recircle-backend:1.0 pipenv run python manage.py test
-
docker build ./Dockerfile.prod --tag recircle-backend:latest
# deploy needs sshpass installed on gitlab runner machince
deploy_staging
:
stage
:
-
deploy
script
:
# When the docker registry ready, pull images from it
-
sshpass -p "$STAGING_SSH_PASS" ssh -o StrictHostKeyChecking=no cloud@vm.niif.cloud.bme.hu -p 17668
-
git pull https://git.ik.bme.hu/RECIRCLE/portal.git DEV
-
git git submodule update --init --recursive
-
docker-compose up -f docker-compose.prod.yml
-
exit
environment
:
name
:
staging
url
:
http://vm.niif.cloud.bme.hu:20088
only
:
-
dockerization
-
DEV
-
master
This diff is collapsed.
Click to expand it.
setup_ci_env.sh
View file @
361fcec9
#!/bin/bash
## This file used by the gitlab ci runner
## Reads the environment variables from the CI config then echoes it to the .env file
# This variables are interpreted automatically by the Docker Engine
# And by the Django runtime
# Django configuration
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment