Add initial drone ci file
Some checks failed
continuous-integration/drone/push Build encountered an error
Some checks failed
continuous-integration/drone/push Build encountered an error
This commit is contained in:
99
.drone.yml
Normal file
99
.drone.yml
Normal file
@@ -0,0 +1,99 @@
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: push-master
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- master
|
||||
|
||||
steps:
|
||||
- name: docker-build-push
|
||||
image: plugins/docker
|
||||
privileged: true
|
||||
settings:
|
||||
registry: git.itzana.me
|
||||
repo: ${DRONE_REPO}
|
||||
username:
|
||||
from_secret: GITEA_USERNAME
|
||||
password:
|
||||
from_secret: GITEA_TOKEN
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
tags:
|
||||
- master
|
||||
- latest
|
||||
- ${DRONE_COMMIT_SHA}
|
||||
when:
|
||||
event:
|
||||
- push
|
||||
branch:
|
||||
- master
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: docker
|
||||
name: release-tag
|
||||
|
||||
trigger:
|
||||
event:
|
||||
- tag
|
||||
ref:
|
||||
- refs/tags/v[0-9]+.[0-9]+.[0-9]+*
|
||||
- refs/tags/[0-9]+.[0-9]+.[0-9]+*
|
||||
|
||||
steps:
|
||||
- name: docker-build-push
|
||||
image: plugins/docker
|
||||
privileged: true
|
||||
settings:
|
||||
registry: git.itzana.me
|
||||
repo: ${DRONE_REPO}
|
||||
username:
|
||||
from_secret: GITEA_USERNAME
|
||||
password:
|
||||
from_secret: GITEA_TOKEN
|
||||
dockerfile: Dockerfile
|
||||
context: .
|
||||
tags:
|
||||
- ${DRONE_TAG}
|
||||
|
||||
- name: helm-package-and-push
|
||||
image: alpine/helm:3.14.4
|
||||
environment:
|
||||
GITEA_USERNAME:
|
||||
from_secret: GITEA_USERNAME
|
||||
GITEA_TOKEN:
|
||||
from_secret: GITEA_TOKEN
|
||||
CHART_DIR: charts/telegram-scam-baiter
|
||||
commands:
|
||||
- apk add --no-cache bash coreutils git curl
|
||||
- helm plugin install https://github.com/chartmuseum/helm-push
|
||||
|
||||
# Compute semver (strip leading "v" if present)
|
||||
- |
|
||||
TAG="${DRONE_TAG}"
|
||||
if echo "$TAG" | grep -qE '^v[0-9]'; then
|
||||
VERSION="${TAG#v}"
|
||||
else
|
||||
VERSION="${TAG}"
|
||||
fi
|
||||
echo "Using version: $VERSION"
|
||||
|
||||
# Package the chart with version/appVersion = git tag (sans 'v')
|
||||
- helm package "$CHART_DIR" \
|
||||
--version "${VERSION}" \
|
||||
--app-version "${VERSION}"
|
||||
|
||||
# Add the Gitea Helm repo with basic auth (stored in Helm config)
|
||||
- helm repo add "${DRONE_REPO_NAME}" "https://git.itzana.me/api/packages/${DRONE_REPO_OWNER}/helm" \
|
||||
--username "${GITEA_USERNAME}" \
|
||||
--password "${GITEA_TOKEN}"
|
||||
|
||||
# Push the packaged chart to Gitea (ChartMuseum API-compatible)
|
||||
- helm cm-push "telegram-scam-baiter-${VERSION}.tgz" "${DRONE_REPO_NAME}"
|
||||
|
||||
when:
|
||||
event:
|
||||
- tag
|
||||
Reference in New Issue
Block a user