update build logic
This commit is contained in:
parent
e98549ced0
commit
e8746b41f8
146
.drone.yml
146
.drone.yml
@ -1,21 +1,38 @@
|
|||||||
kind: pipeline
|
kind: pipeline
|
||||||
type: docker
|
type: docker
|
||||||
name: build-multiarch-images
|
name: build-release-images
|
||||||
|
trigger:
|
||||||
|
event:
|
||||||
|
exclude:
|
||||||
|
- pull_request
|
||||||
|
ref:
|
||||||
|
- refs/tags/**
|
||||||
|
|
||||||
platform:
|
platform:
|
||||||
os: linux
|
os: linux
|
||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
|
||||||
|
- name: get-tags
|
||||||
|
image: docker:git
|
||||||
|
commands:
|
||||||
|
- git fetch --tags
|
||||||
|
depends_on:
|
||||||
|
- clone
|
||||||
|
|
||||||
- name: make-tags
|
- name: make-tags
|
||||||
image: node
|
image: node
|
||||||
commands:
|
commands:
|
||||||
- echo -n "${DRONE_COMMIT_SHA:0:10}, latest" > .tags
|
- echo -n "${DRONE_TAG}, latest" > .tags
|
||||||
|
depends_on:
|
||||||
|
- get-tags
|
||||||
|
|
||||||
- name: build
|
- name: build-gitea
|
||||||
image: thegeeklab/drone-docker-buildx
|
image: thegeeklab/drone-docker-buildx
|
||||||
privileged: true
|
privileged: true
|
||||||
settings:
|
settings:
|
||||||
|
provenance: false
|
||||||
registry: git.mrmeeb.stream
|
registry: git.mrmeeb.stream
|
||||||
username:
|
username:
|
||||||
from_secret: docker_username
|
from_secret: docker_username
|
||||||
@ -25,16 +42,135 @@ steps:
|
|||||||
platforms:
|
platforms:
|
||||||
- linux/arm64
|
- linux/arm64
|
||||||
- linux/amd64
|
- 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
|
- name: notify
|
||||||
image: plugins/slack
|
image: plugins/slack
|
||||||
|
when:
|
||||||
|
status:
|
||||||
|
- success
|
||||||
|
- failure
|
||||||
settings:
|
settings:
|
||||||
webhook:
|
webhook:
|
||||||
from_secret: slack_webhook
|
from_secret: slack_webhook
|
||||||
|
depends_on:
|
||||||
|
- release-gitea
|
||||||
|
|
||||||
|
---
|
||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: build-main-images
|
||||||
trigger:
|
trigger:
|
||||||
branch:
|
|
||||||
- master
|
|
||||||
event:
|
event:
|
||||||
exclude:
|
exclude:
|
||||||
- pull_request
|
- 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
|
Loading…
x
Reference in New Issue
Block a user