Reviewed-on: #1 Co-authored-by: Varakh <varakh@varakh.de> Co-committed-by: Varakh <varakh@varakh.de>
This commit is contained in:
parent
074e26cfc2
commit
aea406a31c
4 changed files with 67 additions and 113 deletions
110
.drone.yml
110
.drone.yml
|
@ -1,110 +0,0 @@
|
|||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: test
|
||||
|
||||
trigger:
|
||||
event:
|
||||
include:
|
||||
- push
|
||||
|
||||
steps:
|
||||
- name: docker build
|
||||
image: plugins/docker
|
||||
environment:
|
||||
REVISION: ${DRONE_COMMIT_SHA}
|
||||
CREATED: ${DRONE_BUILD_CREATED}
|
||||
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
|
||||
settings:
|
||||
dry_run: true
|
||||
purge: true
|
||||
repo: varakh/hetzner-storagebox-exporter
|
||||
tags:
|
||||
- ${DRONE_COMMIT_SHA}
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: build and publish
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- promote
|
||||
target:
|
||||
- production
|
||||
|
||||
steps:
|
||||
- name: docker build
|
||||
image: plugins/docker
|
||||
environment:
|
||||
REVISION: ${DRONE_COMMIT_SHA}
|
||||
CREATED: ${DRONE_BUILD_CREATED}
|
||||
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
|
||||
settings:
|
||||
purge: true
|
||||
username:
|
||||
from_secret: dockerhub_user
|
||||
password:
|
||||
from_secret: dockerhub_key
|
||||
repo: varakh/hetzner-storagebox-exporter
|
||||
tags:
|
||||
- latest
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: monhtly build and publish
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- cron
|
||||
cron:
|
||||
include:
|
||||
- monthly
|
||||
|
||||
steps:
|
||||
- name: docker build
|
||||
image: plugins/docker
|
||||
environment:
|
||||
REVISION: ${DRONE_COMMIT_SHA}
|
||||
CREATED: ${DRONE_BUILD_CREATED}
|
||||
SOURCE_URL: ${DRONE_GIT_HTTP_URL}
|
||||
settings:
|
||||
purge: true
|
||||
username:
|
||||
from_secret: dockerhub_user
|
||||
password:
|
||||
from_secret: dockerhub_key
|
||||
repo: varakh/hetzner-storagebox-exporter
|
||||
tags:
|
||||
- latest
|
||||
- monthly
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: result
|
||||
|
||||
steps:
|
||||
- name: notify
|
||||
image: drillster/drone-email
|
||||
settings:
|
||||
subject: "Build failed"
|
||||
body: "URL ${DRONE_BUILD_LINK}"
|
||||
host:
|
||||
from_secret: mail_host
|
||||
username:
|
||||
from_secret: mail_user
|
||||
password:
|
||||
from_secret: mail_password
|
||||
from:
|
||||
from_secret: mail_from
|
||||
when:
|
||||
status:
|
||||
- failure
|
31
.forgejo/workflows/build.yaml
Normal file
31
.forgejo/workflows/build.yaml
Normal file
|
@ -0,0 +1,31 @@
|
|||
on: [ push ]
|
||||
env:
|
||||
REVISION: ${{ github.sha }}
|
||||
jobs:
|
||||
build:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:3.18
|
||||
steps:
|
||||
- name: Prepare requirements
|
||||
run: |
|
||||
apk add --no-cache nodejs npm git
|
||||
apk add --no-cache docker docker-cli-buildx
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
name: Clone
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_KEY }}
|
||||
|
||||
- name: Build docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
push: false
|
||||
tags: varakh/hetzner-storagebox-exporter:${{ github.sha }}
|
35
.forgejo/workflows/release.yaml
Normal file
35
.forgejo/workflows/release.yaml
Normal file
|
@ -0,0 +1,35 @@
|
|||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
env:
|
||||
REVISION: ${{ github.sha }}
|
||||
jobs:
|
||||
build:
|
||||
runs-on: docker
|
||||
container:
|
||||
image: alpine:3.18
|
||||
steps:
|
||||
- name: Prepare requirements
|
||||
run: |
|
||||
apk add --no-cache nodejs npm git
|
||||
apk add --no-cache docker docker-cli-buildx
|
||||
|
||||
- uses: actions/checkout@v3
|
||||
name: Clone
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USER }}
|
||||
password: ${{ secrets.DOCKERHUB_KEY }}
|
||||
|
||||
- name: Build docker image
|
||||
uses: docker/build-push-action@v4
|
||||
with:
|
||||
push: true
|
||||
tags: varakh/hetzner-storagebox-exporter:latest
|
||||
|
|
@ -6,9 +6,7 @@ LABEL maintainer="Varakh <varakh@varakh.de>" \
|
|||
org.opencontainers.image.vendor="Varakh" \
|
||||
org.opencontainers.image.title="hetzner-storagebox-exporter" \
|
||||
org.opencontainers.image.description="hetzner-storagebox-exporter" \
|
||||
org.opencontainers.image.base.name="alpine:3" \
|
||||
org.opencontainers.artifact.created=${CREATED} \
|
||||
org.opencontainers.image.source=${SOURCE_URL}
|
||||
org.opencontainers.image.base.name="alpine:3"
|
||||
|
||||
RUN apk add --no-cache nmap-ncat openssl coreutils openssh
|
||||
|
||||
|
|
Loading…
Reference in a new issue