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.
This commit is contained in:
Joey Orlando 2022-11-09 11:13:38 +01:00
parent eca469048f
commit 5d3e98867f
2 changed files with 9 additions and 6 deletions

View file

@ -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
...

View file

@ -152,5 +152,6 @@ jobs:
context: ./engine
file: ./engine/Dockerfile
push: false
target: prod
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}