Danny Bessems
1f2081f05c
Some checks reported errors
continuous-integration/drone/push Build encountered an error
116 lines
2.7 KiB
YAML
116 lines
2.7 KiB
YAML
kind: pipeline
|
|
type: kubernetes
|
|
name: Container & Helm chart
|
|
|
|
trigger:
|
|
event:
|
|
exclude:
|
|
- tag
|
|
|
|
steps:
|
|
- name: Semantic Release (Dry-run)
|
|
image: bv11-cr01.bessems.eu/proxy/library/node:20-slim
|
|
pull: always
|
|
commands:
|
|
- |
|
|
apt-get update
|
|
- |
|
|
apt-get install -y --no-install-recommends \
|
|
git-core \
|
|
ca-certificates
|
|
- |
|
|
npm install \
|
|
semantic-release \
|
|
@semantic-release/commit-analyzer \
|
|
@semantic-release/exec \
|
|
- |
|
|
export GIT_CREDENTIALS=$${GIT_USERNAME}:$${GIT_APIKEY}
|
|
- |
|
|
npx semantic-release \
|
|
--package @semantic-release/exec \
|
|
--package semantic-release \
|
|
--branches ${DRONE_BRANCH} \
|
|
--tag-format "v\$${version}" \
|
|
--dry-run \
|
|
--plugins @semantic-release/commit-analyzer,@semantic-release/exec \
|
|
--analyzeCommits @semantic-release/commit-analyzer \
|
|
--verifyRelease @semantic-release/exec \
|
|
--verifyReleaseCmd 'echo "$${nextRelease.version}" > .version'
|
|
environment:
|
|
GIT_APIKEY:
|
|
from_secret: git_apikey
|
|
GIT_USERNAME: djpbessems
|
|
|
|
- name: Container image (Harbor)
|
|
depends_on:
|
|
- Semantic Release (Dry-run)
|
|
image: plugins/kaniko
|
|
pull: always
|
|
context: .
|
|
settings:
|
|
repo: bv11-cr01.bessems.eu/library/json-server
|
|
registry: https://bv11-cr01.bessems.eu/v2/
|
|
tags: latest
|
|
username:
|
|
from_secret: harbor_username
|
|
password:
|
|
from_secret: harbor_password
|
|
|
|
- name: Container image (docker.io)
|
|
depends_on:
|
|
- Semantic Release (Dry-run)
|
|
image: plugins/kaniko
|
|
pull: always
|
|
context: .
|
|
commands:
|
|
- |
|
|
/kaniko-executor
|
|
settings:
|
|
repo: index.docker.io/djpbessems/json-server
|
|
registry: https://index.docker.io/v1/
|
|
tags: latest
|
|
username:
|
|
from_secret: docker_username
|
|
password:
|
|
from_secret: docker_password
|
|
|
|
- name: Helm chart (Gitea)
|
|
depends_on:
|
|
- Semantic Release (Dry-run)
|
|
image: bv11-cr01.bessems.eu/proxy/alpine/helm
|
|
pull: always
|
|
commands:
|
|
- |
|
|
echo '$MIRROR/alpine/edge/community' >> /etc/apk/repositories
|
|
apk update && apk add \
|
|
yq
|
|
- |
|
|
helm package ./charts/json-server
|
|
- |
|
|
helm plugin install https://github.com/chartmuseum/helm-push
|
|
- |
|
|
helm repo add \
|
|
--username $GIT_USERNAME \
|
|
--password $GIT_APIKEY \
|
|
spamasaurus \
|
|
https://code.spamasaurus.com/api/packages/$GIT_USERNAME/helm
|
|
- |
|
|
helm cm-push \
|
|
json-server-*.tgz \
|
|
spamasaurus
|
|
environment:
|
|
GIT_APIKEY:
|
|
from_secret: git_apikey
|
|
GIT_USERNAME: djpbessems
|
|
|
|
- name: Semantic Release
|
|
depends_on:
|
|
- Build & publish container image (Harbor)
|
|
- Build & publish container image (docker.io)
|
|
- Package & publish helm chart (Gitea)
|
|
image: bv11-cr01.bessems.eu/proxy/library/node:20-slim
|
|
pull: always
|
|
commands:
|
|
- |
|
|
echo 'foo'
|