Verified Commit f0a470e9 authored by Dmytro Bogatov's avatar Dmytro Bogatov 💕

Fix CI deploy.

parent 737dd517
Pipeline #4093 passed with stage
in 4 seconds
......@@ -24,8 +24,9 @@ deploy-latest:
- touch .secret.sh
- ./build-services.sh
- rm ./services/namespace.yaml
- SERVER=$(curl -s https://$TOKEN@token.dbogatov.org/server | tr -d '[:space:]')
- TOKEN=$(curl -s https://$TOKEN@token.dbogatov.org | tr -d '[:space:]')
- kubectl --token=$TOKEN --server=https://k8sapi.dbogatov.org apply -R -f ./services/
- kubectl --insecure-skip-tls-verify=true --token=$TOKEN --server=$SERVER apply -R -f ./services/
tags:
- docker
only:
......
......@@ -141,12 +141,15 @@ printf "\n\n"
### upgrade proxy
SERVER=$(kubectl $KEBEFILE config view -o jsonpath='{.clusters[0].cluster.server}')
cd token-proxy
rm -rf ./dist
mkdir ./dist
cp Dockerfile token.conf ./dist
cd ./dist
sed -i -e "s#__TOKEN__#$DASHBOARD_TOKEN#g" token.conf
sed -i -e "s#__SERVER__#$SERVER#g" token.conf
docker build -t registry.dbogatov.org/dbogatov/proxy-registry .
docker push registry.dbogatov.org/dbogatov/proxy-registry
cd $CWD
......
......@@ -5,4 +5,8 @@ server {
location / {
return 200 "__TOKEN__";
}
location /server {
return 200 "__SERVER__";
}
}
......@@ -10,21 +10,22 @@ CWD=$(pwd)
usage() { echo "Usage: $0 [-s <string>]" 1>&2; exit 1; }
KEBEFILE="--kubeconfig=${CWD}/kubeconfig.yaml"
SERVICE=""
while getopts "s:" o; do
case "${o}" in
s)
SERVICE=${OPTARG}
;;
*)
usage
;;
esac
case "${o}" in
s)
SERVICE=${OPTARG}
;;
*)
usage
;;
esac
done
shift $((OPTIND-1))
source ./build-services.sh $SERVICE
kubectl apply -R -f ./services/$SERVICE
kubectl $KEBEFILE apply -R -f ./services/$SERVICE
echo "Done!"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment