Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Application web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Agroclim
AgroMetInfo
Application web
Merge requests
!8
Ajouter le script de déploiement
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Ajouter le script de déploiement
script-deploiement
into
main
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Olivier Maury
requested to merge
script-deploiement
into
main
1 year ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
refs agroclim/agrometinfo/www#1
0
0
Merge request reports
Compare
main
main (base)
and
latest version
latest version
d6ae73c7
1 commit,
1 year ago
1 file
+
50
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
bin/deploy.sh
0 → 100755
+
50
−
0
Options
#!/bin/bash
set
-e
function
echo_bold_green
{
echo
-e
"
\0
33[32;1m"
$1
"
\0
33[0m"
;
}
function
echo_bold_red
{
echo
-e
"
\0
33[31;1m"
$1
"
\0
33[0m"
;
}
PROFILE
=
$1
if
[
"
$PROFILE
"
==
""
]
;
then
echo
"Usage:
$0
<profile>"
;
echo
" <profile> : preprod / prod"
;
exit
1
;
elif
[
"
$PROFILE
"
==
"preprod"
]
;
then
SERVER
=
"agrometinfo-preprod"
COLOR
=
"
\0
33[33;1;7m"
elif
[
"
$PROFILE
"
==
"prod"
]
;
then
SERVER
=
"agrometinfo-prod"
COLOR
=
"
\0
33[31;1;7m"
else
echo
"Profil inconnu :
$PROFILE
"
;
exit
1
;
fi
echo
-e
"Are you sure to deploy AgroMetInfo on
$COLOR$SERVER
\0
33[0m? (y/N)"
read
-p
""
-n
1
-r
echo
if
[[
!
$REPLY
=
~ ^[Yy]
$
]]
;
then
echo
"Deployment is cancelled!"
;
exit
0
;
fi
echo_bold_green
"Check if
$SERVER
is available"
if
ping
-c1
-w3
$SERVER
>
/dev/null 2>&1
then
echo
OK
;
else
echo_bold_red
"ping on
$SERVER
did not respond, check VPN or host name or IP"
;
exit
1
;
fi
echo_bold_green
"Maven version..."
mvn
--version
echo_bold_green
"Packaging..."
mvn clean package
echo_bold_green
"Deployment to
$SERVER
..."
(
cd
www-server
;
mvn cargo:redeploy
-Premote
-Dcargo
.server.settings
=
$SERVER
)
echo_bold_green
"Deployment done."
Loading