-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
234 additions
and
222 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
This file was deleted.
Oops, something went wrong.
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,87 @@ | ||
#!/bin/sh | ||
export POSIXLY_CORRECT=1 | ||
set -exou | ||
|
||
type="${1}" | ||
shift | ||
|
||
lein --version | ||
lein test2junit | ||
ls target/test-results | ||
ls target/test-results/html | ||
lein uberjar | ||
|
||
name=$(lein print :name | sed 's|"||g') | ||
version=$(lein print :version | sed 's|"||g') | ||
basic_version=$(echo "${version}" | sed -e 's|-.*$||g') | ||
branch=$(git branch | awk '/^[*] /{print $2}') | ||
builddate=$(date --utc '+%Y%m%d%H%M%S') | ||
git_desc=$(git describe --long --match '[0-9].[0-9].[0-9]') | ||
previous_version=$(echo "${git_desc}" | sed 's|-.*$||g') | ||
iteration="$(echo "${git_desc}" | sed -e 's|^[^-]*-||g' -e 's|-[^-]*$||g')" | ||
hash=$(git rev-parse HEAD) | ||
description=$(lein print :description) | ||
url=$(lein print :url) | ||
|
||
cat > target/manifest << MANIFEST | ||
name=${name} | ||
version=${version} | ||
basic_version=${basic_version} | ||
branch=${branch} | ||
builddate=${builddate} | ||
git_desc=${git_desc} | ||
description=${description} | ||
previous_version=${previous_version} | ||
iteration=${iteration} | ||
hash=${hash} | ||
url=${url} | ||
MANIFEST | ||
|
||
native-image --verbose --enable-url-protocols=http,https -H:+ReportUnsupportedElementsAtRuntime --no-fallback -jar target/uberjar/${name}-${version}-standalone.jar | ||
|
||
mkdir -p target/exe | ||
test/resources/scripts/test-all | ||
ls target/exe | ||
cp ./${name}-${version}-standalone target/exe | ||
|
||
if [ "${type}" = "rpm" ] | ||
then | ||
dep="java-headless" | ||
else | ||
dep="java-runtime" | ||
fi | ||
|
||
mkdir -p pkg/ | ||
mkdir -p pkg/usr/bin/ | ||
mkdir -p pkg/usr/lib/${name}/ | ||
mkdir -p pkg/usr/share/doc/${name}/ | ||
|
||
cat > pkg/usr/share/doc/${name}/manifest.txt << MANIFEST | ||
Name: ${name} | ||
Version: ${basic_version} | ||
Previous Version: ${previous_version} | ||
Iteration: ${iteration} | ||
Git hash: ${hash} | ||
Build date: ${builddate} | ||
MANIFEST | ||
|
||
cp ./${name}-${version}-standalone pkg/usr/bin/${name} | ||
|
||
fpm \ | ||
--verbose \ | ||
--input-type dir \ | ||
--output-type ${type} \ | ||
--name "${name}" \ | ||
--version "${basic_version}" \ | ||
--iteration "${iteration}.djh987" \ | ||
--license "Eclipse Public License" \ | ||
--architecture "all" \ | ||
--depends "${dep}" \ | ||
--maintainer "[email protected]" \ | ||
--description "${description}" \ | ||
--url "${url}" \ | ||
-C pkg \ | ||
. | ||
|
||
mkdir -p target/package | ||
mv *.${type} target/package |
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
Oops, something went wrong.