Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Greenlight
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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Arbeitsgruppe Hardwarenahe IT-Systeme
Greenlight
Commits
f5c33e93
Unverified
Commit
f5c33e93
authored
Jun 21, 2019
by
Jesus Federico
Committed by
GitHub
Jun 21, 2019
Browse files
Options
Downloads
Patches
Plain Diff
GRN2-159: Changed the inception of the version tag (#573)
parent
790a0365
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.travis.yml
+1
-1
1 addition, 1 deletion
.travis.yml
Dockerfile
+2
-0
2 additions, 0 deletions
Dockerfile
config/initializers/version.rb
+1
-1
1 addition, 1 deletion
config/initializers/version.rb
scripts/image_build.sh
+12
-12
12 additions, 12 deletions
scripts/image_build.sh
with
16 additions
and
14 deletions
.travis.yml
+
1
−
1
View file @
f5c33e93
...
...
@@ -20,7 +20,7 @@ jobs:
-
stage
:
build
name
:
build docker image
script
:
bash scripts/image_build.sh $TRAVIS_REPO_SLUG
$TRAVIS_BRANCH $TRAVIS_COMMIT
script
:
bash scripts/image_build.sh $TRAVIS_REPO_SLUG
if
:
env(CD_BUILD_IGNORE) IS NOT present AND type NOT IN (pull_request) AND env(CD_DOCKER_USERNAME) IS present AND env(CD_DOCKER_PASSWORD) IS present
notifications
:
...
...
This diff is collapsed.
Click to expand it.
Dockerfile
+
2
−
0
View file @
f5c33e93
...
...
@@ -11,6 +11,8 @@ RUN mkdir -p $RAILS_ROOT
WORKDIR
$RAILS_ROOT
# Set environment variables.
ARG
version_code
ENV
VERSION_CODE=$version_code
ENV
RAILS_ENV production
# Adding project files.
...
...
This diff is collapsed.
Click to expand it.
config/initializers/version.rb
+
1
−
1
View file @
f5c33e93
...
...
@@ -2,6 +2,6 @@
module
Greenlight
class
Application
VERSION
=
"2"
VERSION
=
ENV
[
"VERSION_CODE"
]
||
"2"
end
end
This diff is collapsed.
Click to expand it.
scripts/image_build.sh
+
12
−
12
View file @
f5c33e93
...
...
@@ -23,19 +23,17 @@
# as part of the development process.
#
echo
"v2019022601"
display_usage
()
{
echo
"This script should be used as part of a CI strategy."
echo
-e
"Usage:
\n
build_image.sh [ARGUMENTS]"
echo
-e
"
\n
Mandatory arguments
\n
"
echo
-e
" repo_slug The git repository (e.g. bigbluebutton/greenlight)"
echo
-e
"
\n
Optional arguments
\n
"
echo
-e
" branch | tag The branch (e.g. master | release-2.0.5)"
echo
-e
" commit_sha The sha for the current commit (e.g. 750615dd479c23c8873502d45158b10812ea3274)"
}
# if less than two arguments supplied, display usage
if
[
$#
-le
1
]
;
then
if
[
$#
-le
0
]
;
then
display_usage
exit
1
fi
...
...
@@ -48,13 +46,12 @@ fi
export
CD_REF_SLUG
=
$1
export
CD_REF_NAME
=
$2
export
CD_COMMIT_SHA
=
$3
if
[
-z
$CD_DOCKER_REPO
]
;
then
export
CD_DOCKER_REPO
=
$CD_REF_SLUG
if
[
-z
$CD_REF_NAME
]
;
then
export
CD_REF_NAME
=
$(
git branch |
grep
\*
|
cut
-d
' '
-f2
)
fi
if
[
"
$CD_REF_NAME
"
!=
"master"
]
&&
[[
"
$CD_REF_NAME
"
!=
*
"release"
*
]]
&&
(
[
-z
"
$CD_BUILD_ALL
"
]
||
[
"
$CD_BUILD_ALL
"
!=
"true"
]
)
;
then
echo
"#### Docker image for
$CD_REF_SLUG
won't be built"
echo
"#### Docker image for
$CD_REF_SLUG
:
$CD_REF_NAME
won't be built"
exit
0
fi
...
...
@@ -62,14 +59,17 @@ fi
sed
-i
"/^group :production do/a
\ \
gem 'sqlite3', '~> 1.3.6'"
Gemfile
# Set the version tag when it is a release or the commit sha was included.
if
[[
"
$CD_REF_NAME
"
==
*
"release"
*
]]
;
then
sed
-i
"s/VERSION =.*/VERSION =
\"
${
CD_REF_NAME
:8
}
\"
/g"
config/initializers/version.rb
el
if
[
!
-z
$CD_COMMIT_SHA
]
;
then
sed
-i
"s/VERSION =.*/VERSION =
\
"
$CD_REF_NAME
(
$(
expr
substr
$
CD_COMMIT_SHA
1
8
)
)
\"
/g"
config/initializers/version.rb
export
CD_VERSION_CODE
=
${
CD_REF_NAME
:8
}
el
se
export
CD_VERSION_CODE
=
"
$CD_REF_NAME
(
$(
expr
substr
$
(
git rev-parse HEAD
)
1
7
)
)
"
fi
# Build the image
if
[
-z
$CD_DOCKER_REPO
]
;
then
export
CD_DOCKER_REPO
=
$CD_REF_SLUG
fi
echo
"#### Docker image
$CD_DOCKER_REPO
:
$CD_REF_NAME
is being built"
docker build
-t
$CD_DOCKER_REPO
:
$CD_REF_NAME
.
docker build
--build-arg
version_code
=
${
CD_VERSION_CODE
}
-t
$CD_DOCKER_REPO
:
$CD_REF_NAME
.
if
[
-z
"
$CD_DOCKER_USERNAME
"
]
||
[
-z
"
$CD_DOCKER_PASSWORD
"
]
;
then
echo
"#### Docker image for
$CD_DOCKER_REPO
can't be published because CD_DOCKER_USERNAME or CD_DOCKER_PASSWORD are missing (Ignore this warning if running outside a CD/CI environment)"
...
...
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