1 Star 1 Fork 0

徐晓伟/prometheus-webhook

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.gitlab-ci.yml 7.57 KB
一键复制 编辑 原始数据 按行查看 历史
徐晓伟 提交于 2023-04-27 22:29 . :construction_worker:save、artifacts
# This file is a template, and might need editing before it works on your project.
# You can copy and paste this template into a new `.gitlab-ci.yml` file.
# You should not add this template to an existing `.gitlab-ci.yml` file by using the `include:` keyword.
#
# To contribute improvements to CI/CD templates, please follow the Development guide at:
# https://docs.gitlab.com/ee/development/cicd/templates.html
# This specific template is located at:
# https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Go.gitlab-ci.yml
stages:
- build
- build:docker
build:
stage: build
# golang 默认使用 debian
image: golang:1.20.3
script:
- go version
- go env -w GOPROXY=https://goproxy.cn,direct
- go mod download
- go build prometheus_webhook.go
- ./prometheus_webhook --version
artifacts:
name: "${CI_JOB_NAME}"
paths:
- prometheus_webhook
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:debian:docker:
needs:
- job: build
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-debian -f dockerfile/debian/Dockerfile .
- docker images
- docker tag "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-debian "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-debian
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1
- docker save -o v0.0.1-debian.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-debian
- docker save -o v0.0.1.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-debian.tar
- v0.0.1.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:ubuntu:docker:
needs:
- job: build
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-ubuntu -f dockerfile/ubuntu/Dockerfile .
- docker images
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-ubuntu
- docker save -o v0.0.1-ubuntu.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-ubuntu
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-ubuntu.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:centos7:docker:
needs:
- job: build
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-centos7 -f dockerfile/centos7/Dockerfile .
- docker images
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-centos7
- docker save -o v0.0.1-centos7.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-centos7
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-centos7.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:centos8:docker:
needs:
- job: build
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-centos8 -f dockerfile/centos8/Dockerfile .
- docker images
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-centos8
- docker save -o v0.0.1-centos8.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-centos8
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-centos8.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:anolisos7:docker:
needs:
- job: build
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-anolisos7 -f dockerfile/anolisos7/Dockerfile .
- docker images
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-anolisos7
- docker save -o v0.0.1-anolisos7.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-anolisos7
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-anolisos7.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:anolisos8:docker:
needs:
- job: build
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-anolisos8 -f dockerfile/anolisos8/Dockerfile .
- docker images
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-anolisos8
- docker save -o v0.0.1-anolisos8.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-anolisos8
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-anolisos8.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:archlinux:docker:
needs:
- job: build
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-archlinux -f dockerfile/archlinux/Dockerfile .
- docker images
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-archlinux
- docker save -o v0.0.1-archlinux.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-archlinux
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-archlinux.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:fedora:docker:
needs:
- job: build
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-fedora -f dockerfile/fedora/Dockerfile .
- docker images
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-fedora
- docker save -o v0.0.1-fedora.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-fedora
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-fedora.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:alpine:
stage: build
image: golang:alpine3.17
script:
- go version
- go env -w GOPROXY=https://goproxy.cn,direct
- go mod download
- go build prometheus_webhook.go
- ./prometheus_webhook --version
artifacts:
name: "${CI_JOB_NAME}"
paths:
- prometheus_webhook
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
build:alpine:docker:
needs:
- job: build:alpine
artifacts: true
stage: build:docker
image: docker:latest
services:
- docker:dind
script:
- docker build -t "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-alpine -f dockerfile/alpine/Dockerfile .
- docker images
- docker login -u "$DOCKER_USERNAME" -p "$DOCKER_PASSWORD"
- docker push "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-alpine
- docker save -o v0.0.1-alpine.tar "$DOCKER_USERNAME"/prometheus-webhook:v0.0.1-alpine
artifacts:
name: "${CI_JOB_NAME}"
paths:
- v0.0.1-alpine.tar
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_SERVER_HOST == 'jihulab.com'
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xuxiaowei-com-cn/prometheus-webhook.git
git@gitee.com:xuxiaowei-com-cn/prometheus-webhook.git
xuxiaowei-com-cn
prometheus-webhook
prometheus-webhook
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385