Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Julien Cabieces
otb
Commits
b46fe2aa
There was an error fetching the commit references. Please try again later.
Commit
b46fe2aa
authored
5 years ago
by
Antoine Regimbeau
Browse files
Options
Downloads
Patches
Plain Diff
New deploy script
parent
c6748438
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CI/deploy.sh
+49
-13
49 additions, 13 deletions
CI/deploy.sh
with
49 additions
and
13 deletions
CI/deploy.sh
+
49
−
13
View file @
b46fe2aa
#!/bin/bash
# Configure git for tar.xz
git config tar.tar.xz.command
"xz -c"
if
[
$1
=
"develop"
]
# check if the branch name is develop or not
pack_suffix
=
""
then
# we are on develop
jobs_directory
=
/home/otbpush/test/
$(
date
+%F
)
else
# we are on a release branch
jobs_directory
=
/home/otbpush/test/staging
if
[
\(
"$#"
-eq
2
\)
&&
\(
echo
"
$2
"
|
grep
"rc[0-9]*"
\)
]
then
# there is a rc tag, we need a suffix for packages
pack_suffix
=
$(
echo
"
$2
"
|
grep
-o
"rc[0-9]*"
)
# this retrieve the rc number
fi
fi
echo
"jobs_directory=
${
jobs_directory
}
"
echo
"pack_suffix=
${
pack_suffix
}
"
# Create today's directory on serveur otb5-vm2
echo
"Creating today's directory"
ssh otbpush@otb5-vm2.orfeo-toolbox.org
mkdir
-p
/home/otbpush/test/
$(
date
+%F
)
ssh otbpush@otb5-vm2.orfeo-toolbox.org
mkdir
-p
${
jobs_directory
}
# Delete latest
echo
"Deleting latest directory"
ssh otbpush@otb5-vm2.orfeo-toolbox.org
rm
-rf
/home/otbpush/test/latest
# Create symilink
ssh otbpush@otb5-vm2.orfeo-toolbox.org
ln
-s
/home/otbpush/test/
$(
date
+%F
)
/home/otbpush/test/latest
if
[
$1
=
"develop"
]
then
# On develop
ssh otbpush@otb5-vm2.orfeo-toolbox.org
rm
-rf
/home/otbpush/test/latest
# Create symilink
ssh otbpush@otb5-vm2.orfeo-toolbox.org
ln
-s
${
jobs_directory
}
/home/otbpush/test/latest
# 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
}
)
else
# On release
# Remove what is inside staging area
ssh otbpush@otb5-vm2.orfeo-toolbox.org
rm
-rf
${
jobs_directory
}
/
*
fi
# Push package
echo
"Renaming binary packages"
find build_packages/.
-name
"*.run"
\
-exec
sh
-c
'mv "$1" "${1%.run}${pack_suffix}.run"'
_
{}
\;
# TO REMOVE
###########
ls
-all
###########
echo
"Pushing binary packages"
scp build_packages/
*
.run otbpush@otb5-vm2.orfeo-toolbox.org:
/home/otbpush/test/
$(
date
+%F
)
/.
scp build_packages/
*
.run otbpush@otb5-vm2.orfeo-toolbox.org:
${
jobs_directory
}
/.
# Push doc
echo
"Pushing documentation"
scp build/
{
CookBook-
*
-html
.tar.gz,
\
/Documentation/
{
Cookbook/latex/CookBook-
*
.pdf,
\
Documentation/Doxygen/OTB-Doxygen-
*
.tar.bz2
}}
\
otbpush@otb5-vm2.orfeo-toolbox.org:
/home/otbpush/test/
$(
date
+%F
)
/.
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-
develop
-
$CI_COMMIT_SHORT_SHA
.zip HEAD
git archive
--format
=
tgz
-o
OTB-
develop
-
$CI_COMMIT_SHORT_SHA
.tar.gz HEAD
git archive
--format
=
tar.xz
-o
OTB-
develop
-
$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
\
rm
/home/otbpush/test/
$(
date
+%F
)
/OTB-develop
-
*
.zip
\
/home/otbpush/test/
$(
date
+%F
)
/OTB-develop
-
*
.tar.
*
rm
${
jobs_directory
}
/OTB-sources
-
*
.zip
\
${
jobs_directory
}
/OTB-sources
-
*
.tar.
*
# Push new source file
echo
"Pushing new sources"
scp OTB-
develop
-
$CI_COMMIT_SHORT_SHA
.
*
\
otbpush@otb5-vm2.orfeo-toolbox.org:
/home/otbpush/test/
$(
date
+%F
)
/
scp OTB-
sources
-
$CI_COMMIT_SHORT_SHA
.
*
\
otbpush@otb5-vm2.orfeo-toolbox.org:
${
jobs_directory
}
/
\ No newline at end of file
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