-
Notifications
You must be signed in to change notification settings - Fork 1
/
update.sh
executable file
·91 lines (76 loc) · 2.03 KB
/
update.sh
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/bin/bash
#
# This tool diffs a few files to detect changes in the upstream images and scripts
#
REPO_PATH="https://github.com/immich-app/immich.git"
TMPDIR="$(mktemp -d)"
set -eo pipefail
if [ -d "$TMPDIR" ]; then
trap "rm -rf $TMPDIR; echo \"$TMPDIR removed\"" EXIT
fi
vdiff() {
if [ -z $GITHUB_ACTIONS ]; then
COLOR=always
else
COLOR=never
fi
echo '```diff'
git diff --color=$COLOR -w $OLD_RELEASE_TAG $NEW_RELEASE_TAG -- $1
echo '```'
}
git clone $REPO_PATH $TMPDIR
if [ -e $1 ]; then
OLD_RELEASE_TAG="$(grep -A4 ' server:' snap/snapcraft.yaml | awk '/source-tag/{ print $2 }')"
echo "Old release selected as: $OLD_RELEASE_TAG"
else
OLD_RELEASE_TAG="$1"
fi
cd $TMPDIR
if [ -z $2 ]; then
NEW_RELEASE_TAG="$(git tag --sort=committerdate | tail -1)"
echo "New release selected as: $NEW_RELEASE_TAG"
else
NEW_RELEASE_TAG="$2"
fi
# Check out the new release
git checkout $NEW_RELEASE_TAG
CHECK_FILES="
server/src/migrations
server/Dockerfile
server/start.sh
web/README.md
web/Dockerfile
web/src/lib/components/shared-components/version-announcement-box.svelte
cli/README.md
machine-learning/README.md
machine-learning/Dockerfile
machine-learning/start.sh
machine-learning/gunicorn_conf.py
docker/example.env
docker/docker-compose.yml
docs/docs/install/environment-variables.md
docs/docs/features/command-line-interface.md
"
for F in $CHECK_FILES; do
if [ ! -e "$F" ]; then
echo "Error, $F do not exists"
else
vdiff "$F"
fi
done | less -R
cd -
if grep -q $OLD_RELEASE_TAG snap/snapcraft.yaml; then
echo
echo "Found the string $OLD_RELEASE_TAG in snapcraft.yaml"
echo
fi
if ! grep -q $NEW_RELEASE_TAG snap/snapcraft.yaml; then
echo
echo "The string $NEW_RELEASE_TAG was NOT found in snapcraft.yaml"
echo
fi
if ! grep -q $NEW_RELEASE_TAG parts/machine-learning/Makefile; then
echo
echo "The string $NEW_RELEASE_TAG was NOT found in parts/machine-learning/Makefile"
echo
fi