Merge pull request #126 from HideyoshiSolutions/fix/fixes-broken-deployment
fix: fixes broken deployment
This commit is contained in:
3
.github/workflows/deploy.yml
vendored
3
.github/workflows/deploy.yml
vendored
@@ -11,11 +11,8 @@ on:
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy to Cluster
|
||||
environment: ${{ github.ref_name == 'main' && 'prod' || 'staging' }}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 30
|
||||
env:
|
||||
NAMESPACE: ${{ vars.NAMESPACE }}
|
||||
|
||||
steps:
|
||||
- name: Checkout Repository
|
||||
|
||||
11
deploy.sh
11
deploy.sh
@@ -27,13 +27,18 @@ kubectl create namespace cert-manager \
|
||||
kubectl apply -f manifest/charts/cert-manager
|
||||
|
||||
|
||||
### configures docker registry secret ###
|
||||
### set application namespaces and configures docker registry secret ###
|
||||
if [[ -f $HOME/.docker/config.json ]]; then
|
||||
kubectl create secret generic regcred \
|
||||
for NAMESPACE in ${NAMESPACES_LIST//,/ }; do
|
||||
kubectl create namespace $NAMESPACE \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
|
||||
kubectl create secret generic $(echo $NAMESPACE | tr '[:upper:]' '[:lower:]')-regcred \
|
||||
--from-file=.dockerconfigjson=$HOME/.docker/config.json \
|
||||
--type=kubernetes.io/dockerconfigjson \
|
||||
--namespace=$NAMESPACE \
|
||||
-n $NAMESPACE \
|
||||
--dry-run=client -o yaml | kubectl apply -f -
|
||||
done
|
||||
else
|
||||
echo "Docker config file not found at $HOME/.docker/config.json. Skipping registry secret creation."
|
||||
fi
|
||||
Reference in New Issue
Block a user