-
Notifications
You must be signed in to change notification settings - Fork 0
/
.drone.yml
69 lines (64 loc) · 2.23 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
pipeline:
install_requirements_and_test:
image: node:9.6.1
commands:
- wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add -
- echo 'deb http://dl.google.com/linux/chrome/deb/ stable main' >> /etc/apt/sources.list
- apt-get update && apt-get install --no-install-recommends -y google-chrome-stable
- cd k8s-training-app
- npm install
- npm install -g @angular/cli@7.2.1
- ng test --browsers Chrome_without_sandbox --watch=false
build_and_publish_to_dev:
image: oteemo/aws-docker-cli:v0.1
environment:
# Replace this with the url to your ecr repo
- ECR_REPO=<ecr repo uri>
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 url to your ecr repo
- ECR_REPO=<ecr repo uri>
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
# notify:
# image: plugins/slack
# webhook: https://hooks.slack.com/services/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
# channel: k8s-imageproc-web-app
# 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}}