Instead of fetching from remote, it now only compares HEAD from local to HEAD of the current branch on remote
14 lines
292 B
Bash
Executable File
14 lines
292 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
cd $(dirname $0)
|
|
|
|
local_head=$(git rev-parse HEAD)
|
|
upstream_ref=$(git rev-parse --abbrev-ref @{u} | sed 's/\// /')
|
|
remote_head=$(git ls-remote $upstream_ref | cut -f1)
|
|
|
|
if [[ $local_head != $remote_head ]]; then
|
|
git pull
|
|
docker compose pull
|
|
docker compose up -d
|
|
fi
|