-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.4 - backport version and deb & rpm package
- Loading branch information
Showing
5 changed files
with
92 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
NAME=ign-validator | ||
|
||
all: build | ||
|
||
.PHONY: package | ||
package: deb rpm | ||
|
||
.PHONY: deb | ||
deb: build | ||
bash build-deb.sh | ||
|
||
.PHONY: rpm | ||
rpm: build | ||
bash build-rpm.sh | ||
|
||
.PHONY: test | ||
test: | ||
mvn clean package | ||
|
||
.PHONY: build | ||
build: | ||
mvn clean package -Dmaven.test.skip=true | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
hash fpm 2>/dev/null || { echo >&2 "ERROR : fpm is required to build deb package (see https://fpm.readthedocs.io/en/latest/installing.html)"; exit 1; } | ||
|
||
cd validator-cli/target | ||
|
||
VERSION=$(java -jar validator-cli.jar version) | ||
echo "VERSION=$VERSION" | ||
|
||
rm -rf *.deb | ||
fpm -s dir -t deb -n ign-validator -v $VERSION \ | ||
--license "Cecill-B" \ | ||
--description "IGNF/validator - validate and load data according to models" \ | ||
--prefix /opt/ign-validator validator-cli.jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
hash fpm 2>/dev/null || { echo >&2 "ERROR : fpm is required to build rpm package (see https://fpm.readthedocs.io/en/latest/installing.html)"; exit 1; } | ||
|
||
cd validator-cli/target | ||
|
||
VERSION=$(java -jar validator-cli.jar version) | ||
echo "VERSION=$VERSION" | ||
|
||
rm -rf *.rpm | ||
fpm -s dir -t rpm -n ign-validator -v $VERSION \ | ||
--license "Cecill-B" \ | ||
--description "IGNF/validator - validate and load data according to models" \ | ||
--prefix /opt/ign-validator validator-cli.jar |
39 changes: 39 additions & 0 deletions
39
validator-core/src/main/java/fr/ign/validator/command/VersionCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package fr.ign.validator.command; | ||
|
||
import org.apache.commons.cli.CommandLine; | ||
import org.apache.commons.cli.Options; | ||
import org.apache.commons.cli.ParseException; | ||
|
||
import fr.ign.validator.Version; | ||
|
||
/** | ||
* | ||
* Display validator version | ||
* | ||
* @author MBorne | ||
*/ | ||
public class VersionCommand extends AbstractCommand { | ||
|
||
public static final String NAME = "version"; | ||
|
||
@Override | ||
public String getName() { | ||
return NAME; | ||
} | ||
|
||
@Override | ||
public void execute() throws Exception { | ||
System.out.println(Version.VERSION); | ||
} | ||
|
||
@Override | ||
protected void buildCustomOptions(Options options) { | ||
|
||
} | ||
|
||
@Override | ||
protected void parseCustomOptions(CommandLine commandLine) throws ParseException { | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters