Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gendl
gendl
Commits
2a3305fc
Commit
2a3305fc
authored
Oct 25, 2021
by
Dave Cooper
Browse files
Merge branch 'hotfix/branch-named-containers'
parents
39885076
bd875e77
Pipeline
#5205
canceled with stages
in 15 minutes and 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
docker/build
View file @
2a3305fc
...
...
@@ -10,6 +10,22 @@
#
set
-
e
echo
"CI_BUILD_REF_NAME is: ${CI_BUILD_REF_NAME}"
if
[
-
z
"${CI_BUILD_REF_NAME}"
];
then
branch
=
"unspecified"
else
branch
=
$
{
CI_BUILD_REF_NAME
//
\
//--
}
fi
echo
"branch is: ${branch}"
cd
`dirname $0`
/
..
/
..
/
echo
"Present Working Directory: "
`pwd`
...
...
@@ -45,9 +61,9 @@ rm ${dist_name}.zip
mv
$
{
dist_name
}
gendl
-
build
/
docker
build
-
t
dcooper8
/
gendl
:
latest
-
f
.
/
gendl
/
docker
/
Dockerfile
.
docker
build
-
t
dcooper8
/
gendl
:
$
{
branch
}
-
f
.
/
gendl
/
docker
/
Dockerfile
.
rm
-
rf
gendl
-
build
/
docker
push
dcooper8
/
gendl
:
latest
docker
push
dcooper8
/
gendl
:
$
{
branch
}
docker/run
View file @
2a3305fc
...
...
@@ -17,15 +17,29 @@
# Note gendl source home is being mounted from: ${gendl} to /home/${gendl_user}/gendl/ in the container.
#
# FLAG orig
#CID=$(docker run -d -it --rm -p 9000:9000 -p 4200:4200 -h gendl \
# --name gendl --mount type=bind,src=${gendl},dst=/home/${gendl_user}/gendl/ dcooper8/gendl:latest)
# CID=$(docker run -d -it --rm -p 9000:9000 -p 4200:4200 -h gendl --name gendl dcooper8/gendl:latest) # works.
CURRDIR
=
`
dirname
$0
`
GENDL_SRC
=
"
`
cd
"
${
CURRDIR
}
/.."
;
pwd
`
"
echo
"GENDL_SRC is
$GENDL_SRC
"
pushd
.
cd
$GENDL_SRC
branch
=
$(
git rev-parse
--abbrev-ref
HEAD 2>/dev/null
)
ret_code
=
$?
branch
=
${
branch
//\//--
}
if
[
"
$ret_code
"
-ne
"0"
]
;
then
branch
=
"unspecified"
fi
# CID=$(docker run -d -it --rm dcooper8/gendl:latest) # starts but hangs (bad). No port 4200.
CID
=
$(
docker run
-id
--rm
-h
gendl
--name
gendl
-p
9000:9000
-p
4200:4200 dcooper8/gendl:
latest
)
# works.
CID
=
$(
docker run
-id
--rm
-h
gendl
--name
gendl
-p
9000:9000
-p
4200:4200 dcooper8/gendl:
${
branch
}
)
...
...
@@ -40,3 +54,4 @@ else
echo
${
CID
}
fi
popd
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment