Compare commits
35 Commits
85471c2364
...
1.1.2
| Author | SHA1 | Date | |
|---|---|---|---|
| 1ea5213bb9 | |||
| c16e730a19 | |||
| 58ede5f1b6 | |||
| def9460540 | |||
| 3e37a8c4ed | |||
| 3dbf0983f6 | |||
| 8587dcc8c2 | |||
| e69f607bf8 | |||
| f9aaaaa624 | |||
| 3e3b548538 | |||
| 53935f50a1 | |||
| a079be7a7c | |||
| daf09c2688 | |||
| 12c5cc0b26 | |||
| afe5564d3e | |||
| e8746b41f8 | |||
| e98549ced0 | |||
| df6719d802 | |||
| da97eed84e | |||
| bc046870b5 | |||
| 51fb94b5d7 | |||
| e6afb009ea | |||
| 6d4ca72071 | |||
| 8b57c507cf | |||
| f4f8bfb64b | |||
| c8daded5b0 | |||
| 6056a0bcd7 | |||
| d2999b8307 | |||
| 5a24a284d0 | |||
| c25786a930 | |||
| 09bdaf819c | |||
| 1773f9d3ee | |||
| 47d5a4aaaf | |||
| 85ec77a260 | |||
| afd88220aa |
176
.drone.yml
Normal file
176
.drone.yml
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: build-release-images
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
ref:
|
||||||
|
- refs/tags/**
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: get-tags
|
||||||
|
image: docker:git
|
||||||
|
commands:
|
||||||
|
- git fetch --tags
|
||||||
|
depends_on:
|
||||||
|
- clone
|
||||||
|
|
||||||
|
- name: make-tags
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- echo -n "${DRONE_TAG}, latest" > .tags
|
||||||
|
depends_on:
|
||||||
|
- get-tags
|
||||||
|
|
||||||
|
- name: build-gitea
|
||||||
|
image: thegeeklab/drone-docker-buildx
|
||||||
|
privileged: true
|
||||||
|
settings:
|
||||||
|
provenance: false
|
||||||
|
registry: git.mrmeeb.stream
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
repo: git.mrmeeb.stream/mrmeeb/certbot-cron
|
||||||
|
platforms:
|
||||||
|
- linux/arm64
|
||||||
|
- linux/amd64
|
||||||
|
depends_on:
|
||||||
|
- make-tags
|
||||||
|
|
||||||
|
- name: release-gitea
|
||||||
|
image: goreleaser/goreleaser
|
||||||
|
environment:
|
||||||
|
GITEA_TOKEN:
|
||||||
|
from_secret: gitea_token
|
||||||
|
commands:
|
||||||
|
- goreleaser release -f .goreleaser-gitea.yaml
|
||||||
|
depends_on:
|
||||||
|
- build-gitea
|
||||||
|
|
||||||
|
- name: notify
|
||||||
|
image: plugins/slack
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- success
|
||||||
|
- failure
|
||||||
|
settings:
|
||||||
|
webhook:
|
||||||
|
from_secret: slack_webhook
|
||||||
|
depends_on:
|
||||||
|
- release-gitea
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: build-main-images
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
|
||||||
|
- name: make-tags
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- echo -n "${DRONE_COMMIT_SHA:0:8}, latest" > .tags
|
||||||
|
when:
|
||||||
|
ref:
|
||||||
|
- refs/heads/master
|
||||||
|
depends_on:
|
||||||
|
- clone
|
||||||
|
|
||||||
|
- name: build-gitea
|
||||||
|
image: thegeeklab/drone-docker-buildx
|
||||||
|
privileged: true
|
||||||
|
settings:
|
||||||
|
provenance: false
|
||||||
|
registry: git.mrmeeb.stream
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
repo: git.mrmeeb.stream/mrmeeb/certbot-cron
|
||||||
|
platforms:
|
||||||
|
- linux/arm64
|
||||||
|
- linux/amd64
|
||||||
|
depends_on:
|
||||||
|
- make-tags
|
||||||
|
|
||||||
|
- name: notify
|
||||||
|
image: plugins/slack
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- success
|
||||||
|
- failure
|
||||||
|
settings:
|
||||||
|
webhook:
|
||||||
|
from_secret: slack_webhook
|
||||||
|
depends_on:
|
||||||
|
- build-gitea
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: build-develop-images
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
branch:
|
||||||
|
- develop
|
||||||
|
|
||||||
|
platform:
|
||||||
|
os: linux
|
||||||
|
arch: amd64
|
||||||
|
|
||||||
|
steps:
|
||||||
|
# Set tags for develop branch - git commit SHA and 'develop'
|
||||||
|
- name: make-tags
|
||||||
|
image: node
|
||||||
|
commands:
|
||||||
|
- echo -n "develop-${DRONE_COMMIT_SHA:0:8}, develop" > .tags
|
||||||
|
|
||||||
|
# Build containers from develop branch
|
||||||
|
- name: build-gitea
|
||||||
|
image: thegeeklab/drone-docker-buildx
|
||||||
|
privileged: true
|
||||||
|
settings:
|
||||||
|
provenance: false
|
||||||
|
registry: git.mrmeeb.stream
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
repo: git.mrmeeb.stream/mrmeeb/certbot-cron
|
||||||
|
platforms:
|
||||||
|
- linux/arm64
|
||||||
|
- linux/amd64
|
||||||
|
depends_on:
|
||||||
|
- make-tags
|
||||||
|
|
||||||
|
- name: notify
|
||||||
|
image: plugins/slack
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- success
|
||||||
|
- failure
|
||||||
|
settings:
|
||||||
|
webhook:
|
||||||
|
from_secret: slack_webhook
|
||||||
|
depends_on:
|
||||||
|
- build-gitea
|
||||||
@ -1,88 +0,0 @@
|
|||||||
name: Build Image
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'develop'
|
|
||||||
|
|
||||||
env:
|
|
||||||
TEST_TAG: mrmeeb/certbot-cron:test
|
|
||||||
FULL_TAG: git.mrmeeb.stream/mrmeeb/certbot-cron:develop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
"Validate Image":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
steps:
|
|
||||||
- name: Build locally
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
load: true
|
|
||||||
tags: ${{ env.TEST_TAG }}
|
|
||||||
provenance: false
|
|
||||||
- name: Test certificate issuing
|
|
||||||
id: test
|
|
||||||
run: |
|
|
||||||
# First create a volume
|
|
||||||
docker volume create ${{ gitea.sha }} && \
|
|
||||||
# Then issue a certificate
|
|
||||||
docker run --rm -v ${{ gitea.sha }}:/config -e STAGING=true -e EMAIL=${{ secrets.EMAIL }} -e DOMAINS=${{ gitea.sha }}.mrmeeb.stream -e PLUGIN=cloudflare -e CLOUDFLARE_TOKEN=${{ secrets.CLOUDFLARE_TOKEN }} -e ONE_SHOT=true -e GENERATE_DHPARAM=false ${{ env.TEST_TAG }} && \
|
|
||||||
# Then revoke it again
|
|
||||||
docker run --rm --entrypoint "/usr/bin/certbot" -v ${{ gitea.sha }}:/config ${{ env.TEST_TAG }} revoke --non-interactive --agree-tos --email ${{ secrets.EMAIL }} --staging --config-dir /config/letsencrypt --work-dir /config/.tmp --logs-dir /config/logs --cert-path /config/letsencrypt/live/${{ gitea.sha }}.mrmeeb.stream/fullchain.pem
|
|
||||||
- name: Tidy up
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
echo "Removing docker volume ${{ gitea.sha }}" && \
|
|
||||||
docker volume rm ${{ gitea.sha }}
|
|
||||||
- name: Test Failure
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
severity: error
|
|
||||||
details: Test Failed!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
|
|
||||||
"Publish Image":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
needs: ["Validate Image"]
|
|
||||||
steps:
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to Gitea Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.mrmeeb.stream
|
|
||||||
username: ${{ env.GITHUB_ACTOR }}
|
|
||||||
password: ${{ secrets.GTCR_TOKEN }}
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: ${{ env.FULL_TAG }}
|
|
||||||
provenance: false
|
|
||||||
- name: Build Failure
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
severity: error
|
|
||||||
details: Build Failed!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
|
|
||||||
"Notify":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
needs: ["Build Image", "Validate Image"]
|
|
||||||
steps:
|
|
||||||
- name: Notify of success
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
severity: info
|
|
||||||
details: Build succeeded!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
@ -1,88 +0,0 @@
|
|||||||
name: Build Image
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
|
|
||||||
env:
|
|
||||||
TEST_TAG: mrmeeb/certbot-cron:test
|
|
||||||
FULL_TAG: git.mrmeeb.stream/mrmeeb/certbot-cron:latest
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
"Validate Image":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
steps:
|
|
||||||
- name: Build locally
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
load: true
|
|
||||||
tags: ${{ env.TEST_TAG }}
|
|
||||||
provenance: false
|
|
||||||
- name: Test certificate issuing
|
|
||||||
id: test
|
|
||||||
run: |
|
|
||||||
# First create a volume
|
|
||||||
docker volume create ${{ gitea.sha }} && \
|
|
||||||
# Then issue a certificate
|
|
||||||
docker run --rm -v ${{ gitea.sha }}:/config -e STAGING=true -e EMAIL=${{ secrets.EMAIL }} -e DOMAINS=${{ gitea.sha }}.mrmeeb.stream -e PLUGIN=cloudflare -e CLOUDFLARE_TOKEN=${{ secrets.CLOUDFLARE_TOKEN }} -e ONE_SHOT=true -e GENERATE_DHPARAM=false ${{ env.TEST_TAG }} && \
|
|
||||||
# Then revoke it again
|
|
||||||
docker run --rm --entrypoint "/usr/bin/certbot" -v ${{ gitea.sha }}:/config ${{ env.TEST_TAG }} revoke --non-interactive --agree-tos --email ${{ secrets.EMAIL }} --staging --config-dir /config/letsencrypt --work-dir /config/.tmp --logs-dir /config/logs --cert-path /config/letsencrypt/live/${{ gitea.sha }}.mrmeeb.stream/fullchain.pem
|
|
||||||
- name: Tidy up
|
|
||||||
if: always()
|
|
||||||
run: |
|
|
||||||
echo "Removing docker volume ${{ gitea.sha }}" && \
|
|
||||||
docker volume rm ${{ gitea.sha }}
|
|
||||||
- name: Test Failure
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
severity: error
|
|
||||||
details: Test Failed!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
|
|
||||||
"Publish Image":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
needs: ["Validate Image"]
|
|
||||||
steps:
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to Gitea Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.mrmeeb.stream
|
|
||||||
username: ${{ env.GITHUB_ACTOR }}
|
|
||||||
password: ${{ secrets.GTCR_TOKEN }}
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: ${{ env.FULL_TAG }}
|
|
||||||
provenance: false
|
|
||||||
- name: Build Failure
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
severity: error
|
|
||||||
details: Build Failed!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
|
|
||||||
"Notify":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
needs: ["Build Image", "Validate Image"]
|
|
||||||
steps:
|
|
||||||
- name: Notify of success
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
severity: info
|
|
||||||
details: Build succeeded!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
@ -1,80 +0,0 @@
|
|||||||
name: Build Tagged Release Image
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
|
|
||||||
env:
|
|
||||||
FULL_TAG: git.mrmeeb.stream/mrmeeb/certbot-cron
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
"Build Image":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
steps:
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Login to Gitea Container Registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: git.mrmeeb.stream
|
|
||||||
username: ${{ env.GITHUB_ACTOR }}
|
|
||||||
password: ${{ secrets.GTCR_TOKEN }}
|
|
||||||
- name: Docker metadata
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: ${{ env.FULL_TAG }}
|
|
||||||
tags: |
|
|
||||||
type=pep440,pattern={{version}}
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
push: true
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
provenance: false
|
|
||||||
- name: Notify on failure
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
severity: error
|
|
||||||
details: Build failed!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
"Create Release":
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: ["Build Image"]
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: Set up Go
|
|
||||||
uses: actions/setup-go@v4
|
|
||||||
with:
|
|
||||||
go-version: 1.22.2
|
|
||||||
- name: Run GoReleaser
|
|
||||||
uses: goreleaser/goreleaser-action@v5
|
|
||||||
with:
|
|
||||||
distribution: goreleaser
|
|
||||||
version: latest
|
|
||||||
args: release --clean -f .goreleaser-gitea.yaml
|
|
||||||
env:
|
|
||||||
GITEA_TOKEN: ${{ secrets.GORELEASER_TOKEN }}
|
|
||||||
|
|
||||||
"Notify":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
needs: ["Build Image", "Create Release"]
|
|
||||||
steps:
|
|
||||||
- name: Notify of success
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
severity: info
|
|
||||||
details: Build succeeded!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
name: Test Pull Request
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
- 'develop'
|
|
||||||
|
|
||||||
env:
|
|
||||||
FULL_TAG: git.mrmeeb.stream/mrmeeb/certbot-cron:develop
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
"Build Image":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
steps:
|
|
||||||
- name: Set up QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
- name: Build
|
|
||||||
uses: docker/build-push-action@v5
|
|
||||||
with:
|
|
||||||
push: false
|
|
||||||
platforms: linux/amd64,linux/arm64
|
|
||||||
tags: ${{ env.FULL_TAG }}
|
|
||||||
provenance: false
|
|
||||||
- name: Notify on failure
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: failure()
|
|
||||||
with:
|
|
||||||
severity: error
|
|
||||||
details: Build failed!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
"Notify":
|
|
||||||
runs-on: [ubuntu-docker-latest, linux/amd64]
|
|
||||||
needs: ["Build Image"]
|
|
||||||
steps:
|
|
||||||
- name: Notify of success
|
|
||||||
uses: rjstone/discord-webhook-notify@v1
|
|
||||||
if: success()
|
|
||||||
with:
|
|
||||||
severity: info
|
|
||||||
details: Build succeeded!
|
|
||||||
webhookUrl: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
username: Gitea
|
|
||||||
avatarUrl: ${{ vars.RUNNER_ICON_URL }}
|
|
||||||
Reference in New Issue
Block a user