Skip to content

Commit

Permalink
Move to a better and brighter build
Browse files Browse the repository at this point in the history
  • Loading branch information
djha-skin committed Jun 12, 2019
1 parent ae6e61d commit 221e810
Show file tree
Hide file tree
Showing 16 changed files with 234 additions and 222 deletions.
144 changes: 59 additions & 85 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,118 +1,100 @@
version: 2
jobs:
lein_tests:
docker:
- image: clojure:lein
version: 2
steps:
- checkout
- run:
command: |
set -ex
lein test2junit
ls target/test-results
ls target/test-results/html
lein uberjar
buildutils/generate-manifest
- store_artifacts:
path: target/test-results/xml/
destination: test-results/xml
- store_artifacts:
path: target/uberjar/
destination: uberjar/
- store_test_results:
path: target/test-results/xml/
- persist_to_workspace:
root: .
paths:
- target/uberjar/degasolv-*-standalone.jar
- target/manifest

script_tests:
docker:
- image: djhaskin987/lein-script-tester:latest
version: 2
steps:
- checkout
- run:
command: |
test/resources/scripts/test-all
package_ubuntu16:
docker:
- image: djhaskin987/graal-lein-fpm:ubuntu16
version: 2
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run: cp -af /tmp/workspace/target ./
- run:
name: "Package debian for Ubuntu 16"
command: buildutils/package deb
no_output_timeout: 30m
name: "Test and build for Ubuntu 16"
command: buildutils/build deb
no_output_timeout: 60m
- persist_to_workspace:
root: .
paths:
- target/package/*.deb
- target/exe/*
- target/uberjar/*.jar
- target/manifest
- store_artifacts:
path: target/test-results/xml/
destination: test-results_u16/xml
- store_artifacts:
path: target/exe/
destination: exe_u16/
- store_artifacts:
path: target/uberjar/
destination: uberjar_u16/
- store_artifacts:
path: target/package/
destination: package_u16/
- store_artifacts:
path: target/graal/
destination: graal_u16/
- store_test_results:
path: target/test-results/xml/

package_ubuntu18:
docker:
- image: djhaskin987/graal-lein-fpm:ubuntu18
version: 2
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run: cp -af /tmp/workspace/target ./
- run:
name: "Package debian for Ubuntu 18"
command: buildutils/package deb
no_output_timeout: 30m
- run: mv target/package target/package_u18
- run: mv target/graal target/graal_u18
name: "Test and build for Ubuntu 18"
command: buildutils/build deb
no_output_timeout: 60m
- persist_to_workspace:
root: .
paths:
- target/package_u18/*.deb
- target/package/*.deb
- target/exe/*
- target/uberjar/*.jar
- target/manifest
- store_artifacts:
path: target/package_u18/
destination: package_u18/
path: target/test-results/xml/
destination: test-results_u18/xml
- store_artifacts:
path: target/graal_u18/
destination: graal_u18/
path: target/exe/
destination: exe_u18/
- store_artifacts:
path: target/uberjar/
destination: uberjar_u18/
- store_artifacts:
path: target/package/
destination: package_u18/
- store_test_results:
path: target/test-results/xml/

package_centos7:
docker:
- image: djhaskin987/graal-lein-fpm:centos7
- image: djhaskin987/graal-lein-fpm:ubuntu18
version: 2
steps:
- attach_workspace:
at: /tmp/workspace
- checkout
- run: cp -af /tmp/workspace/target ./
- run:
name: "Package debian for CentOS 7"
command: buildutils/package rpm
no_output_timeout: 30m
- run: mv target/package target/package_c7
- run: mv target/graal target/graal_c7
name: "Test and build for CentOS 7"
command: buildutils/build rpm
no_output_timeout: 60m
- persist_to_workspace:
root: .
paths:
- target/package_c7/*.rpm
- target/package/*.rpm
- target/exe/*
- target/uberjar/*.jar
- target/manifest
- store_artifacts:
path: target/package_c7/
destination: package_c7/
path: target/test-results/xml/
destination: test-results_c7/xml
- store_artifacts:
path: target/exe/
destination: exe_c7/
- store_artifacts:
path: target/uberjar/
destination: uberjar_c7/
- store_artifacts:
path: target/graal_c7/
destination: graal_c7/
path: target/package/
destination: package_c7/
- store_test_results:
path: target/test-results/xml/

test_ubuntu16_package:
docker:
Expand Down Expand Up @@ -155,17 +137,9 @@ workflows:
version: 2
build_and_test:
jobs:
- script_tests
- lein_tests
- package_ubuntu16:
requires:
- lein_tests
- package_ubuntu18:
requires:
- lein_tests
- package_centos7:
requires:
- lein_tests
- package_ubuntu16
- package_ubuntu18
- package_centos7
- test_ubuntu16_package:
requires:
- package_ubuntu16
Expand Down
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

87 changes: 87 additions & 0 deletions buildutils/build
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
41 changes: 7 additions & 34 deletions docs/3rd-party-licenses.rst
Original file line number Diff line number Diff line change
Expand Up @@ -374,12 +374,12 @@ exception as provided by Oracle in the LICENSE file that accompanied this code."
the library, but you are not obligated to do so. If you do not wish to do
so, delete this exception statement from your version.

Clojure and its Dependencies
----------------------------
Clojure and Clojure Libraries
-----------------------------

All of Clojure, the language in which Degasolv was written, and its
dependencies essentially use the same license: The Eclipse Public License,
version 1.0 . It is presented below along with the names of the libraries used
All of Clojure, the language in which Degasolv was written, and the clojure
libraries it uses all use the same license: The Eclipse Public License,
version 1.0. It is presented below along with the names of the libraries used
in Degasolv.

Clojure
Expand All @@ -399,33 +399,14 @@ Clojure

.. _Clojure Programming Language: https://github.com/clojure/clojure/releases/tag/clojure-1.10.1

spec.alpha
++++++++++

+------------------------------+--------------------------------------+
| Software | `spec.alpha`_ |
+------------------------------+--------------------------------------+
| Author(s) | Rich Hickey and Contributors |
+------------------------------+--------------------------------------+
| License type | Eclipse Public License 1.0 |
+------------------------------+--------------------------------------+
| Version of software | 0.2.176 |
+------------------------------+--------------------------------------+
| Degasolv version introduced | 1.0.2 |
+------------------------------+--------------------------------------+

.. _spec.alpha: https://github.com/clojure/spec.alpha

Serovers
serovers
++++++++

+------------------------------+--------------------------------------+
| Software | `Serovers`_ |
| Software | `serovers`_ |
+------------------------------+--------------------------------------+
| Author(s) | Daniel Jay Haskin |
+------------------------------+--------------------------------------+
| License type | Eclipse Public License |
+------------------------------+--------------------------------------+
| Version of software | 1.6.2 |
+------------------------------+--------------------------------------+
| Degasolv version introduced | 1.8.0 |
Expand All @@ -442,8 +423,6 @@ tools.cli
+------------------------------+--------------------------------------+
| Author(s) | Rich Hickey and contributors |
+------------------------------+--------------------------------------+
| License type | Eclipse Public License 1.0 |
+------------------------------+--------------------------------------+
| Version of software | 0.3.5 |
+------------------------------+--------------------------------------+
| Degasolv version introduced | 1.0.2 |
Expand All @@ -459,8 +438,6 @@ tagged
+------------------------------+--------------------------------------+
| Author(s) | Stephen E. Miner |
+------------------------------+--------------------------------------+
| License type | Eclipse Public License |
+------------------------------+--------------------------------------+
| Version of software | 0.5.0 |
+------------------------------+--------------------------------------+
| Degasolv version introduced | 1.0.2 |
Expand All @@ -476,8 +453,6 @@ data.json
+------------------------------+--------------------------------------+
| Author(s) | Stuart Sierra |
+------------------------------+--------------------------------------+
| License type | Eclipse Public License 1.0 |
+------------------------------+--------------------------------------+
| Version of software | 0.2.6 |
+------------------------------+--------------------------------------+
| Degasolv version introduced | 1.10.0 |
Expand All @@ -495,8 +470,6 @@ core.match
| Author(s) | David Nolen, Ambrose Bonnaire- |
| | Sergeant, Rich Hickey & contributors |
+------------------------------+--------------------------------------+
| License type | Eclipse Public License 1.0 |
+------------------------------+--------------------------------------+
| Version of software | 0.3.0-alpha5 |
+------------------------------+--------------------------------------+
| Degasolv version introduced | 1.0.2 |
Expand Down
Loading

0 comments on commit 221e810

Please sign in to comment.