mosquitto prometheus exporter image build
Some checks reported errors
continuous-integration/drone/push Build was killed

This commit is contained in:
2023-12-19 12:46:37 +01:00
parent 315d8bd632
commit 67edba2276
4 changed files with 1 additions and 118 deletions

View File

@@ -2,7 +2,7 @@ local dirs = ['_CI-CD', 'apps'];
local packages = ['debian-stable','debian-testing','debian-stable-build-essential','debian-golang','debian-stable-php-fpm','distcc']; local packages = ['debian-stable','debian-testing','debian-stable-build-essential','debian-golang','debian-stable-php-fpm','distcc'];
local apps = ['apt-cacher-ng', 'curl', 'mosquitto']; local apps = ['apt-cacher-ng', 'curl', 'mosquitto', 'mosquitto-prometheus-exporter'];
local build(dir, package) = { local build(dir, package) = {
kind: 'pipeline', kind: 'pipeline',

View File

@@ -1,93 +0,0 @@
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: github-mosquitto-prometheus-exporter
spec:
type: git
params:
- name: revision
value: master
- name: url
value: https://github.com/sapcc/mosquitto-exporter.git
---
apiVersion: tekton.dev/v1alpha1
kind: PipelineResource
metadata:
name: img-mosquitto-prometheus-exporter
spec:
type: image
params:
- name: url
value: cr.lan/mosquitto-prometheus-exporter
---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-mosquitto-prometheus-exporter
spec:
params:
- name: pathToDockerFile
type: string
default: $(resources.inputs.source.path)/Dockerfile
- name: pathToContext
type: string
default: $(resources.inputs.source.path)
resources:
inputs:
- name: source
type: git
outputs:
- name: builtImage
type: image
steps:
- name: build-binary
image: cr.lan/debian-golang-stable
script: |
#!/usr/bin/env bash
cd $(resources.inputs.source.path)
ls -al
export GOARCH=arm64
export GOPATH=/usr/src/gopath
export GOCACHE=/usr/src/gocache
go env
go get github.com/sapcc/mosquitto-exporter
make -j4 build CGO_ENABLED=0
- name: build-and-push
image: gcr.io/kaniko-project/executor:arm64
command:
- /kaniko/executor
args:
- --dockerfile=$(params.pathToDockerFile)
- --destination=$(resources.outputs.builtImage.url)
- --context=$(params.pathToContext)
- --snapshotMode=redo
- --skip-tls-verify
workspaces:
- name: usr-src
mountPath: /usr/src
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: img-mosquitto-prometheus-exporter
spec:
taskRef:
name: build-mosquitto-prometheus-exporter
params:
- name: pathToDockerFile
value: Dockerfile
resources:
inputs:
- name: source
resourceRef:
name: github-mosquitto-prometheus-exporter
outputs:
- name: builtImage
resourceRef:
name: img-mosquitto-prometheus-exporter
workspaces:
- name: usr-src
persistentVolumeClaim:
claimName: tektoncd-workspaces
subPath: usr_src

View File

@@ -1,24 +0,0 @@
apiVersion: tekton.dev/v1beta1
kind: PipelineRun
metadata:
name: img-mosquitto-prometheus
spec:
pipelineRef:
name: kaniko-pipeline
params:
- name: git-url
value: http://git-ui.lan/chaos/kubernetes.git
- name: git-revision
value: master
- name: path-to-image-context
value: apps/mosquitto/prometheus
- name: path-to-dockerfile
value: apps/mosquitto/prometheus/Dockerfile
- name: image-name
value: cr.lan/mosquitto-prometheus-exporter
workspaces:
- name: git-source
persistentVolumeClaim:
claimName: tektoncd-workspaces
subPath: tekton/mosquitto-prometheus