Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CTA
Manage
Activity
Members
Labels
Plan
Issues
213
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
27
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cta
CTA
Merge requests
!512
Add redeploy script
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Add redeploy script
add_redeploy_script
into
main
Overview
4
Commits
1
Pipelines
6
Changes
2
All threads resolved!
Hide all comments
Merged
Konstantina Skovola
requested to merge
add_redeploy_script
into
main
8 months ago
Overview
4
Commits
1
Pipelines
6
Changes
2
All threads resolved!
Hide all comments
Expand
Summary
Requires manual tests in pre-production
References
Closes
#689 (closed)
Edited
8 months ago
by
Konstantina Skovola
👍
0
👎
0
Merge request reports
Compare
main
version 5
997c8685
8 months ago
version 4
e6724967
8 months ago
version 3
824a845e
8 months ago
version 2
4c4d8ab0
8 months ago
version 1
5ece2eda
8 months ago
main (base)
and
latest version
latest version
76c004e8
1 commit,
8 months ago
version 5
997c8685
1 commit,
8 months ago
version 4
e6724967
1 commit,
8 months ago
version 3
824a845e
1 commit,
8 months ago
version 2
4c4d8ab0
1 commit,
8 months ago
version 1
5ece2eda
1 commit,
8 months ago
2 files
+
64
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
2
Search (e.g. *.vue) (Ctrl+P)
continuousintegration/ci_runner/redeploy.sh
0 → 100755
+
63
−
0
Options
#!/bin/bash
# @project The CERN Tape Archive (CTA)
# @copyright Copyright © 2024 CERN
# @license This program is free software, distributed under the terms of the GNU General Public
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". You can
# redistribute it and/or modify it under the terms of the GPL Version 3, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# In applying this licence, CERN does not waive the privileges and immunities
# granted to it by virtue of its status as an Intergovernmental Organization or
# submit itself to any jurisdiction.
IMAGE_TAG
=
${
1
:-
dev
}
#default tag is dev
KUBE_NAMESPACE
=
${
2
:-
stress
}
if
[
"$#"
-ge
3
]
;
then
echo
"Usage: The script
$0
takes two optional arguments: image tag (1) and namespace name (2)"
exit
1
fi
echo
"Launching redeploy script; image tag is
$IMAGE_TAG
, namespace name is
$KUBE_NAMESPACE
"
# Script should be run as cirunner
if
[[
$(
whoami
)
!=
'cirunner'
]]
then
echo
"Current user is
$(
whoami
)
, aborting. Script must run as cirunner"
exit
1
fi
# Delete previous instance, if it exists
echo
"Deleting the old namespace, if it exists"
cd
~/CTA/continuousintegration/orchestration/
&&
./delete_instance.sh
-n
$KUBE_NAMESPACE
# Clear the old image and namespace
echo
"Deleting old image and removing it from minikube"
podman rmi ctageneric:
$IMAGE_TAG
minikube image
rm
localhost/ctageneric:
$IMAGE_TAG
cd
~/CTA/continuousintegration/ci_runner
rm
-rf
ctageneric.tar
## Create and load the new images
# Prepare new image
echo
"Preparing new image"
cd
~/CTA/continuousintegration/ci_runner
# should already be here
./prepareImage.sh ~/CTA_rpm/RPM/RPMS/x86_64
$IMAGE_TAG
# Save the image in a tar file
echo
"Saving new image"
podman save
-o
ctageneric.tar localhost/ctageneric:
$IMAGE_TAG
# Load the new image
echo
"Loading new image into minikube"
minikube image load ctageneric.tar localhost/ctageneric:
$IMAGE_TAG
# Redeploy containers
echo
"Redeploying container"
cd
~/CTA/continuousintegration/orchestration
./create_instance.sh
-n
$KUBE_NAMESPACE
-i
$IMAGE_TAG
-D
-O
-d
internal_postgres.yaml
Loading