Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to use local services area via optional parameter #1269

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions kubernetes/cmsweb/scripts/deploy-srv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# helper script to deploy given service with given tag to k8s infrastructure

if [ $# -lt 2 ]; then
echo "The required parameters for service and tag are missing. Please use deploy-srv.sh <service> <tag> <env> "
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@amaltaro Yes, this can cause a mixup of parameters 3 and 4. I think rather than removing the env variable entirely, we can make the script take keyword arguments because when you're doing multiple deployments at the same time, it helps to make sure that you are deploying in the correct environment.

echo "The required parameters for service and tag are missing. Please use deploy-srv.sh <service> <tag> <env> <optional services area>"
exit 1;
fi

Expand Down Expand Up @@ -58,9 +58,13 @@ fi
srv=$1
cmsweb_image_tag=:$2

if [ $# == 3 ]; then
if [ $# -ge 3 ]; then
env=$3
fi
localServices=""
if [ $# == 4 ]; then
localServices=$4
fi

cmsweb_env=k8s-$env
cmsweb_log=logs-cephfs-claim-$env
Expand Down Expand Up @@ -151,8 +155,15 @@ if [ -d $tmpDir ]; then
rm -rf $tmpDir
fi
mkdir -p $tmpDir
cd $tmpDir
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/kubernetes/cmsweb/services/$srv.yaml
if [ "$localServices" != "" ] && [ -f $localServices/$srv.yaml ]; then
echo "copy $localServices/$srv.yaml to $tmpDir"
cp $localServices/$srv.yaml $tmpDir
cd $tmpDir
else
cd $tmpDir
echo "fetch https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/kubernetes/cmsweb/services/$srv.yaml to $tmpDir"
curl -ksLO https://raw.githubusercontent.com/dmwm/CMSKubernetes/master/kubernetes/cmsweb/services/$srv.yaml
fi

# check that service file has imagetag
if [ -z "`grep imagetag $srv.yaml`" ]; then
Expand Down