Skip to content

Commit

Permalink
Download and package official war instead of build it
Browse files Browse the repository at this point in the history
  • Loading branch information
vjrj committed Feb 12, 2024
1 parent e6e0066 commit 06935d2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 16 deletions.
2 changes: 1 addition & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Priority: optional
Maintainer: GBIF Development Team <helpdesk@gbif.org>
Uploaders: GBIF Development Team <helpdesk@gbif.org>
Build-Depends:
debhelper (>= 11), maven, git, openjdk-8-jdk
debhelper (>= 11), maven, git, curl
Standards-Version: 4.2.1
Homepage: https://github.com/gbif/ipt
Vcs-Browser: https://github.com/gbif/ipt
Expand Down
19 changes: 4 additions & 15 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,23 @@

# $(CURDIR) is the repository directory

M2_REPO = $(CURDIR)/debian/maven-repo-local
CURVERSION = $(shell grep -oPm2 "(?<=<version>)[^<]+" "pom.xml" | tail -1)
BUILDDATE = $(shell date -u +%Y%m%d%H%M%S)
# Previously:
# CURVERSION = $(shell mvn -Dmaven.repo.local=$(M2_REPO) -q -Dexec.executable=echo -Dexec.args='$${project.version}' --non-recursive exec:exec)-r$(shell git rev-parse HEAD | cut -c1-7)
# but we don't have the git revision in a debian build from sources without .git directory

%:
dh $@

override_dh_auto_build:
ifeq ($(filter nobuildjar,$(DEB_BUILD_PROFILES)),)
# This allows to skip the maven jar build (for instance, if its builded by another jenkins job)
# for instance with debuild -us -uc -b --build-profiles=nobuildjar
mvn -Dmaven.repo.local=$(M2_REPO) -P release install -DskipTests -Dmaven.buildNumber.revisionOnScmFailure=$(BUILDDATE)
endif


override_dh_auto_install:
# install don't allow to rename files (like wars), so we copy here the file we want to install with the package
cp $(CURDIR)/target/ipt-$(CURVERSION)-*.war $(CURDIR)/target/ipt.war
dh_auto_build
mkdir -p $(CURDIR)/target
curl -o $(CURDIR)/target/ipt.war https://repository.gbif.org/content/groups/gbif/org/gbif/ipt/$(CURVERSION)/ipt-$(CURVERSION).war

override_dh_fixperms:
dh_fixperms
# If we need to set some special perms to a file
# chmod 4755 debian/foo/opt/ipt/foo.jar
# Also we use postinstall for this


#override_dh_install:
# dh_install # calls default *.install and *.dirs installation
# man install
Expand Down

0 comments on commit 06935d2

Please sign in to comment.