-
Notifications
You must be signed in to change notification settings - Fork 1
/
release
executable file
·34 lines (25 loc) · 1.11 KB
/
release
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
#!/bin/bash
start=$(date +%s)
APP_NAME="$(grep 'app:' mix.exs | sed -e 's/\[//g' -e 's/ //g' -e 's/app://' -e 's/[:,]//g')"
APP_VSN="$(grep 'version:' mix.exs | cut -d '"' -f2)"
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
printf "Building dockerfile for ${APP_NAME}, app: ${APP_NAME}, vsn: ${APP_VSN} \n"
docker build . --build-arg APP_NAME=$APP_NAME \
--build-arg APP_VSN=$APP_VSN \
-t r.cfcr.io/praveenperera/avencera/$APP_NAME:$BRANCH
printf "Docker build complete \n\n"
docker push r.cfcr.io/praveenperera/avencera/$APP_NAME:$BRANCH
printf "Docker push complete \n\n"
end=$(date +%s)
SECONDS=$((end-start))
echo "Done in: $(($SECONDS / 3600))hrs $((($SECONDS / 60) % 60))min $(($SECONDS % 60))sec"
if [ -x "$(command -v say)" ]; then
say "Done"
fi
if [ -x "$(command -v terminal-notifier)" ]; then
terminal-notifier -title "COVID" \
-subtitle $BRANCH \
-message "finished building docker image" \
-sound default \
-appIcon https://www.gravatar.com/avatar/7cef14b7eebf24eccf42f9d2132406d3
fi