Created
October 22, 2019 20:45
-
-
Save themightychris/b240a5eddcbb054b43d3f1febb07e2d7 to your computer and use it in GitHub Desktop.
Habitat composite plan
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
[services.postgresql] | |
pkg_ident = "core/postgresql11" | |
[services.myapp] | |
pkg_ident = "myorigin/myapp" | |
[services.myapp.binds] | |
database = "postgresql" | |
[services.nginx] | |
pkg_ident = "emergence/nginx" | |
[services.nginx.binds] | |
runtime = "myapp" |
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
composite_base_pkg_name=myapp | |
pkg_name="${composite_base_pkg_name}-composite" | |
pkg_origin=myorigin | |
pkg_maintainer="Chris Alfano <[email protected]>" | |
pkg_build_deps=( | |
jarvus/toml-merge | |
) | |
pkg_deps=( | |
"${pkg_origin}/${composite_base_pkg_name}" | |
jarvus/habitat-compose | |
core/postgresql11 | |
emergence/nginx/1.15.6/20191009041933 | |
) | |
pkg_svc_user="root" | |
pkg_svc_run="habitat-compose ${pkg_svc_config_path}/services.json" | |
pkg_version() { | |
echo "$(pkg_path_for ${pkg_origin}/${composite_base_pkg_name})" | cut -d / -f 6 | |
} | |
# implement build workflow | |
do_before() { | |
do_default_before | |
update_pkg_version | |
} | |
do_build() { | |
return 0 | |
} | |
do_install() { | |
return 0 | |
} | |
do_build_config() { | |
do_default_build_config | |
build_line "Merging habitat-compose config" | |
cp -nrv "$(pkg_path_for jarvus/habitat-compose)/config" "${pkg_prefix}/" | |
toml-merge \ | |
"$(pkg_path_for jarvus/habitat-compose)/default.toml" \ | |
"${PLAN_CONTEXT}/default.toml" \ | |
> "${pkg_prefix}/default.toml" | |
} | |
do_strip() { | |
return 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment