-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
75 lines (69 loc) · 2.15 KB
/
.drone.yml
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
pipeline:
install requirements:
image: python:3.7.2-stretch
commands:
- export PYTHONPATH=$${PWD}/src
- pip install virtualenv
- virtualenv venv
- ./venv/bin/pip install -r src/requirements.txt
test:
image: python:3.7.2-stretch
environment:
- FLASK_ENV=testing
- FLASK_TESTING="True"
commands:
- export PYTHONPATH=$${PWD}/src
- ./venv/bin/python -m pytest
build_and_publish_to_dev:
image: oteemo/aws-docker-cli:v0.1
environment:
# Replace this with the uri to your ecr repo
- ECR_REPO=<ecr repo uri>:<tag>
commands:
- eval $(aws ecr get-login --no-include-email --region=us-east-1)
- docker build -t
$${ECR_REPO}:dev-${DRONE_COMMIT_SHA:0:8} .
- docker push
$${ECR_REPO}:dev-${DRONE_COMMIT_SHA:0:8}
- docker rmi
$${ECR_REPO}:dev-${DRONE_COMMIT_SHA:0:8}
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
branch: master
publish_to_prod:
image: oteemo/aws-docker-cli:v0.1
environment:
# Replace this with the uri to your ecr repo
- ECR_REPO=<ecr repo uri>:<tag>
commands:
- eval $(aws ecr get-login --no-include-email --region=us-east-1)
- docker pull
$${ECR_REPO}:dev-${DRONE_COMMIT_SHA:0:8}
- docker tag
$${ECR_REPO}:dev-${DRONE_COMMIT_SHA:0:8}
$${ECR_REPO}:prod-${DRONE_COMMIT_SHA:0:8}
- docker push
$${ECR_REPO}:prod-${DRONE_COMMIT_SHA:0:8}
- docker rmi
$${ECR_REPO}:dev-${DRONE_COMMIT_SHA:0:8}
$${ECR_REPO}:prod-${DRONE_COMMIT_SHA:0:8}
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
when:
branch: master
# slack:
# image: plugins/slack
# webhook: https://hooks.slack.com/services/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
# channel: k8s-image-processor
# username: drone
# template: >
# {{#success build.status}}
# Build {{build.number}} succeeded. Good job.
# {{ build.link }}
# {{else}}
# Build {{build.number}} failed. Fix me please.
# {{ build.link }}
# {{/success}}