-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbitbucket-pipelines.yml
More file actions
57 lines (56 loc) · 2.21 KB
/
bitbucket-pipelines.yml
File metadata and controls
57 lines (56 loc) · 2.21 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
image:
name: atlassian/default-image:3
pipelines:
branches:
dev:
- step:
name: Build and publish docker image.
services:
- docker
script:
- apt-get update && apt-get install -y awscli
- aws configure set aws_access_key_id "${AWS_ACCESS_KEY_ID}"
- aws configure set aws_secret_access_key "${AWS_SECRET_ACCESS_KEY}"
- aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin "${AWS_USERNAME}"
- export IMAGE_NAME="${AWS_USERNAME}/${IMAGE_NAME_DEV}:latest"
- docker build -t $IMAGE_NAME .
- docker push $IMAGE_NAME
- step:
name: Deploy to ECS
script:
- pipe: atlassian/aws-ecs-deploy:1.6.2
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
CLUSTER_NAME: '${CLUSTER_ECS_DEV}'
SERVICE_NAME: '${SERVICE_ECS}'
FORCE_NEW_DEPLOYMENT: 'true'
prod:
- step:
name: Build and publish docker image.
services:
- docker
script:
- apt-get update && apt-get install -y awscli
- aws configure set aws_access_key_id "${AWS_ACCESS_KEY_ID}"
- aws configure set aws_secret_access_key "${AWS_SECRET_ACCESS_KEY}"
- aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin "${AWS_USERNAME}"
- export IMAGE_NAME="${AWS_USERNAME}/${IMAGE_NAME_PROD}:latest"
- docker build -t $IMAGE_NAME .
- docker push $IMAGE_NAME
- step:
name: Deploy to ECS
script:
- pipe: atlassian/aws-ecs-deploy:1.6.2
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: 'us-east-1'
CLUSTER_NAME: '${CLUSTER_ECS_PROD}'
SERVICE_NAME: '${SERVICE_ECS}'
FORCE_NEW_DEPLOYMENT: 'false'
definitions:
services:
docker:
memory: 2048