Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
portal-backend
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
HBP Medical Informatics Platform
portal-backend
Commits
c6e2f1d5
Commit
c6e2f1d5
authored
7 years ago
by
Mirco
Browse files
Options
Downloads
Patches
Plain Diff
update publish and build scripts
parent
da13deaa
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.bumpversion.cfg
+0
-1
0 additions, 1 deletion
.bumpversion.cfg
build.sh
+5
-0
5 additions, 0 deletions
build.sh
publish.sh
+14
-6
14 additions, 6 deletions
publish.sh
with
19 additions
and
7 deletions
.bumpversion.cfg
+
0
−
1
View file @
c6e2f1d5
...
...
@@ -11,4 +11,3 @@ search = <version>{current_version}</version><!-- BUMP_VERSION -->
replace
= <version>{new_version}</version><!-- BUMP_VERSION -->
[bumpversion:file:hbp.yml]
This diff is collapsed.
Click to expand it.
build.sh
+
5
−
0
View file @
c6e2f1d5
...
...
@@ -18,6 +18,11 @@ get_script_dir () {
cd
"
$(
get_script_dir
)
"
if
pgrep
-lf
sshuttle
>
/dev/null
;
then
echo
"sshuttle detected. Please close this program as it messes with networking and prevents builds inside Docker to work"
exit
1
fi
if
[[
$NO_SUDO
||
-n
"
$CIRCLECI
"
]]
;
then
CAPTAIN
=
"captain"
elif
groups
$USER
|
grep
&>/dev/null
'\bdocker\b'
;
then
...
...
This diff is collapsed.
Click to expand it.
publish.sh
+
14
−
6
View file @
c6e2f1d5
#!/usr/bin/env bash
set
-e
set
-o
pipefail
# trace ERR through pipes
set
-o
errtrace
# trace ERR through 'time command' and other functions
set
-o
errexit
## set -e : exit the script if any statement returns a non-true return value
get_script_dir
()
{
SOURCE
=
"
${
BASH_SOURCE
[0]
}
"
...
...
@@ -20,15 +23,21 @@ if pgrep -lf sshuttle > /dev/null ; then
exit
1
fi
if
groups
$USER
|
grep
&>/dev/null
'\bdocker\b'
;
then
if
[
$NO_SUDO
]
;
then
CAPTAIN
=
"captain"
DOCKER
=
"docker"
elif
groups
$USER
|
grep
&>/dev/null
'\bdocker\b'
;
then
CAPTAIN
=
"captain"
DOCKER
=
"docker"
else
CAPTAIN
=
"sudo captain"
DOCKER
=
"sudo docker"
fi
# Build
echo
"Build the project..."
./build.sh
./test.sh
echo
"[ok] Done"
count
=
$(
git status
--porcelain
|
wc
-l
)
...
...
@@ -59,8 +68,8 @@ select_part() {
git pull
--tags
# Look for a version tag in Git. If not found, ask the user to provide one
[
$(
git tag
--points-at
HEAD |
wc
-l
)
==
1
]
||
(
latest_version
=
$(
(
bumpversion
--dry-run
--list
patch |
grep
current_version |
sed
-r
s,
"^.*="
,,
)
||
echo
'0.0.1'
)
[
$(
git tag
--points-at
HEAD |
grep
portal-backend |
wc
-l
)
==
1
]
||
(
latest_version
=
$(
bumpversion
--dry-run
--list
patch |
grep
current_version |
sed
-r
s,
"^.*="
,,
||
echo
'0.0.1'
)
echo
echo
"Current commit has not been tagged with a version. Latest known version is
$latest_version
."
echo
...
...
@@ -85,14 +94,13 @@ updated_version=$(bumpversion --dry-run --list patch | grep current_version | se
# Build again to update the version
echo
"Build the project for distribution..."
./build.sh
echo
"[ok] Done"
git push
git push
--tags
# Push on Docker Hub
# WARNING: Requires captain 1.1.0 to push user tags
BUILD_DATE
=
$(
date
-
-iso-8601
=
seconds
)
\
BUILD_DATE
=
$(
date
-
I
seconds
)
\
VCS_REF
=
$updated_version
\
VERSION
=
$updated_version
\
WORKSPACE
=
$WORKSPACE
\
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment