build: Include semantic release (WIP)
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2023-07-11 15:15:41 +02:00
parent 1ab1c10f37
commit ec276c088d

View File

@ -1,12 +1,51 @@
kind: pipeline kind: pipeline
type: kubernetes type: kubernetes
name: Container image name: Container & Helm chart
trigger:
event:
exclude:
- tag
steps: steps:
- name: Build & publish (Harbor) - 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: Build & publish container image (Harbor)
depends_on: depends_on:
- clone - Semantic Release (Dry-run)
image: plugins/kaniko image: plugins/kaniko
pull: always
context: . context: .
settings: settings:
repo: bv11-cr01.bessems.eu/library/json-server repo: bv11-cr01.bessems.eu/library/json-server
@ -16,10 +55,12 @@ steps:
from_secret: harbor_username from_secret: harbor_username
password: password:
from_secret: harbor_password from_secret: harbor_password
- name: Build & publish (Dockerhub)
- name: Build & publish container image (docker.io)
depends_on: depends_on:
- clone - Semantic Release (Dry-run)
image: plugins/kaniko image: plugins/kaniko
pull: always
context: . context: .
settings: settings:
repo: index.docker.io/djpbessems/json-server repo: index.docker.io/djpbessems/json-server
@ -30,15 +71,16 @@ steps:
password: password:
from_secret: docker_password from_secret: docker_password
--- - name: Package & publish helm chart (Gitea)
kind: pipeline depends_on:
type: kubernetes - Semantic Release (Dry-run)
name: Helm chart (Gitea)
steps:
- name: Package & publish
image: bv11-cr01.bessems.eu/proxy/alpine/helm image: bv11-cr01.bessems.eu/proxy/alpine/helm
pull: always
commands: commands:
- |
echo '$MIRROR/alpine/edge/community' >> /etc/apk/repositories
apk update && apk add -y \
yq
- | - |
helm package ./charts/json-server helm package ./charts/json-server
- | - |
@ -57,3 +99,14 @@ steps:
GIT_APIKEY: GIT_APIKEY:
from_secret: git_apikey from_secret: git_apikey
GIT_USERNAME: djpbessems 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'