-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
41 lines (35 loc) · 1.14 KB
/
.gitlab-ci.yml
File metadata and controls
41 lines (35 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# This file is a template, and might need editing before it works on your project.
stages:
- tests
- build
- install
- deploy
.Test frontend:
stage: tests
Test backend:
stage: tests
image: python:3.8
script:
- pip install pytest pytest-cov && pip install -r backend/requirements.txt
- pytest --junitxml=report.xml backend/tests --cov=backend/
- coverage xml
artifacts:
reports:
junit: report.xml
Deploy:
stage: install
image: kroniak/ssh-client
script:
- mkdir -p /root/.ssh
- ssh-keyscan -H ${DEPLOY_SERVER} >> ~/.ssh/known_hosts
- chmod 600 ${DEPLOY_RSA_KEY}
- ssh -i ${DEPLOY_RSA_KEY} ${DEPLOY_USER}@${DEPLOY_SERVER} "if [ ! -d $CI_PROJECT_NAME ];then
git clone git@gitlab.com:Wonters/compost_me.git;
else
cd $CI_PROJECT_NAME;
docker-compose up --build"
environment:
name: aws
url: http://${DEPLOY_SERVER}:80
only:
- master