-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbitbucket-pipelines.yml
46 lines (43 loc) · 1.2 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
42
43
44
45
46
image: atlassian/default-image:2
definitions:
steps:
- step: &build
script:
- DOCKER_CONTENT_TRUST=1
- docker build . -t tests --target test --output type=local,dest=out
- docker build . -t $BITBUCKET_REPO_SLUG
- docker save --output image.docker $BITBUCKET_REPO_SLUG
services:
- docker
caches:
- docker
artifacts:
- image.docker
- step: &scan
name: Scan
script:
- pipe: sonatype-community/nancy-scan:0.1.23
variables:
NANCY_VERSION: v1.0.33
- step: &push
name: Push
script:
- docker load --input ./image.docker
- pipe: atlassian/aws-ecr-push-image:1.4.2
variables:
IMAGE_NAME: $BITBUCKET_REPO_SLUG
TAGS: '${BITBUCKET_COMMIT} ${BITBUCKET_TAG}'
AWS_DEFAULT_REGION: 'eu-west-1'
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID_tools
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY_tools
services:
- docker
pipelines:
pull-requests:
'**':
- step: *build
branches:
master:
- step: *build
- step: *scan
- step: *push