Compare commits
5
Commits
039196b881
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
878b8d67db | ||
|
|
91fb5e28ec | ||
|
|
de261bb79c | ||
|
|
8dbdeda8dc | ||
|
|
0469052b68 |
+19
-8
@@ -1,7 +1,15 @@
|
||||
default:
|
||||
image:
|
||||
name: registry.gitlab/next-gen-portal/infra-custom-images/helm-utilities:latest
|
||||
entrypoint: [""]
|
||||
tags:
|
||||
- docker
|
||||
|
||||
include:
|
||||
- project: 'next-gen-portal/ci-templates'
|
||||
ref: 'main'
|
||||
file: '/templates/openbao/with-secret.yml'
|
||||
|
||||
stages:
|
||||
- package
|
||||
- publish
|
||||
@@ -21,19 +29,14 @@ variables:
|
||||
GITEA_USERNAME: "gitea_admin"
|
||||
GITEA_REPO: "oci://${GITEA_HOST}/${GITEA_USERNAME}/helm"
|
||||
|
||||
.helm_image: &helm_image
|
||||
name: alpine/helm:3.14.0
|
||||
entrypoint: [""]
|
||||
|
||||
# Only run publish jobs on the main branch
|
||||
.main_only: &main_only
|
||||
- if: '$CI_COMMIT_BRANCH == "main"'
|
||||
|
||||
package_chart:
|
||||
stage: package
|
||||
image: *helm_image
|
||||
script:
|
||||
- helm repo add st-common "${COMMON_PROJECT_URL}" --username "$CI_REGISTRY_USER" --password "$CI_JOB_TOKEN"
|
||||
- helm repo add st-common "${COMMON_PROJECT_URL}" --username "$CI_REGISTRY_USER" --password "$CI_JOB_TOKEN" --ca-file "$GITLAB_CRT"
|
||||
- helm dependency build .
|
||||
- mkdir -p "$PACKAGE_PATH"
|
||||
- helm package . --destination "$PACKAGE_PATH"
|
||||
@@ -44,10 +47,10 @@ package_chart:
|
||||
|
||||
publish_chart:
|
||||
stage: publish
|
||||
image: alpine/curl:8.14.1
|
||||
script:
|
||||
- |
|
||||
curl --fail-with-body --request POST \
|
||||
--cacert "$GITLAB_CRT" \
|
||||
--user "$CI_REGISTRY_USER:$CI_JOB_TOKEN" \
|
||||
--form "chart=@${CHART_ARCHIVE}" \
|
||||
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts"
|
||||
@@ -56,8 +59,16 @@ publish_chart:
|
||||
- package_chart
|
||||
|
||||
push_chart_to_gitea:
|
||||
extends: .openbao-with-secrets
|
||||
stage: publish
|
||||
image: *helm_image
|
||||
|
||||
id_tokens:
|
||||
OPENBAO_ID_TOKEN:
|
||||
aud: "https://openbao.helmholz.local:8200"
|
||||
|
||||
variables:
|
||||
OPENBAO_SECRET_REQUESTS_FILE: "secrets.json"
|
||||
|
||||
script:
|
||||
- echo "$GITEA_TOKEN" | helm registry login "$GITEA_HOST" --username "$GITEA_USERNAME" --password-stdin
|
||||
- helm push "${CHART_ARCHIVE}" "$GITEA_REPO"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"namespace": "devops",
|
||||
"role": "gitlab-freeradius",
|
||||
"mount": "gitea",
|
||||
"path": "token",
|
||||
"field": "token",
|
||||
"variable": "GITEA_TOKEN"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user