Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CTA
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
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
Commits
76c004e8
Commit
76c004e8
authored
10 months ago
by
Konstantina Skovola
Committed by
Konstantina Skovola
10 months ago
Browse files
Options
Downloads
Patches
Plain Diff
Add redeploy script
parent
f527b7e5
No related branches found
No related tags found
1 merge request
!512
Add redeploy script
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
continuousintegration/ci_runner/redeploy.sh
+63
-0
63 additions, 0 deletions
continuousintegration/ci_runner/redeploy.sh
continuousintegration/orchestration/delete_instance.sh
+1
-1
1 addition, 1 deletion
continuousintegration/orchestration/delete_instance.sh
with
64 additions
and
1 deletion
continuousintegration/ci_runner/redeploy.sh
0 → 100755
+
63
−
0
View file @
76c004e8
#!/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
This diff is collapsed.
Click to expand it.
continuousintegration/orchestration/delete_instance.sh
+
1
−
1
View file @
76c004e8
...
@@ -114,7 +114,7 @@ echo OK
...
@@ -114,7 +114,7 @@ echo OK
# this now useless as dummy NFS PV were replaced by local volumes
# this now useless as dummy NFS PV were replaced by local volumes
# those are recycled automatically
# those are recycled automatically
./recycle_librarydevice_PV.sh
#
./recycle_librarydevice_PV.sh
echo
"Status of library pool after test:"
echo
"Status of library pool after test:"
kubectl get pv
kubectl get pv
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment