Commit ba28ccd4 authored by Antoine Regimbeau's avatar Antoine Regimbeau
Browse files

CI: add new script for deployement of prod packages

parent c772c45f
Pipeline #1941 passed with stages
in 78 minutes and 10 seconds
......@@ -5,6 +5,13 @@
staging_area=/home/otbpush/test/staging
prod_area=/home/otbpush/test/prod
#check if we are dealing with the right packages
server_name="otbpush@otb5-vm2.orfeo-toolbox.org"
pack_sha=`ssh ${server_name} head ${staging_area}/ref.sha`
if [ ${pack_sha} != ${CI_COMMIT_SHA} ]
then
echo "Wrong sha1"
exit 1
fi
pack_suffix=-`echo "$CI_COMMIT_TAG" | grep -o "rc[0-9]*"` # this retrieve the rc number
echo "pack_suffix=${pack_suffix}"
......@@ -12,16 +19,29 @@ echo "pack_suffix=${pack_suffix}"
echo "Renaming binary packages"
# find build_packages/. -name "*.run" \
# -exec sh -c 'mv "$1" "${1%.run}${pack_suffix}.run"' _ {} \;
packages_list=`ls ${staging_area} | grep -E "OTB-[0-9]*.[0-9]*.[0-9]*-.*\.(run|zip)"`
ls -all build_packages/
for name in packages_list
do
len=${#name}
#add pack_suffix to the name
mv "$name" "${name:0:$len-4}${pack_suffix}${name:$len-4}"
file_list=`ssh ${server_name} ls ${staging_area}`
# | grep -E "OTB-[0-9]*.[0-9]*.[0-9]*-.*\.(run|zip)"
# TO REMOVE
###########
ssh ${server_name} ls -all ${staging_area}
###########
for name in ${file_list}
do
is_package=`echo ${name} | grep -E "OTB-[0-9]*.[0-9]*.[0-9]*-.*\.(run|zip)"`
if [ ${is_package} ] # it is a package, we need to change the name
then
len=${#name}
ssh ${server_name} cp ${staging_area}/${name} \
${prod_area}/${name:0:$len-4}${pack_suffix}${name:$len-4}
else
ssh ${server_name} cp ${staging_area}/${name} ${prod_area}/${name}
fi
done
# TO REMOVE
###########
ls -all build_packages/
###########
\ No newline at end of file
ssh ${server_name} ls -all ${prod_area}
###########
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