45 lines
1.4 KiB
YAML
45 lines
1.4 KiB
YAML
stages:
|
|
- build
|
|
- release
|
|
|
|
build:
|
|
image: golang
|
|
stage: build
|
|
script:
|
|
- echo "Build Commit $CI_COMMIT_SHA"
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o telegraf-clickhouse-plugin-linux-amd64 cmd/main.go
|
|
- CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o telegraf-clickhouse-plugin-linux-arm64 cmd/main.go
|
|
after_script:
|
|
- echo "JOB_ID=$CI_JOB_ID" >> job.env
|
|
artifacts:
|
|
paths:
|
|
- telegraf-clickhouse-plugin-linux-amd64
|
|
- telegraf-clickhouse-plugin-linux-arm64
|
|
expire_in: 1d
|
|
reports:
|
|
dotenv: job.env
|
|
rules:
|
|
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
|
|
|
|
release:
|
|
image: registry.gitlab.com/gitlab-org/release-cli
|
|
stage: release
|
|
needs:
|
|
- job: build
|
|
artifacts: true
|
|
script:
|
|
- echo "Create Release $CI_COMMIT_SHA"
|
|
release:
|
|
name: "Release $CI_COMMIT_SHORT_SHA"
|
|
tag_name: "$CI_COMMIT_SHORT_SHA"
|
|
ref: "$CI_COMMIT_SHORT_SHA"
|
|
description: "Release $CI_COMMIT_SHORT_SHA"
|
|
assets:
|
|
links:
|
|
- name: "telegraf-clickhouse-plugin-linux-amd64"
|
|
url: "https://git.karaolidis.com/karaolidis/telegraf-clickhouse-plugin/-/jobs/$JOB_ID/artifacts/raw/telegraf-clickhouse-plugin-linux-amd64"
|
|
- name: "telegraf-clickhouse-plugin-linux-arm64"
|
|
url: "https://git.karaolidis.com/karaolidis/telegraf-clickhouse-plugin/-/jobs/$JOB_ID/artifacts/raw/telegraf-clickhouse-plugin-linux-arm64"
|
|
rules:
|
|
- if: "$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH"
|