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:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
name: Deploy to Cluster
|
name: Deploy to Cluster
|
||||||
environment: ${{ github.ref_name == 'main' && 'prod' || 'staging' }}
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 30
|
timeout-minutes: 30
|
||||||
env:
|
|
||||||
NAMESPACE: ${{ vars.NAMESPACE }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
|
|||||||
17
deploy.sh
17
deploy.sh
@@ -27,13 +27,18 @@ kubectl create namespace cert-manager \
|
|||||||
kubectl apply -f manifest/charts/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
|
if [[ -f $HOME/.docker/config.json ]]; then
|
||||||
kubectl create secret generic regcred \
|
for NAMESPACE in ${NAMESPACES_LIST//,/ }; do
|
||||||
--from-file=.dockerconfigjson=$HOME/.docker/config.json \
|
kubectl create namespace $NAMESPACE \
|
||||||
--type=kubernetes.io/dockerconfigjson \
|
--dry-run=client -o yaml | kubectl apply -f -
|
||||||
--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 \
|
||||||
|
-n $NAMESPACE \
|
||||||
|
--dry-run=client -o yaml | kubectl apply -f -
|
||||||
|
done
|
||||||
else
|
else
|
||||||
echo "Docker config file not found at $HOME/.docker/config.json. Skipping registry secret creation."
|
echo "Docker config file not found at $HOME/.docker/config.json. Skipping registry secret creation."
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user