-
Notifications
You must be signed in to change notification settings - Fork 209
/
Copy pathplan.sh
85 lines (72 loc) · 2.06 KB
/
plan.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
pkg_name=oc_bifrost
pkg_origin=chef
pkg_license=('Apache-2.0')
pkg_maintainer="The Chef Server Maintainers <support@chef.io>"
pkg_deps=(
core/erlang26
core/cacerts
core/coreutils
core/curl
core/gcc-libs
core/sqitch
core/postgresql17-client
)
pkg_build_deps=(core/make core/git core/gcc)
pkg_bin_dirs=(bin)
pkg_description="Erlang implementation of the Chef Server's Auth system."
pkg_upstream_url="https://github.com/chef/chef-server"
pkg_exports=(
[port]="port"
)
pkg_exposes=(port)
pkg_binds_optional=(
[database]="port"
[chef-server-ctl]="secrets"
)
pkg_version() {
cat "$PLAN_CONTEXT/../../../VERSION"
}
do_before() {
do_default_before
if [ ! -f "$PLAN_CONTEXT/../../../VERSION" ]; then
exit_with "Cannot find VERSION file! You must run \"hab studio enter\" from the chef-server project root." 56
fi
update_pkg_version
}
do_unpack() {
# Copy everything over to the cache path so we don't write out our compiled
# deps into the working directory, but into the cache directory.
mkdir -p "$HAB_CACHE_SRC_PATH/$pkg_dirname"
cp -R "$PLAN_CONTEXT/../"* "$HAB_CACHE_SRC_PATH/$pkg_dirname"
}
do_prepare() {
# The `/usr/bin/env` path is hardcoded in jiffy, so we'll add a symlink since fix_interpreter won't work.
if [[ ! -r /usr/bin/env ]]; then
ln -sv "$(pkg_path_for coreutils)/bin/env" /usr/bin/env
_clean_env=true
fi
# Need this for enterprise_ctl to compile with an old version of rebar
build_line "Setting PATH=$PATH:$HAB_CACHE_SRC_PATH/$pkg_dirname"
export PATH=$PATH:"$HAB_CACHE_SRC_PATH/$pkg_dirname"
build_line "RELX_OUTPUT_DIR=$pkg_prefix"
export RELX_OUTPUT_DIR=$pkg_prefix
git config --global http.sslCAInfo \
"$(pkg_path_for core/cacerts)"/ssl/certs/cacert.pem
}
do_build() {
export REL_VERSION=$pkg_version
make omnibus
}
do_install() {
cp -rv "_build/default/rel/oc_bifrost/"* "${pkg_prefix}"
cp -R "$HAB_CACHE_SRC_PATH/$pkg_dirname/schema" "$pkg_prefix"
}
do_check() {
make
}
do_end() {
# Clean up the `env` link, if we set it up.
if [[ -n "$_clean_env" ]]; then
rm -fv /usr/bin/env
fi
}