adds secretRefs to the jobs
This commit is contained in:
parent
d90402b74a
commit
701771ad13
2 changed files with 18 additions and 15 deletions
|
@ -52,15 +52,7 @@ spec:
|
||||||
|
|
||||||
git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@gitea-${DOMAIN}/giteaAdmin/edfbuilder.git
|
git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@gitea-${DOMAIN}/giteaAdmin/edfbuilder.git
|
||||||
cd edfbuilder
|
cd edfbuilder
|
||||||
yq eval '.configs.cm.oidc.config =
|
yq eval '.configs.cm."oidc.config" = "name: Keycloak\nissuer: https://192-168-197-2.c-one-infra.de/keycloak/realms/cnoe\nclientID: argocd\nclientSecret: $auth-generic-oauth-secret:client_secret\nrequestedScopes: [\"openid\", \"profile\", \"email\", \"groups\"]"' -i stacks/core/argocd/values.yaml
|
||||||
{
|
|
||||||
"name": "Keycloak",
|
|
||||||
"issuer": "https://${DOMAIN}/keycloak/realms/cnoe/.well-known/openid-configuration",
|
|
||||||
"clientID": "argocd",
|
|
||||||
"clientSecret": "$auth-generic-oauth-secret:client_secret",
|
|
||||||
"requestedScopes": ["openid", "profile", "email", "groups"]
|
|
||||||
}
|
|
||||||
' -i stacks/core/argocd/values.yaml
|
|
||||||
|
|
||||||
git add stacks/core/argocd/values.yaml
|
git add stacks/core/argocd/values.yaml
|
||||||
git commit -m "adds Forgejo SSO config"
|
git commit -m "adds Forgejo SSO config"
|
||||||
|
|
|
@ -11,16 +11,26 @@ spec:
|
||||||
metadata:
|
metadata:
|
||||||
generateName: forgejo-config-
|
generateName: forgejo-config-
|
||||||
spec:
|
spec:
|
||||||
# serviceAccountName: forgejo-config
|
# serviceAccountName: bot
|
||||||
restartPolicy: Never
|
restartPolicy: OnFailure
|
||||||
containers:
|
containers:
|
||||||
- name: push
|
- name: push
|
||||||
image: docker.io/library/ubuntu:22.04
|
image: docker.io/library/ubuntu:22.04
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: auth-generic-oauth-secret # thats the external secret the job should wait for
|
||||||
|
- secretRef:
|
||||||
|
name: k8s-job-token # edpbuilder should create this automatically and feed it to this job
|
||||||
command: ["/bin/bash", "-c"]
|
command: ["/bin/bash", "-c"]
|
||||||
args:
|
args:
|
||||||
- |
|
- |
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
|
if [[ "$client_secret" == "" ]];
|
||||||
|
then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
apt -qq update
|
apt -qq update
|
||||||
apt -qq install git wget -y
|
apt -qq install git wget -y
|
||||||
if [[ "$(uname -m)" == "x86_64" ]]; then
|
if [[ "$(uname -m)" == "x86_64" ]]; then
|
||||||
|
@ -34,11 +44,11 @@ spec:
|
||||||
fi
|
fi
|
||||||
|
|
||||||
DOMAIN=192-168-197-2.c-one-infra.de
|
DOMAIN=192-168-197-2.c-one-infra.de
|
||||||
GIT_USERNAME=bot
|
GIT_USERNAME=giteaAdmin
|
||||||
GIT_PASSWORD=ca78ba327f61588a564907638920d163936863c9
|
GIT_PASSWORD=2e53bfe27b64a5aa4e8bc591e15b33cc92ff95fa
|
||||||
|
|
||||||
git config --global user.email "bot@bots.de"
|
git config --global user.email "bot@bots.de"
|
||||||
git config --global user.name "bot"
|
git config --global user.name "giteaAdmin"
|
||||||
|
|
||||||
git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@gitea-${DOMAIN}/giteaAdmin/edfbuilder.git
|
git clone https://${GIT_USERNAME}:${GIT_PASSWORD}@gitea-${DOMAIN}/giteaAdmin/edfbuilder.git
|
||||||
cd edfbuilder
|
cd edfbuilder
|
||||||
|
@ -68,4 +78,5 @@ spec:
|
||||||
|
|
||||||
git add stacks/core/forgejo/values.yaml
|
git add stacks/core/forgejo/values.yaml
|
||||||
git commit -m "adds Forgejo SSO config"
|
git commit -m "adds Forgejo SSO config"
|
||||||
git push
|
git push
|
||||||
|
backoffLimit: 99
|
Loading…
Reference in a new issue