Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source service proxy settings from the current environment, check for… #3

Merged
merged 1 commit into from
Feb 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 13 additions & 0 deletions scripts/hab-sup.service.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
mkdir -p /etc/systemd/system

environment_proxy=""
if [ ! -z "$HTTP_PROXY" ]; then
environment_proxy="\"HTTP_PROXY=${HTTP_PROXY}\" "
fi
if [ ! -z "$HTTPS_PROXY" ]; then
environment_proxy="\"HTTPS_PROXY=${HTTPS_PROXY}\" "
fi
if [ ! -z "${environment_proxy}" ]; then
environment_proxy="Environment=${environment_proxy}"
fi

cat <<EOT > /etc/systemd/system/hab-sup.service
[Unit]
Description=Habitat Supervisor

[Service]
ExecStartPre=/bin/bash -c "/bin/systemctl set-environment SSL_CERT_FILE=$(hab pkg path core/cacerts)/ssl/cert.pem"
ExecStart=/bin/hab run
${environment_proxy}

[Install]
WantedBy=default.target
Expand Down
1 change: 1 addition & 0 deletions scripts/install-hab.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
type curl >/dev/null 2>&1 || { echo >&2 "curl is required for installation of habitat, but was not found. Exiting."; exit 1; }
curl https://raw.githubusercontent.com/habitat-sh/habitat/master/components/hab/install.sh | bash
hab pkg install core/cacerts