Commit 9e17abd56186

Vincent Demeester <vincent@sbr.pm>
2020-09-08 18:41:34
chos4: fix secrets and oauth configuration
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 9e01d0b
Changed files (1)
pkgs
scripts
pkgs/scripts/bin/chos4
@@ -24,10 +24,17 @@ done
 
 echo ">>> setup identity providers"
 if test -f $HOME/sync/work/chos4/users.htpasswd; then
+    oc get -n openshift-config secret htpass-secret && \
+            oc delete -n openshift-config secret htpass-secret
     oc create secret generic htpass-secret --from-file=htpasswd=$HOME/sync/work/chos4/users.htpasswd -n openshift-config
-    for cr in $HOME/sync/chos4/oauth.*.yaml; do
-        oc apply -f $cr
-    done
+fi
+if test -f $HOME/sync/work/chos4/github.clientsecret; then
+    oc get -n openshift-config secret github-secret && \
+            oc delete -n openshift-config secret github-secret
+    oc create secret generic github-secret --from-file=$HOME/sync/work/chos4/github.clientsecret -n openshift-config
+fi
+if test -f $HOME/sync/work/chos4/oauth.yaml; then
+    oc apply -f $HOME/sync/work/chos4/oauth.yaml
 fi
 
 if [[ "$1" == "install" ]]; then