forked from bluenove/flask-example
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
57 lines (57 loc) · 1.82 KB
/
.gitlab-ci.yml
File metadata and controls
57 lines (57 loc) · 1.82 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
stages:
- test
- build
- integration
- deploy
test:
before_script:
- apt-get update -qy
- apt-get install -y python-dev python-pip
- pip install -r requirements.txt
script: pytest
build:
stage: build
before_script:
- apt-get update -qy
- apt-get install -y python-dev python-pip
- pip install --upgrade twine
- pip install -r requirements.txt
script:
- python setup.py bdist_wheel
- twine upload -u cedricmessiant --skip-existing dist/*
deploy:
stage: deploy
before_script:
- 'which ssh-agent || ( apt-get update -y && apt-get install openssh-client -y )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add - > /dev/null
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- touch ~/.ssh/known_hosts
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
- ssh ec2-user@54.197.34.60 rm -rf gitlab-venv || true
- ssh ec2-user@54.197.34.60 killall waitress-serve || true
- ssh ec2-user@54.197.34.60 virtualenv gitlab-venv
- ssh ec2-user@54.197.34.60 "source gitlab-venv/bin/activate && pip install --upgrade hellobluenove"
script:
- ssh ec2-user@54.197.34.60 "source gitlab-venv/bin/activate"
# && nohup waitress-serve --call 'hellobluenove:create_app' &"
code_quality:
stage: test
image: docker:stable
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
reports:
codequality: [gl-code-quality-report.json]