Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
deb-icingaweb2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packaging
deb-icingaweb2
Commits
7c57b45c
Commit
7c57b45c
authored
Jul 29, 2019
by
Markus Frosch
📣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get_snapshot: Set the application and modules versions for snapshots
parent
00b76a14
Pipeline
#4473
passed with stages
in 16 minutes and 52 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
15 deletions
+31
-15
get_snapshot
get_snapshot
+31
-15
No files found.
get_snapshot
View file @
7c57b45c
...
...
@@ -27,8 +27,6 @@ done
:
${
UPSTREAM_GIT_URL
:
=https
://github.com/Icinga/
$PROJECT
.git
}
:
${
UPSTREAM_GIT_BRANCH
:
=master
}
workdir
=
`
pwd
`
set
-x
if
[
-z
"
$UPSTREAM_GIT_NOREPO
"
]
;
then
...
...
@@ -57,24 +55,42 @@ if [ -z "$UPSTREAM_GIT_NOREPO" ]; then
fi
git_version
=
$(
git describe
--tags
"
${
UPSTREAM_GIT_BRANCH
}
"
)
if
[
`
echo
"
$git_version
"
|
grep
-v
-E
'(g[0-9a-f]+)$'
`
]
;
then
echo
"This is a release tagged commit and does not fit the naming scheme, it will confuse the packaging server.
It's safer to wait for the next commit. Have a nice day."
exit
1
fi
package_version
=
$(
echo
"
$git_version
"
|
sed
-e
's/^v//'
-e
's/-/+/'
-e
's/-/./g'
)
prefix
=
"
${
PROJECT
}
_
${
package_version
}
"
tarball
=
"
${
prefix
}
.orig.tar"
if
[[
"
$git_version
"
=
*
2.4.1
*
]]
||
[[
"
$git_version
"
=
*
2.4.0
*
]]
;
then
package_version
=
$(
echo
"
$git_version
"
|
sed
-e
's/^v//'
-e
's/-/+t/'
-e
's/-/./g'
)
else
package_version
=
$(
echo
"
$git_version
"
|
sed
-e
's/^v//'
-e
's/-/+/'
-e
's/-/./g'
)
fi
tarball
=
"
${
workdir
}
/
${
PROJECT
}
_
${
package_version
}
.orig.tar"
git archive
--format
=
tar
--prefix
=
"
${
prefix
}
/"
-o
"../
${
tarball
}
"
"
${
UPSTREAM_GIT_BRANCH
}
"
cd
../
# create files with the properly set versions for snapshot
rm
-rf
"
${
prefix
:?
}
/"
mkdir
-p
"
${
prefix
}
"
/library/Icinga/Application
sed
-e
"s~const VERSION.*~const VERSION = '
${
package_version
}
';~"
\
"
${
PROJECT
}
.git"
/library/Icinga/Application/Version.php
\
>
"
${
prefix
}
"
/library/Icinga/Application/Version.php
for
module
in
$(
cd
"
${
PROJECT
}
.git/modules"
;
ls
)
;
do
test
-e
"
${
PROJECT
}
.git/modules/
${
module
}
/module.info"
||
continue
mkdir
-p
"
${
prefix
}
/modules/
${
module
}
"
sed
-e
"s~^Version:.*~Version:
${
package_version
}
~"
\
"
${
PROJECT
}
.git/modules/
${
module
}
/module.info"
\
>
"
${
prefix
}
/modules/
${
module
}
/module.info"
done
git archive
--format
=
tar
--prefix
=
"
${
PROJECT
}
_
${
package_version
}
/"
-o
"
${
tarball
}
"
"
${
UPSTREAM_GIT_BRANCH
}
"
# add to tarball and remove tmpdir
tar
--append
-f
"
${
tarball
}
"
"
${
prefix
}
"
/
rm
-rf
"
${
prefix
:?
}
/"
# pack tarball
gzip
-vf9
"
${
tarball
}
"
sha256sum
"
${
tarball
}
.gz"
# store package version for build scripts
echo
-e
"
${
package_version
}
\t
$(
git rev-parse
"
${
UPSTREAM_GIT_BRANCH
}
"
)
\t
$(
basename
"
${
tarball
}
.gz"
)
\t
${
UPSTREAM_GIT_BRANCH
}
"
>
"
${
workdir
}
/
${
PROJECT
}
.version"
printf
'%s\t%s\t%s\t%s'
\
"
${
package_version
}
"
\
"
$(
git rev-parse
"
${
UPSTREAM_GIT_BRANCH
}
"
)
"
\
"
$(
basename
"
${
tarball
}
.gz"
)
"
\
"
${
UPSTREAM_GIT_BRANCH
}
"
\
>
"
${
PROJECT
}
.version"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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