Add jsonnet to build image (#6526)

* Add jsonnet to build image
Needed for https://github.com/grafana/loki/pull/6456

* Add pipeline step to build image
pull/6562/head
Julien Duchesne 3 years ago committed by GitHub
parent 92cd8165af
commit d61b0fe7e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 15
      .drone/drone.jsonnet
  2. 22
      .drone/drone.yml
  3. 4
      loki-build-image/Dockerfile

@ -388,11 +388,24 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
[
pipeline('loki-build-image') {
local build_image_tag = '0.22.0',
workspace: {
base: '/src',
path: 'loki',
},
steps: [
{
name: 'test-image',
image: 'plugins/docker',
when: condition('exclude').tagMain + condition('include').path('loki-build-image/**'),
settings: {
repo: 'grafana/loki-build-image',
context: 'loki-build-image',
dockerfile: 'loki-build-image/Dockerfile',
tags: [build_image_tag],
dry_run: true,
},
},
{
name: 'push-image',
image: 'plugins/docker',
@ -403,7 +416,7 @@ local manifest_ecr(apps, archs) = pipeline('manifest-ecr') {
dockerfile: 'loki-build-image/Dockerfile',
username: { from_secret: docker_username_secret.name },
password: { from_secret: docker_password_secret.name },
tags: ['0.21.0'],
tags: [build_image_tag],
dry_run: false,
},
},

@ -2,6 +2,24 @@
kind: pipeline
name: loki-build-image
steps:
- image: plugins/docker
name: test-image
settings:
context: loki-build-image
dockerfile: loki-build-image/Dockerfile
dry_run: true
repo: grafana/loki-build-image
tags:
- 0.22.0
when:
paths:
include:
- loki-build-image/**
ref:
exclude:
- refs/heads/main
- refs/heads/k???
- refs/tags/v*
- image: plugins/docker
name: push-image
settings:
@ -12,7 +30,7 @@ steps:
from_secret: docker_password
repo: grafana/loki-build-image
tags:
- 0.21.0
- 0.22.0
username:
from_secret: docker_username
when:
@ -1313,6 +1331,6 @@ kind: secret
name: deploy_config
---
kind: signature
hmac: e56633097c3edb68fc784f2059f5c773f02ac485750610aaff59b43eb1417c5b
hmac: a81e5cc63bc5ef62ace94e345c1bba623f515741991cafb3386ebeb9b0a96989
...

@ -66,7 +66,8 @@ RUN GO111MODULE=on go get github.com/goreleaser/nfpm/v2/cmd/nfpm@v2.11.3
FROM golang:1.17.9 as jsonnet
RUN GO111MODULE=on go get \
github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb@v0.4.0 \
github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066
github.com/monitoring-mixins/mixtool/cmd/mixtool@bca3066 \
github.com/google/go-jsonnet/cmd/jsonnet@v0.18.0
FROM golang:1.17.9-buster
RUN apt-get update && \
@ -89,6 +90,7 @@ COPY --from=ghr /go/bin/ghr /usr/bin/ghr
COPY --from=nfpm /go/bin/nfpm /usr/bin/nfpm
COPY --from=jsonnet /go/bin/jb /usr/bin/jb
COPY --from=jsonnet /go/bin/mixtool /usr/bin/mixtool
COPY --from=jsonnet /go/bin/jsonnet /usr/bin/jsonnet
# Install some necessary dependencies.
# Forcing GO111MODULE=on is required to specify dependencies at specific versions using the go mod notation.

Loading…
Cancel
Save