From 5d3e98867f681464e702301637c2eaaf44464e7d Mon Sep 17 00:00:00 2001 From: Joey Orlando Date: Wed, 9 Nov 2022 11:13:38 +0100 Subject: [PATCH] specify "prod" as the docker build target locally, docker build works as expected. When not specifying a build target, it builds the last target specified in the Dockerfile (in this case "prod"). On GitHub actions this works properly as well. However, there seems to be something about the version of docker used on Drone that causes it to build all of the stages (and hence failing on enterprise-dev). Let's instead just be explicit about which build target to use for both drone and GitHub actions. --- .drone.yml | 14 ++++++++------ .github/workflows/ci.yml | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index f7e1288f..c553d0b8 100644 --- a/.drone.yml +++ b/.drone.yml @@ -104,6 +104,7 @@ steps: repo: us.gcr.io/kubernetes-dev/oncall dockerfile: engine/Dockerfile context: engine/ + target: prod config: from_secret: gcr_admin depends_on: @@ -117,6 +118,7 @@ steps: repo: grafana/oncall dockerfile: engine/Dockerfile context: engine/ + target: prod password: from_secret: docker_password username: @@ -146,9 +148,9 @@ services: trigger: event: include: - - tag - - push - - pull_request + - tag + - push + - pull_request ref: include: - refs/heads/main @@ -196,7 +198,7 @@ steps: GRAFANA_API_KEY: from_secret: gcom_plugin_publisher_api_key commands: - - "curl -f -s -H \"Authorization: Bearer $${GRAFANA_API_KEY}\" -d \"download[any][url]=https://storage.googleapis.com/grafana-oncall-app/releases/grafana-oncall-app-${DRONE_TAG}.zip\" -d \"download[any][md5]=$$(curl -sL https://storage.googleapis.com/grafana-oncall-app/releases/grafana-oncall-app-${DRONE_TAG}.zip | md5sum | cut -d' ' -f1)\" -d url=https://github.com/grafana/oncall/grafana-plugin https://grafana.com/api/plugins" + - 'curl -f -s -H "Authorization: Bearer $${GRAFANA_API_KEY}" -d "download[any][url]=https://storage.googleapis.com/grafana-oncall-app/releases/grafana-oncall-app-${DRONE_TAG}.zip" -d "download[any][md5]=$$(curl -sL https://storage.googleapis.com/grafana-oncall-app/releases/grafana-oncall-app-${DRONE_TAG}.zip | md5sum | cut -d'' '' -f1)" -d url=https://github.com/grafana/oncall/grafana-plugin https://grafana.com/api/plugins' depends_on: - sign and package plugin @@ -229,6 +231,7 @@ steps: repo: grafana/oncall tags: ${DRONE_TAG}-amd64-linux dockerfile: engine/Dockerfile + target: prod context: engine/ password: from_secret: docker_password @@ -266,6 +269,7 @@ steps: repo: grafana/oncall tags: ${DRONE_TAG}-arm64-linux dockerfile: engine/Dockerfile + target: prod context: engine/ password: from_secret: docker_password @@ -396,5 +400,3 @@ name: drone_token --- kind: signature hmac: 8a060649c132677ba1b5693b5ac6c846c02f9a5bb645fe990b26a7ea42a0fb66 - -... diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f816a2e..a8eda99f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,5 +152,6 @@ jobs: context: ./engine file: ./engine/Dockerfile push: false + target: prod - name: Image digest run: echo ${{ steps.docker_build.outputs.digest }}