2018-10-08 18:12:30 +02:00
|
|
|
version: "2017-09-20"
|
|
|
|
pipeline:
|
|
|
|
- id: build
|
2022-02-14 14:41:57 +01:00
|
|
|
vm_config:
|
|
|
|
type: linux
|
|
|
|
image: "cdp-runtime/go"
|
2019-04-26 16:47:00 +02:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- /go/pkg/mod # pkg cache for Go modules
|
|
|
|
- ~/.cache/go-build # Go build cache
|
2018-10-08 18:12:30 +02:00
|
|
|
type: script
|
2019-10-01 11:54:37 +02:00
|
|
|
env:
|
|
|
|
GOFLAGS: "-mod=readonly"
|
2018-10-08 18:12:30 +02:00
|
|
|
commands:
|
|
|
|
- desc: test
|
|
|
|
cmd: |
|
|
|
|
make test
|
|
|
|
- desc: build
|
|
|
|
cmd: |
|
|
|
|
make build.docker
|
|
|
|
- desc: push
|
|
|
|
cmd: |
|
|
|
|
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
|
|
|
|
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter
|
2019-10-01 11:54:37 +02:00
|
|
|
VERSION=$(git describe --tags --always)
|
2018-10-08 18:12:30 +02:00
|
|
|
else
|
|
|
|
IMAGE=registry-write.opensource.zalan.do/teapot/kube-metrics-adapter-test
|
2019-07-26 20:36:03 +02:00
|
|
|
VERSION=$CDP_BUILD_VERSION
|
2018-10-08 18:12:30 +02:00
|
|
|
fi
|
2019-10-01 11:54:37 +02:00
|
|
|
IMAGE=$IMAGE VERSION=$VERSION make build.docker
|
|
|
|
git diff --stat --exit-code
|
2019-07-26 20:36:03 +02:00
|
|
|
IMAGE=$IMAGE VERSION=$VERSION make build.push
|
2022-06-24 17:31:35 +02:00
|
|
|
- desc: Build and push image to Zalando's registry
|
|
|
|
cmd: |
|
|
|
|
if [[ $CDP_TARGET_BRANCH == master && ! $CDP_PULL_REQUEST_NUMBER ]]; then
|
|
|
|
IMAGE=container-registry-test.zalando.net/teapot/kube-metrics-adapter
|
|
|
|
VERSION=$(git describe --tags --always)
|
|
|
|
else
|
|
|
|
IMAGE=container-registry-test.zalando.net/teapot/kube-metrics-adapter-test
|
|
|
|
VERSION=$CDP_BUILD_VERSION
|
|
|
|
fi
|
|
|
|
make build.linux.amd64 build.linux.arm64
|
|
|
|
|
|
|
|
docker buildx create --config /etc/cdp-buildkitd.toml --driver-opt network=host --bootstrap --use
|
2024-06-03 09:09:13 +02:00
|
|
|
docker buildx build --rm --build-arg BASE_IMAGE=container-registry.zalando.net/library/static:latest -t "${IMAGE}:${VERSION}" --platform linux/amd64,linux/arm64 --push .
|
2022-06-24 17:31:35 +02:00
|
|
|
cdp-promote-image "${IMAGE}:${VERSION}"
|