Skip to content

Instantly share code, notes, and snippets.

@tomrgio
Created October 16, 2018 08:49
Show Gist options
  • Save tomrgio/158b58f31cd75c92aea2a9f96379c7f1 to your computer and use it in GitHub Desktop.
Save tomrgio/158b58f31cd75c92aea2a9f96379c7f1 to your computer and use it in GitHub Desktop.
pkg_name=national-parks
pkg_origin=<YOUR ORIGIN>
pkg_version="6.3.0"
pkg_maintainer="The Habitat Maintainers <[email protected]>"
pkg_license=("Apache-2.0")
pkg_deps=(core/tomcat8 core/jre8 core/mongo-tools)
pkg_build_deps=(core/jdk8/8u131 core/maven)
pkg_svc_user="root"
pkg_binds=(
[database]="port"
)
do_prepare(){ export JAVA_HOME=$(hab pkg path core/jdk8) ; }
do_build()
{
cp -r $PLAN_CONTEXT/../ $HAB_CACHE_SRC_PATH/$pkg_dirname
cd ${HAB_CACHE_SRC_PATH}/${pkg_dirname}
mvn package
}
do_install()
{
mkdir ${PREFIX}/config
cp ${HAB_CACHE_SRC_PATH}/${pkg_dirname}/target/${pkg_name}.war ${PREFIX}/
cp $(hab pkg path core/tomcat8)/config/conf_server.xml ${PREFIX}/config/
cp -v ${HAB_CACHE_SRC_PATH}/${pkg_dirname}/data/national-parks.json ${PREFIX}/
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment