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

Clean up habitat script #671

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions scripts/hab-wrap-and-push.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

set -e

#BLDR_HAB_TOKEN='_Qk9YLTEKYmxkci0yMDE3M...'
Expand All @@ -10,7 +9,7 @@ apk add curl
org="biome-sh";repo="biome"
ver=$(curl -s https://api.github.com/repos/$org/$repo/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3)}')
dl="https://github.com/$org/$repo/releases/download/$ver/bio-${ver#"v"}-x86_64-linux.tar.gz"
echo "[info] getting bio from: $dl" && curl -L -o bio.gz $dl && tar -xf bio.gz
echo "[info] getting bio from: $dl" && curl -L -o bio.gz $dl && tar -xf bio.gz
cp ./bio /usr/bin/bio && bio --version

export HAB_ORIGIN=mozillareality
Expand All @@ -20,7 +19,6 @@ mkdir -p ./hab/cache/keys/
echo $BLDR_RET_PUB_B64 | base64 -d > /hab/cache/keys/mozillareality-20190117233449.pub
echo $BLDR_RET_PUB_B64 | base64 -d > ./hab/cache/keys/mozillareality-20190117233449.pub
echo $BLDR_HAB_PVT_B64 | base64 -d > /hab/cache/keys/mozillareality-20190117233449.sig.key
echo $BLDR_HAB_PVT_B64 | base64 -d > /hab/cache/keys/mozillareality-20190117233449.sig.key

echo "### build hab pkg"
export HAB_AUTH_TOKEN=$BLDR_HAB_TOKEN
Expand Down Expand Up @@ -58,7 +56,7 @@ do_verify() {
do_prepare() {
export LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8
export MIX_ENV=prod
export RELEASE_VERSION="1.0.$(echo $pkg_prefix | cut -d '/' -f 7)"
export RELEASE_VERSION="1.0.$(echo $pkg_prefix | cut -d '/' -f 7)"

# Rebar3 will hate us otherwise because it looks for
# /usr/bin/env when it does some of its compiling
Expand All @@ -70,13 +68,9 @@ do_build() {
mix local.hex --force
mix local.rebar --force
mix deps.get --only prod
mix deps.clean mime --build
rm -rf _build
mix compile
MIX_ENV=prod mix distillery.release
}
do_install() {
rm -rf _build/prod/rel/ret/releases
MIX_ENV=prod mix distillery.release
# TODO 1.9 releases chmod 0655 _build/prod/rel/ret/bin/*
cp -a _build/prod/rel/ret/* ${pkg_prefix}

Expand Down