Skip to content

Commit

Permalink
get version from readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Julio Gutierrez committed Mar 8, 2019
1 parent ffe3b53 commit 2e67de6
Showing 1 changed file with 9 additions and 12 deletions.
21 changes: 9 additions & 12 deletions hooks/_env
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
#!/bin/bash
if [[ ! -f "/tmp/${SOURCE_COMMIT}" ]]; then
ver=`TZ=UTC date -u +"%Y.%m.%d"`
if [[ "${GIT_BRANCH}" != "master" ]]; then
ver+="-${GIT_BRANCH}"
fi
echo ${ver} > "/tmp/${SOURCE_COMMIT}"
export PATH=".:$PATH"

export VERSION=`cat README.md | grep -i "# Versions" -A 1 | tail -n 1 | sed 's/^[* ]*//;s/[* ]*$//'`
if [[ "${GIT_BRANCH}" != "master" ]]; then
export VERSION="${VERSION}-${GIT_BRANCH}"
fi

export X86="i386 amd64"
export ARM="armv7hf aarch64" # armv5e armv6 not available in balenalib

manifestArch() {
local options
case $1 in
Expand All @@ -24,9 +26,4 @@ manifestArch() {
options="arm64 --variant v8" ;;
esac
echo ${options}
}

export VERSION=`cat "/tmp/${SOURCE_COMMIT}"`
export X86="i386 amd64"
export ARM="armv7hf aarch64" # armv5e armv6 not available in balenalib
export PATH=".:$PATH"
}

0 comments on commit 2e67de6

Please sign in to comment.