-
Notifications
You must be signed in to change notification settings - Fork 71
/
bitbucket-pipelines-azure.yml
44 lines (41 loc) · 1.28 KB
/
bitbucket-pipelines-azure.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
image: atlassian/default-image:2
definitions:
defaultEnvironment: &defaultEnvironment
export BITBUCKET_COMMIT_SHORT=$(echo $BITBUCKET_COMMIT | cut -c1-7)
export CONTAINER_REGISTRY_URI=kdtemp.azurecr.io
export IMAGE_NAME=apibitbucket
steps:
- step: &buildandpush
name: Build and Push
script:
- *defaultEnvironment
- docker build -t $CONTAINER_REGISTRY_URI/$IMAGE_NAME:$BITBUCKET_COMMIT_SHORT -t $CONTAINER_REGISTRY_URI/$IMAGE_NAME:latest -f ./docker/prod/Dockerfile .
- docker login $CONTAINER_REGISTRY_URI -u ${SP_CLIENT_ID} -p ${SP_CLIENT_SECRET}
- docker push -a $CONTAINER_REGISTRY_URI/$IMAGE_NAME
services:
- docker
services:
docker:
memory: 2048
pipelines:
default:
- stage:
name: Test
steps:
- step:
name: Lint and Unit tests
image: tshio/awscli-docker-compose-pipelines:0.0.3
caches:
- node
script:
- npm run docker-build
- npm run lint
- npm run units
services:
- docker
custom:
deploy:
- stage:
name: Deploy to Azure Container Registry
steps:
- step: *buildandpush