Compare commits
20 Commits
v0.5.3
...
48e8b21c30
| Author | SHA1 | Date | |
|---|---|---|---|
| 48e8b21c30 | |||
| b19a3f7391 | |||
| cde425809f | |||
| 6170a12b19 | |||
| a12ce0a9e9 | |||
| 2c749e2077 | |||
| 1f2081f05c | |||
| 1d791a3820 | |||
| 7f5242eedc | |||
| ec276c088d | |||
| 1ab1c10f37 | |||
| 4deac9ab13 | |||
| 2f6c7f7f91 | |||
| d24792b8c3 | |||
| 55afb79de5 | |||
| 0fa80669cd | |||
| 38eb4e9faa | |||
| c6815721df | |||
| ff42784426 | |||
| d6e01f3c23 |
150
.drone.yml
150
.drone.yml
@@ -1,56 +1,118 @@
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: Container image
|
||||
name: Container & Helm chart
|
||||
|
||||
trigger:
|
||||
event:
|
||||
exclude:
|
||||
- tag
|
||||
|
||||
steps:
|
||||
- name: Build & publish (Harbor)
|
||||
depends_on:
|
||||
- clone
|
||||
image: plugins/docker
|
||||
context: .
|
||||
settings:
|
||||
repo: bv11-cr01.bessems.eu/library/json-server
|
||||
registry: bv11-cr01.bessems.eu
|
||||
tags: latest
|
||||
mtu: 1450
|
||||
username:
|
||||
from_secret: harbor_username
|
||||
password:
|
||||
from_secret: harbor_password
|
||||
- name: Build & publish (Dockerhub)
|
||||
depends_on:
|
||||
- clone
|
||||
image: plugins/docker
|
||||
context: .
|
||||
settings:
|
||||
repo: djpbessems/json-server
|
||||
tags: latest
|
||||
mtu: 1450
|
||||
username:
|
||||
from_secret: docker_username
|
||||
password:
|
||||
from_secret: docker_password
|
||||
|
||||
---
|
||||
kind: pipeline
|
||||
type: kubernetes
|
||||
name: Helm chart (Gitea)
|
||||
|
||||
steps:
|
||||
- name: Package & publish
|
||||
image: bv11-cr01.bessems.eu/proxy/alpine/helm
|
||||
- name: Semantic Release (Dry-run)
|
||||
image: bv11-cr01.bessems.eu/proxy/library/node:20-slim
|
||||
pull: always
|
||||
commands:
|
||||
- |
|
||||
apk add yq
|
||||
apt-get update
|
||||
- |
|
||||
helm package ./charts/json-server
|
||||
apt-get install -y --no-install-recommends \
|
||||
git-core \
|
||||
ca-certificates
|
||||
- |
|
||||
CHART_VERSION=$(cat ./charts/json-server/Chart.yaml | yq '.version')
|
||||
curl \
|
||||
--header "Authorization: token $GIT_APIKEY" \
|
||||
--upload-file json-server-$CHART_VERSION.tgz \
|
||||
https://code.spamasaurus.com/api/packages/$GIT_USERNAME/helm/api/charts
|
||||
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: gcr.io/kaniko-project/executor:debug
|
||||
pull: always
|
||||
commands:
|
||||
- |
|
||||
wget https://github.com/jqlang/jq/releases/download/jq-1.6/jq-linux64 -O /bin/jq
|
||||
chmod +x /bin/jq
|
||||
- |
|
||||
/bin/jq '.auths["https://bv11-cr01.bessems.eu/v2"].auth="'"$(echo $DOCKER_USERNAME':'$DOCKER_PASSWORD | base64)"'"' --null-input > /kaniko/.docker/config.json
|
||||
- |
|
||||
/kaniko/executor \
|
||||
--dockerfile=Dockerfile \
|
||||
--context=dir://. \
|
||||
--destination=bv11-cr01.bessems.eu/library/json-server:latest
|
||||
environment:
|
||||
DOCKER_USERNAME:
|
||||
from_secret: docker_username
|
||||
DOCKER_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:
|
||||
- |
|
||||
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:
|
||||
- Container image (Harbor)
|
||||
- Container image (docker.io)
|
||||
- Helm chart (Gitea)
|
||||
image: bv11-cr01.bessems.eu/proxy/library/node:20-slim
|
||||
pull: always
|
||||
commands:
|
||||
- |
|
||||
echo 'foo'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
FROM node:latest
|
||||
FROM node:lts-slim AS build
|
||||
|
||||
RUN npm install -g --no-optional --omit=dev \
|
||||
RUN npm install -g --omit=optional --omit=dev \
|
||||
json-server && \
|
||||
npm cache clean --force
|
||||
|
||||
|
||||
Reference in New Issue
Block a user