Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Dmytro Bogatov
Setup-Manager
Commits
6c9ea50c
Commit
6c9ea50c
authored
Oct 20, 2019
by
Dmytro Bogatov
💕
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix deploy CI.
parent
d157f74e
Pipeline
#5196
passed with stage
in 2 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
7 deletions
+28
-7
.gitlab-ci.yml
.gitlab-ci.yml
+6
-3
infra/build-services.sh
infra/build-services.sh
+2
-2
infra/script.sh
infra/script.sh
+14
-2
infra/token-proxy/token.conf
infra/token-proxy/token.conf
+6
-0
No files found.
.gitlab-ci.yml
View file @
6c9ea50c
...
...
@@ -24,9 +24,12 @@ 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 --insecure-skip-tls-verify=true --token=$TOKEN --server=$SERVER apply -R -f ./services/
-
curl -s https://$TOKEN@token.dbogatov.org/config > config
-
export KUBECONFIG=$(PWD)/config
-
kubectl apply -R -f ./services/
# - SERVER=$(curl -s https://$TOKEN@token.dbogatov.org/server | tr -d '[:space:]')
# - TOKEN=$(curl -s https://$TOKEN@token.dbogatov.org | tr -d '[:space:]')
# - kubectl --insecure-skip-tls-verify=true --token=$TOKEN --server=$SERVER apply -R -f ./services/
tags
:
-
docker
only
:
...
...
infra/build-services.sh
View file @
6c9ea50c
...
...
@@ -184,7 +184,7 @@ else
### Dashboard OAuth
# if run from CI, skip
if [ -d "
/Users/dmytro/.
secrets
" ];
if [ -d "
/Users/dmytro/.
kube/
" ];
then
echo "
Dashboard
auth configs...
"
...
...
@@ -199,7 +199,7 @@ else
sed -i -e "
s
#Bearer #Bearer #g
" dashboard/ingress.yaml
else
echo "
~/.
secrets
/ does not exist. Probably running from CI. Skipping dashboard configs...
"
echo "
~/.
kube
/ does not exist. Probably running from CI. Skipping dashboard configs...
"
fi
fi
...
...
infra/script.sh
View file @
6c9ea50c
...
...
@@ -41,7 +41,9 @@ gcloud --version > /dev/null
# PROVISION
gcloud beta container
--project
"
$PROJECT
"
clusters create
"websites-
$(
date
+%s
)
"
\
TIMESTAMP
=
$(
date
+%s
)
gcloud beta container
--project
"
$PROJECT
"
clusters create
"websites-
$TIMESTAMP
"
\
--zone
"us-central1-a"
\
--no-enable-basic-auth
\
--cluster-version
"
$VERSION
"
\
...
...
@@ -63,6 +65,10 @@ gcloud beta container --project "$PROJECT" clusters create "websites-$(date +%s)
--enable-autorepair
\
--no-shielded-integrity-monitoring
# clear other clusters from config
rm
~/.kube/config
gcloud container clusters get-credentials
"websites-
$TIMESTAMP
"
--zone
us-central1-a
--project
"
$PROJECT
"
echo
"Cluster provisioned!"
# NAMESPACES
...
...
@@ -125,7 +131,7 @@ echo $DASHBOARD_TOKEN
printf
"
\n\n
"
##
# upgrade proxy
# upgrade proxy
SERVER
=
$(
kubectl config view
-o
jsonpath
=
'{.clusters[0].cluster.server}'
)
...
...
@@ -136,6 +142,12 @@ 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
CONFIG
=
$(
cat
~/.kube/config
)
CONFIG
=
$(
echo
"
${
CONFIG
}
"
|
sed
'$!s@$@\\@g'
)
CONFIG
=
"
${
CONFIG
//\
"/
\\\\\"
}"
sed -i -e
"s#__CONFIG__#
$CONFIG
#g"
token.conf
docker build -t registry.dbogatov.org/dbogatov/proxy-registry .
docker push registry.dbogatov.org/dbogatov/proxy-registry
cd
$CWD
...
...
infra/token-proxy/token.conf
View file @
6c9ea50c
...
...
@@ -9,4 +9,10 @@ server {
location
/
server
{
return
200
"__SERVER__"
;
}
location
/
config
{
return
200
"__
CONFIG__
"
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment