Verified Commit 5c3f5758 authored by Dmytro Bogatov's avatar Dmytro Bogatov 💕

Fix #8.

parent 9977b451
......@@ -4,8 +4,14 @@ set -e
shopt -s globstar
# Ensure that the CWD is set to script's location
cd "${0%/*}"
CWD=$(pwd)
REPLICAS="3"
source .secret.sh
#
# $1 - URL
# $2 - name
......@@ -115,8 +121,14 @@ generate-service () {
URL=${service//-/.}
fi
docker pull $image > /dev/null
image=$(docker inspect --format='{{index .RepoDigests 0}}' $image)
creds="--creds=dbogatov:$DOCKERPASS"
if [[ $image = *"registry.hub.docker.com"* ]]; then
creds=""
fi
digest=$(skopeo inspect $creds docker://$image | jq '.Digest')
digest="${digest%\"}"
digest="${digest#\"}"
image=${image%:*}@$digest
sed -i -e "s#__IMAGE__#$image#g" services/$service/{service,deployment}.yaml
sed -i -e "s#__NAME__#$service#g" services/$service/{service,deployment}.yaml
......
......@@ -11,23 +11,24 @@ CWD=$(pwd)
# Checks
usage () {
printf "usage: ./$0 <pswd> <certDirPath> <statusSiteConfig>\n"
printf "usage: ./$0 <certDirPath> <statusSiteConfig>\n"
printf "where\n"
printf "\t pswd - docker registry password for host registry.dbogatov.org and user dbogatov\n"
# printf "\t pswd - docker registry password for host registry.dbogatov.org and user dbogatov\n"
printf "\t certDirPath - absolute path to directory with SSL cert (certificate.crt) and key (certificate.key) file\n"
printf "\t statusSiteConfig - absolute path to appsettings.production.yml file\n"
exit 1;
}
if ! [ $# -eq 3 ]
if ! [ $# -eq 2 ]
then
usage
fi
DOCKERPASS=$1
CERTDIRPATH=$2
STATUSSITECONFIG=$3
source .secret.sh
CERTDIRPATH=$1
STATUSSITECONFIG=$2
# Initiate cluster
......
......@@ -4,7 +4,7 @@ declare -A SERVICES
SERVICES["dbogatov-org"]="registry.dbogatov.org/dbogatov/cv-website:latest"
SERVICES["blog-dbogatov-org"]="registry.dbogatov.org/dbogatov/my-blog:latest"
SERVICES["legacy-dbogatov-org"]="dbogatov/legacy:latest"
SERVICES["legacy-dbogatov-org"]="registry.hub.docker.com/dbogatov/legacy:latest"
SERVICES["socialimps-dbogatov-org"]="registry.dbogatov.org/dbogatov/cs-3043-group-project:latest"
SERVICES["push-dbogatov-org"]="registry.dbogatov.org/dbogatov/pushexpress:latest"
SERVICES["mail-dbogatov-org"]="registry.dbogatov.org/dbogatov/nginx-proxies/mail-dbogatov-org:latest"
......
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