Commit ddb4b77f by Arve Knudsen Committed by GitHub

CI: Upgrade the build Docker image (#27337)

* CI: Upgrade the build Docker image

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>

* CI: Upgrade osxcross and Apple SDK

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
parent 7aa38f09
......@@ -33,7 +33,7 @@ executors:
- image: srclosson/grafana-plugin-ci-e2e:latest
grafana-build:
docker:
- image: grafana/build-container:1.2.24
- image: grafana/build-container:1.2.26
grafana-publish:
docker:
- image: grafana/grafana-ci-deploy:1.2.5
......
......@@ -14,7 +14,7 @@ steps:
- echo $DRONE_RUNNER_NAME
- name: initialize
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v$${GRABPL_VERSION}/grabpl
- chmod +x grabpl
......@@ -29,7 +29,7 @@ steps:
GRABPL_VERSION: 0.5.5
- name: lint-backend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- golangci-lint run --config scripts/go/configs/.golangci.toml ./pkg/...
- revive -formatter stylish -config scripts/go/configs/revive.toml ./pkg/...
......@@ -40,7 +40,7 @@ steps:
- initialize
- name: codespell
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\" > words_to_ignore.txt"
- codespell -I words_to_ignore.txt docs/
......@@ -48,7 +48,7 @@ steps:
- initialize
- name: shellcheck
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- curl -fLO http://storage.googleapis.com/grafana-downloads/ci-dependencies/shellcheck-v$${VERSION}.linux.x86_64.tar.xz
- echo $$CHKSUM shellcheck-v$${VERSION}.linux.x86_64.tar.xz | sha512sum --check --strict --status
......@@ -63,7 +63,7 @@ steps:
- initialize
- name: test-backend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- ./bin/grabpl test-backend
- ./bin/grabpl integration-tests
......@@ -72,7 +72,7 @@ steps:
- lint-backend
- name: test-frontend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- yarn run prettier:check
- yarn run packages:typecheck
......@@ -84,7 +84,7 @@ steps:
- initialize
- name: build-backend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- ./bin/grabpl build-backend --jobs 8 --edition oss --build-id $DRONE_BUILD_NUMBER --variants linux-x64,linux-x64-musl,osx64,win64 --no-pull-enterprise
depends_on:
......@@ -93,7 +93,7 @@ steps:
- test-backend
- name: build-frontend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise
depends_on:
......@@ -101,7 +101,7 @@ steps:
- test-frontend
- name: build-plugins
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps
depends_on:
......@@ -109,7 +109,7 @@ steps:
- lint-backend
- name: package
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise --variants linux-x64,linux-x64-musl,osx64,win64
depends_on:
......@@ -122,7 +122,7 @@ steps:
- shellcheck
- name: end-to-end-tests-server
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
detach: true
commands:
- ./e2e/start-server
......@@ -140,7 +140,7 @@ steps:
- end-to-end-tests-server
- name: build-storybook
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- yarn storybook:build
depends_on:
......@@ -156,7 +156,7 @@ steps:
- initialize
- name: copy-packages-for-docker
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- cp dist/*.tar.gz packaging/docker/
depends_on:
......@@ -172,7 +172,7 @@ steps:
- copy-packages-for-docker
- name: postgres-integration-tests
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- apt-get update
- apt-get install -yq postgresql-client
......@@ -189,7 +189,7 @@ steps:
- test-frontend
- name: mysql-integration-tests
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- apt-get update
- apt-get install -yq default-mysql-client
......@@ -240,7 +240,7 @@ steps:
- echo $DRONE_RUNNER_NAME
- name: initialize
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- curl -fLO https://grafana-downloads.storage.googleapis.com/grafana-build-pipeline/v$${GRABPL_VERSION}/grabpl
- chmod +x grabpl
......@@ -255,7 +255,7 @@ steps:
GRABPL_VERSION: 0.5.5
- name: lint-backend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- golangci-lint run --config scripts/go/configs/.golangci.toml ./pkg/...
- revive -formatter stylish -config scripts/go/configs/revive.toml ./pkg/...
......@@ -266,7 +266,7 @@ steps:
- initialize
- name: codespell
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- "echo -e \"unknwon\nreferer\nerrorstring\neror\niam\" > words_to_ignore.txt"
- codespell -I words_to_ignore.txt docs/
......@@ -274,7 +274,7 @@ steps:
- initialize
- name: shellcheck
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- curl -fLO http://storage.googleapis.com/grafana-downloads/ci-dependencies/shellcheck-v$${VERSION}.linux.x86_64.tar.xz
- echo $$CHKSUM shellcheck-v$${VERSION}.linux.x86_64.tar.xz | sha512sum --check --strict --status
......@@ -289,7 +289,7 @@ steps:
- initialize
- name: test-backend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- ./bin/grabpl test-backend
- ./bin/grabpl integration-tests
......@@ -298,7 +298,7 @@ steps:
- lint-backend
- name: test-frontend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- yarn run prettier:check
- yarn run packages:typecheck
......@@ -310,7 +310,7 @@ steps:
- initialize
- name: build-backend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- ./bin/grabpl build-backend --jobs 8 --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise
depends_on:
......@@ -319,7 +319,7 @@ steps:
- test-backend
- name: build-frontend
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- ./bin/grabpl build-frontend --jobs 8 --no-install-deps --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise
depends_on:
......@@ -327,7 +327,7 @@ steps:
- test-frontend
- name: build-plugins
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- ./bin/grabpl build-plugins --jobs 8 --edition oss --no-install-deps
depends_on:
......@@ -335,7 +335,7 @@ steps:
- lint-backend
- name: package
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- . scripts/build/gpg-test-vars.sh && ./bin/grabpl package --jobs 8 --edition oss --build-id $DRONE_BUILD_NUMBER --no-pull-enterprise
depends_on:
......@@ -348,7 +348,7 @@ steps:
- shellcheck
- name: end-to-end-tests-server
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
detach: true
commands:
- ./e2e/start-server
......@@ -366,7 +366,7 @@ steps:
- end-to-end-tests-server
- name: build-storybook
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- yarn storybook:build
depends_on:
......@@ -394,7 +394,7 @@ steps:
- initialize
- name: copy-packages-for-docker
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- cp dist/*.tar.gz packaging/docker/
depends_on:
......@@ -418,7 +418,7 @@ steps:
- copy-packages-for-docker
- name: postgres-integration-tests
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- apt-get update
- apt-get install -yq postgresql-client
......@@ -435,7 +435,7 @@ steps:
- test-frontend
- name: mysql-integration-tests
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- apt-get update
- apt-get install -yq default-mysql-client
......@@ -451,7 +451,7 @@ steps:
- test-frontend
- name: release-next-npm-packages
image: grafana/build-container:1.2.24
image: grafana/build-container:1.2.26
commands:
- npx lerna bootstrap
- echo "//registry.npmjs.org/:_authToken=$${NPM_TOKEN}" >> ~/.npmrc
......
# Use old Debian (this has support into 2022) in order to ensure binary compatibility with older glibc's.
FROM debian:stretch-20200803-slim AS toolchain
ENV OSX_SDK_URL=https://s3.dockerproject.org/darwin/v2 \
OSX_SDK=MacOSX10.10.sdk \
OSX_MIN=10.10 \
ARG OSX_SDK_URL
ENV OSX_MIN=10.10 \
CTNG=1.24.0 \
OSX_CROSS_REV=542acc2ef6c21aeb3f109c03748b1015a71fed63
# This is the last revision that builds on Debian Stretch
OSX_CROSS_REV=a1d7d7a8d569f9f0b8c3140b8b32848dbcd62afa
# Use ARG so as not to persist environment variable in image
ARG DEBIAN_FRONTEND=noninteractive
......@@ -37,6 +38,7 @@ WORKDIR /tmp
RUN apt-get update && \
apt-get install -yq \
clang patch libxml2-dev \
build-essential \
ca-certificates \
curl \
git \
......@@ -47,10 +49,10 @@ RUN apt-get update && \
lzma-dev
RUN git clone https://github.com/tpoechtrager/osxcross.git /tmp/osxcross && \
cd /tmp/osxcross && git reset --hard $OSX_CROSS_REV
RUN curl -fL ${OSX_SDK_URL}/${OSX_SDK}.tar.xz -o /tmp/osxcross/tarballs/${OSX_SDK}.tar.xz
RUN curl -fL "${OSX_SDK_URL}" -o /tmp/osxcross/tarballs/$(echo "${OSX_SDK_URL}" | grep -E 'MacOSX[^?]+' -o)
RUN ln -s /usr/bin/llvm-dsymutil-6.0 /usr/bin/dsymutil
RUN UNATTENDED=yes OSX_VERSION_MIN=${OSX_MIN} /tmp/osxcross/build.sh
RUN rm -rf /tmp/osxcross/target/SDK/${OSX_SDK}/usr/share && \
RUN UNATTENDED=1 OSX_VERSION_MIN=${OSX_MIN} /tmp/osxcross/build.sh
RUN rm -rf /tmp/osxcross/target/SDK/*/usr/share && \
cd /tmp && \
tar cfJ osxcross.tar.xz osxcross/target && \
rm -rf /tmp/osxcross
......
......@@ -21,4 +21,8 @@ The image is based on Debian Stretch, since we want an older Linux distribution
## Build/Publish Docker Image
In order to build and publish the Grafana build Docker image, execute the following:
`./build-deploy.sh`.
```
export OSX_SDK_URL=<f.ex. signed GCS URL to download OSX SDK>
./build-deploy.sh
```
#!/bin/bash
set -eo pipefail
_version="1.2.24"
_version="1.2.26"
_tag="grafana/build-container:${_version}"
_dpath=$(dirname "${BASH_SOURCE[0]}")
cd "$_dpath"
docker build -t $_tag .
if [[ -z "${OSX_SDK_URL}" ]]; then
echo You must set OSX_SDK_URL
exit 1
fi
docker build --build-arg OSX_SDK_URL="${OSX_SDK_URL}" -t $_tag .
docker push $_tag
build_image = 'grafana/build-container:1.2.24'
build_image = 'grafana/build-container:1.2.26'
publish_image = 'grafana/grafana-ci-deploy:1.2.5'
grafana_docker_image = 'grafana/drone-grafana-docker:0.2.0'
alpine_image = 'alpine:3.12'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment