Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Check DNF Automatic
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
Service Desk
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
Show more breadcrumbs
Tier 2
monitoring-plugins
Check DNF Automatic
Commits
724286f3
Commit
724286f3
authored
4 months ago
by
Meisam Farzalipour Tabriz
Browse files
Options
Downloads
Patches
Plain Diff
use make for building rpm packages
parent
342b8eda
No related branches found
No related tags found
No related merge requests found
Pipeline
#240844
passed
4 months ago
Stage: validate
Stage: test
Stage: build
Stage: install
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+20
-0
20 additions, 0 deletions
Makefile
README.md
+4
-9
4 additions, 9 deletions
README.md
ci/builds.gitlab-ci.yml
+4
-10
4 additions, 10 deletions
ci/builds.gitlab-ci.yml
with
28 additions
and
19 deletions
Makefile
0 → 100644
+
20
−
0
View file @
724286f3
GIT_DESC
:=
$(
shell git describe
)
VERSION
:=
$(
subst -,.,
$(
GIT_DESC
))
DIR
:=
$(
shell
pwd
)
STASH_REF
=
$(
shell git stash create
)
.PHONY
:
release-rpm dev-rpm clean
release-rpm
:
spectool
--get-files
check_dnf_automatic.spec
rpmbuild
-bb
check_dnf_automatic.spec
--define
"_topdir
$(
DIR
)
/rpmbuild"
--define
"_sourcedir
$(
DIR
)
"
dev-rpm
:
@
sed
-i
's/^Version:.*/Version:'
"
$(
VERSION
)
"
'/g'
check_dnf_automatic.spec
@
sed
-i
's/^_version=.*/_version='
"
$(
VERSION
)
"
'/g'
script/check_dnf_automatic
git archive
--format
=
tar.gz
-o
"
$(
DIR
)
/check_dnf_automatic-
$(
VERSION
)
.tar.gz"
--prefix
=
"check_dnf_automatic-
$(
VERSION
)
/"
"
$(
STASH_REF
)
"
rpmbuild
-bb
check_dnf_automatic.spec
--define
"_topdir
$(
DIR
)
/rpmbuild"
--define
"_sourcedir
$(
DIR
)
"
clean
:
rm
-f
"
$(
DIR
)
/check_dnf_automatic-
$(
VERSION
)
.tar.gz"
rm
-fr
"
$(
DIR
)
/rpmbuild"
This diff is collapsed.
Click to expand it.
README.md
+
4
−
9
View file @
724286f3
...
...
@@ -52,23 +52,18 @@ An Icinga plugin for monitoring the number of pending dnf-automatic security upd
### Development version
Extract the package version from git. Set version in the spec file and the script. Create the source archive and build the RPM package.
Extract
s
the package version from git. Set
s
version in the spec file and the script. Create
s
the source archive and build
s
the RPM package.
```
bash
_git_desc
=
$(
git describe
)
&&
_version
=
${
_git_desc
//-/.
}
&&
echo
"
$_version
"
sed
-i
's/^Version:.*/Version:'
"
${
_version
}
"
'/g'
check_dnf_automatic.spec
sed
-i
's/^_version=.*/_version='
"
${
_version
}
"
'/g'
script/check_dnf_automatic
git archive
--format
=
tar.gz
-o
"
$(
pwd
)
/check_dnf_automatic-
${
_version
}
.tar.gz"
--prefix
=
"check_dnf_automatic-
${
_version
}
/"
HEAD
rpmbuild
-bb
check_dnf_automatic.spec
--define
"_topdir
$(
pwd
)
/rpmbuild"
--define
"_sourcedir
$(
pwd
)
"
make dev-rpm
```
### Latest release
Fetch the latest release and build the RPM package.
Fetch
es
the latest release and build
s
the RPM package.
```
bash
spectool
--get-files
check_dnf_automatic.spec
rpmbuild
-bb
check_dnf_automatic.spec
--define
"_topdir
$(
pwd
)
/rpmbuild"
--define
"_sourcedir
$(
pwd
)
"
make release-rpm
```
## Releasing a new version
...
...
This diff is collapsed.
Click to expand it.
ci/builds.gitlab-ci.yml
+
4
−
10
View file @
724286f3
.build:check_dnf_automatic:release
:
stage
:
build
before_script
:
-
dnf install -y rpmdevtools rpm-build git
-
dnf install -y rpmdevtools rpm-build git
make
script
:
-
spectool --get-files check_dnf_automatic.spec
-
rpmbuild -bb check_dnf_automatic.spec --define "_topdir $(pwd)/rpmbuild" --define "_sourcedir $(pwd)"
-
make release-rpm || make -d release-rpm
-
mv rpmbuild/RPMS ./
artifacts
:
paths
:
...
...
@@ -13,14 +12,9 @@
.build:check_dnf_automatic:development
:
stage
:
build
before_script
:
-
dnf install -y rpmdevtools rpm-build git
-
dnf install -y rpmdevtools rpm-build git
make
script
:
-
export _git_desc=$(git describe) && export _version=${_git_desc//-/.} && echo "$_version"
-
sed -i 's/^Version:.*/Version:'" ${_version}"'/g' check_dnf_automatic.spec
-
sed -i 's/^_version=.*/_version='"${_version}"'/g' script/check_dnf_automatic
-
export _stash_ref=$(git stash create)
-
git archive --format=tar.gz -o "$(pwd)/check_dnf_automatic-${_version}.tar.gz" --prefix="check_dnf_automatic-${_version}/" "$_stash_ref"
-
rpmbuild -bb check_dnf_automatic.spec --define "_topdir $(pwd)/rpmbuild" --define "_sourcedir $(pwd)"
-
make dev-rpm || make -d dev-rpm
-
mv rpmbuild/RPMS ./
artifacts
:
paths
:
...
...
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