-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlaunch
More file actions
executable file
·43 lines (33 loc) · 936 Bytes
/
launch
File metadata and controls
executable file
·43 lines (33 loc) · 936 Bytes
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
#!/bin/bash
# close stderr
exec 2>&-
export RUN_ID=$(hexdump -n 3 -v -e '3/1 "%02X" "\n"' /dev/random)
export BUILD_ID=$(git diff-index --quiet HEAD -- && git rev-parse --short HEAD)
if [[ -z $BUILD_ID ]]; then
export BUILD_ID="black-$(date +%d%b)"
fi
# repoen stderr
exec 2>&0
mkdir -p ./runtime
go build -o runtime/palettepal src/palettepal.go
pushd ansible >/dev/null
ansible-playbook ./playbook.yml \
--inventory inventory.yml \
--extra-vars " \
ansible_ssh_user=root \
palettepal_run_id=$RUN_ID \
palettepal_build_id=$BUILD_ID \
"
popd >/dev/null
rm -rf ./runtime
echo
echo
echo " build_id: $BUILD_ID"
echo
echo " run_id: $RUN_ID"
echo
echo
# https://stackoverflow.com/questions/3878624/how-do-i-programmatically-determine-if-there-are-uncommitted-changes
# git diff-index --quiet HEAD --
# https://stackoverflow.com/questions/31448445/git-log-show-one-commit-id-only
# git rev-parse --short HEAD