Commit dabb3c0c authored by Antoine Regimbeau's avatar Antoine Regimbeau

Apply shellcheck modification

parent d8302f38
Pipeline #2424 passed with stages
in 67 minutes and 20 seconds
......@@ -4,7 +4,7 @@
# Configure git for tar.xz
git config tar.tar.xz.command "xz -c"
if [ $CI_COMMIT_REF_NAME = "develop" ] # check if the branch name is develop or not
if [ "$CI_COMMIT_REF_NAME" = "develop" ] # check if the branch name is develop or not
then # we are on develop
jobs_directory=/home/otbpush/test/$(date +%F)
else # we are on a release branch
......@@ -18,7 +18,7 @@ echo "Creating today's directory"
ssh otbpush@otb5-vm2.orfeo-toolbox.org mkdir -p ${jobs_directory}
# Delete latest
echo "Deleting latest directory"
if [ $CI_COMMIT_REF_NAME = "develop" ]
if [ "$CI_COMMIT_REF_NAME" = "develop" ]
then # On develop
ssh otbpush@otb5-vm2.orfeo-toolbox.org rm -rf /home/otbpush/test/latest
# Create symilink
......@@ -26,7 +26,7 @@ then # On develop
# Cleaning old directory
matching_dirs=$(ls -1 | grep -oE '^20[0-9]{2}-[0-9]{2}-[0-9]{2}$' | sort)
history_length=11
rm -rf $(echo $matching_dirs | tr ' ' '\n' | head -n -${history_length})
rm -rf "$(echo "$matching_dirs" | tr ' ' '\n' | head -n -${history_length})"
else # On release
# Remove what is inside staging area
ssh otbpush@otb5-vm2.orfeo-toolbox.org rm -rf ${jobs_directory}/*
......@@ -43,9 +43,9 @@ OTB-Doxygen-*.tar.bz2} otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/.
# Create zip, tar.gz and tar.xy source
echo "Creating source tarball and zip"
git archive --format=zip -o OTB-sources-$CI_COMMIT_SHORT_SHA.zip HEAD
git archive --format=tgz -o OTB-sources-$CI_COMMIT_SHORT_SHA.tar.gz HEAD
git archive --format=tar.xz -o OTB-sources-$CI_COMMIT_SHORT_SHA.tar.xz HEAD
git archive --format=zip -o OTB-sources-"$CI_COMMIT_SHORT_SHA".zip HEAD
git archive --format=tgz -o OTB-sources-"$CI_COMMIT_SHORT_SHA".tar.gz HEAD
git archive --format=tar.xz -o OTB-sources-"$CI_COMMIT_SHORT_SHA".tar.xz HEAD
# Remove old source file
echo "Removing old sources"
ssh otbpush@otb5-vm2.orfeo-toolbox.org \
......@@ -54,20 +54,20 @@ ${jobs_directory}/OTB-sources-*.tar.*
# Push new source file
echo "Pushing new sources"
scp OTB-sources-$CI_COMMIT_SHORT_SHA.* \
scp OTB-sources-"$CI_COMMIT_SHORT_SHA".* \
otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/
echo ${CI_COMMIT_SHA} > ref.sha
echo "${CI_COMMIT_SHA}" > ref.sha
echo "Pushing ref.sha"
scp ref.sha otbpush@otb5-vm2.orfeo-toolbox.org:${jobs_directory}/
#Untar doc
if [ $CI_COMMIT_REF_NAME = "develop" ]
if [ "$CI_COMMIT_REF_NAME" = "develop" ]
then
ssh otbpush@otb5-vm2.orfeo-toolbox.org \
tar -xf ${jobs_directory}/CookBook-*-html.tar.gz
ssh otbpush@otb5-vm2.orfeo-toolbox.org \
rm -rf /home/otbpush/test/CookBook/*
ssh otbpush@otb5-vm2.orfeo-toolbox.org \
mv ${jobs_directory}/CookBook-*/* /home/otbpush/test/CookBook
mv ${jobs_directory}/CookBook-*/* /home/otbpush/test/CookBook/.
fi
\ No newline at end of file
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