-
Notifications
You must be signed in to change notification settings - Fork 0
/
bitbucket-pipelines.yml
43 lines (36 loc) · 1.63 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
image: adaptavist/all-tools:latest
definitions:
checkov-image: &checkov-image
name: bridgecrew/checkov:latest
entrypoint:
- '/usr/bin/env'
- 'PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
go-lang: &go-lang
name: golang:1
release: &release
name: release
image: ghcr.io/adaptavist/docker-semantic-release:17.4.2-alpine3.11
script:
- semantic-release -r ${BITBUCKET_GIT_HTTP_ORIGIN}
scripts:
- &checkov >
checkov --quiet --compact -s -d . -o github_failed_only > compliance-issues.md &&
checkov --quiet --compact -s -d .
# lambda
- &kinesis-scaling export LAMBDA=golang;MAINPATH=../modules/stream_scaling/lambda/kinesis_scaling
# go build
- &lambda-build >
cd ${LAMBDA}/ && GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o ${MAINPATH}/bootstrap scale.go &&
git config pull.ff only &&
git pull &&
git add ${MAINPATH}/bootstrap &&
git diff --quiet && git diff --staged --quiet || git commit -m "[skip ci] Added the updated bootstrap file" &&
git push
pipelines:
default:
- step: { name: 'Checkov analysis', script: [ *checkov ], image: *checkov-image, services: [ docker ] }
- step: { name: 'kinesis-scaling build lambda', image: *go-lang, script: [ *kinesis-scaling, *lambda-build ], artifacts: ['/modules/stream_scaling/lambda/kinesis_scaling/bootstrap'] }
branches:
main:
- step: { name: 'kinesis-scaling build lambda', image: *go-lang, script: [ *kinesis-scaling, *lambda-build ], artifacts: ['/modules/stream_scaling/lambda/kinesis_scaling/bootstrap'] }
- step: *release