-
Notifications
You must be signed in to change notification settings - Fork 3
/
delivery.yaml
44 lines (36 loc) · 1.55 KB
/
delivery.yaml
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
build_steps:
- desc: Prepare
cmd: |
curl -o /tmp/ensure-docker -f https://delivery.cloud.zalando.com/utils/ensure-docker
chmod +x /tmp/ensure-docker
/tmp/ensure-docker
- desc: Test
cmd: |
function npm {
docker run -i --rm -v "$(pwd):/workspace" -w /workspace registry.opensource.zalan.do/stups/node:11.8.0-44 npm "$@"
}
npm install typescript
npm install --no-optional
npm run test
sonar-client --recipes=master-dashboard,pr-issues-as-comments
- desc: Build
cmd: |
function npm {
docker run -i --rm -v "$(pwd):/workspace" -w /workspace registry.opensource.zalan.do/stups/node:11.8.0-44 npm "$@"
}
npm install typescript
npm install --no-optional
npm run build
- desc: Publish Docker image
cmd: |
COMMIT_ID="$(git log --format='%H' -n 1 | cut -c 1-7)"
if [[ "${CDP_TARGET_BRANCH}" = "master" && -z "${CDP_PULL_REQUEST_NUMBER}" ]]; then
IMAGE_NAME="registry-write.opensource.zalan.do/security/zincr:${COMMIT_ID}-${CDP_TARGET_REPOSITORY_COUNTER}"
else
IMAGE_NAME="registry-write.opensource.zalan.do/security/zincr-pr-test:${COMMIT_ID}-${CDP_TARGET_REPOSITORY_COUNTER}"
fi
if [[ "${CDP_TARGET_BRANCH}" = "risksmd-poc" && -z "${CDP_PULL_REQUEST_NUMBER}" ]]; then
IMAGE_NAME="registry-write.opensource.zalan.do/security/zincr-internal:${COMMIT_ID}-${CDP_TARGET_REPOSITORY_COUNTER}"
fi
docker build --rm -t "${IMAGE_NAME}" .
docker push "${IMAGE_NAME}"