-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
41 lines (39 loc) · 1.36 KB
/
bitbucket-pipelines.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
options:
size: "1x"
image: node:16
pipelines:
branches:
pull-requests:
- step:
name: "Test"
# max-time: 10
# size: "1x"
script:
- echo "Testing..."
trigger: automatic
main:
- step:
name: "Build"
script:
- npm ci
- npm run build
- ls
artifacts:
- build/**
- Dockerfile
- step:
name: "Deploy"
image: atlassian/pipelines-awscli:1.21.7
caches:
- docker
services:
- docker
script:
# ecr login
- eval $(aws ecr get-login --no-include-email --region eu-west-2)
# build and push docker image
- docker build -t "175837576321.dkr.ecr.eu-west-2.amazonaws.com/auth:$BITBUCKET_BUILD_NUMBER" .
- docker push "175837576321.dkr.ecr.eu-west-2.amazonaws.com/auth:$BITBUCKET_BUILD_NUMBER"
# AWS deploy using cloudformation template
- aws cloudformation deploy --template-file "cloudformation.yaml" --stack-name "Auth-Production" --parameter-overrides EncryptionKey=$EncryptionKey Environment="Production" ImageURI=175837576321.dkr.ecr.eu-west-2.amazonaws.com/auth:$BITBUCKET_BUILD_NUMBER --capabilities "CAPABILITY_AUTO_EXPAND" "CAPABILITY_IAM"
# trigger: manual