Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Dockerfiles
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Picasoft
Technique
Dockerfiles
Commits
b595ac51
Verified
Commit
b595ac51
authored
5 years ago
by
Quentin Duchemin
Browse files
Options
Downloads
Patches
Plain Diff
[MISC] Add a helper production deployment script
parent
777a17f1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker_prod.sh
+51
-0
51 additions, 0 deletions
docker_prod.sh
with
51 additions
and
0 deletions
docker_prod.sh
0 → 100644
+
51
−
0
View file @
b595ac51
#!/bin/bash
set
-e
usage
()
{
echo
-e
"usage:
\t
$0
DIRECTORY, e.g.
$0
pica-mattermost"
echo
-e
"
\t
DIRECTORY : name of the directory containing docker-compose.yml
\n
"
echo
"This script is a helper to launch a service : it will create all needed volumes for the service,"
echo
"pull the specified version of the image if any, and then launch docker-compose up -d."
exit
1
}
if
[[
$#
-ne
1
]]
;
then
echo
"ERROR : wrong number of arguments"
usage
fi
if
[[
!
-d
"
$1
"
]]
;
then
echo
"ERROR : directory does not exist (
$1
)"
usage
fi
# Go to the folder of the service which will be tested
cd
"
$1
"
echo
-e
"Starting procedure for
\0
33[31m
$1
\e
[0m..."
echo
-e
"
\n
==== Pull Dockerfiles repository ===="
echo
-e
"Using branch
\0
33[31m
$(
git rev-parse
--abbrev-ref
HEAD
)
\e
[0m, is this correct ? [y/N]"
read
ans
if
[
$ans
==
"y"
]
;
then
git pull
else
echo
"Aborting."
exit
0
fi
echo
-e
"
\n
==== Pull new versions of images ===="
docker-compose pull
echo
-e
"
\n
==== Ensure named external volumes are created ===="
for
v
in
$(
docker-compose config
--volumes
)
;
do
docker volume create
"
$v
"
done
echo
-e
"
\n
==== Lauch
$1
===="
docker-compose up
-d
echo
-e
"
\n
==== Print logs (use Ctrl+C to stop) ===="
docker-compose logs
-f
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