Skip to content

Commit

Permalink
3.4 - backport version and deb & rpm package
Browse files Browse the repository at this point in the history
  • Loading branch information
mborne committed Jul 23, 2019
1 parent ecab210 commit 41bc1cf
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Makefile
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


14 changes: 14 additions & 0 deletions build-deb.sh
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
14 changes: 14 additions & 0 deletions build-rpm.sh
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
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 {

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ fr.ign.validator.command.MetadataToJsonCommand
fr.ign.validator.command.UnicodeTableCommand
fr.ign.validator.command.ProjectionListCommand
fr.ign.validator.command.ReadUrlCommand
fr.ign.validator.command.VersionCommand

0 comments on commit 41bc1cf

Please sign in to comment.