feat(cicd): add two new pipelines responsible for pushing docker image to docker hub and Dockerfile (#7)
Reviewed-on: #7
This commit is contained in:
parent
42f2b78018
commit
83fc8c67dc
|
@ -14,5 +14,4 @@ build
|
|||
k8s
|
||||
internal/tools
|
||||
.commitlintrc.yml
|
||||
additional_envs.sh
|
||||
skaffold.yaml
|
||||
|
|
49
.drone.yml
49
.drone.yml
|
@ -53,3 +53,52 @@ trigger:
|
|||
- pull_request
|
||||
branch:
|
||||
- master
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: linux-amd64
|
||||
|
||||
platform:
|
||||
os: linux
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: publish
|
||||
image: plugins/docker
|
||||
settings:
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
repo: kichiyaki/notificationarr
|
||||
auto_tag: true
|
||||
auto_tag_suffix: linux-amd64
|
||||
dockerfile: Dockerfile
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: manifest
|
||||
|
||||
steps:
|
||||
- name: manifest
|
||||
image: plugins/manifest
|
||||
settings:
|
||||
auto_tag: "true"
|
||||
ignore_missing: "true"
|
||||
spec: manifest.tmpl
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
|
||||
depends_on:
|
||||
- linux-amd64
|
||||
|
|
23
Dockerfile
Normal file
23
Dockerfile
Normal file
|
@ -0,0 +1,23 @@
|
|||
FROM golang:1.18.4-alpine3.16 as builder
|
||||
|
||||
WORKDIR /notificationarr
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o notificationarr .
|
||||
|
||||
######## Start a new stage from scratch #######
|
||||
FROM alpine:3.16
|
||||
|
||||
RUN apk --no-cache add ca-certificates
|
||||
|
||||
COPY --from=builder /notificationarr/notificationarr /usr/bin/
|
||||
|
||||
EXPOSE 9234/tcp
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=10s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:9234/health || exit 1
|
||||
|
||||
CMD ["notificationarr"]
|
13
manifest.tmpl
Normal file
13
manifest.tmpl
Normal file
|
@ -0,0 +1,13 @@
|
|||
image: kichiyaki/notificationarr:{{#if build.tag}}{{trimPrefix "v" build.tag}}{{else}}latest{{/if}}
|
||||
{{#if build.tags}}
|
||||
tags:
|
||||
{{#each build.tags}}
|
||||
- {{this}}
|
||||
{{/each}}
|
||||
{{/if}}
|
||||
manifests:
|
||||
-
|
||||
image: kichiyaki/notificationarr:{{#if build.tag}}{{trimPrefix "v" build.tag}}-{{/if}}linux-amd64
|
||||
platform:
|
||||
architecture: amd64
|
||||
os: linux
|
Reference in New Issue
Block a user