Skip to content

Commit d023aa8

Browse files
authored
make sure update script always actually updates (#344)
* make sure update script always actually updates * clarify updates in readme
1 parent c5099a7 commit d023aa8

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ LOG_LEVEL=debug
321321

322322
### Updating your PDS
323323

324-
It is recommended that you keep your PDS up to date with new versions. You can use the `pdsadmin` tool to update your PDS.
324+
It is recommended that you keep your PDS up to date with new versions. This repo sets up [watchtower](https://github.com/nicholas-fedor/watchtower), which handles automatic updates. You can also use the `pdsadmin` tool to manually update your PDS.
325325

326326
```bash
327327
sudo pdsadmin update

pdsadmin/update.sh

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,17 @@ curl \
2020
--output "${COMPOSE_TEMP_FILE}" \
2121
"${COMPOSE_URL}"
2222

23-
sed --in-place "s|/pds|${PDS_DATADIR}|g" "${PDS_DATADIR}/compose.yaml"
23+
sed --in-place "s|/pds|${PDS_DATADIR}|g" "${COMPOSE_TEMP_FILE}"
2424

25-
if cmp --quiet "${COMPOSE_FILE}" "${COMPOSE_TEMP_FILE}"; then
26-
echo "PDS is already up to date"
25+
if ! cmp --quiet "${COMPOSE_FILE}" "${COMPOSE_TEMP_FILE}"; then
26+
echo "* Updating PDS compose file"
27+
mv "${COMPOSE_TEMP_FILE}" "${COMPOSE_FILE}"
28+
else
2729
rm --force "${COMPOSE_TEMP_FILE}"
28-
exit 0
2930
fi
3031

31-
echo "* Updating PDS"
32-
mv "${COMPOSE_TEMP_FILE}" "${COMPOSE_FILE}"
32+
echo "* Pulling latest PDS image"
33+
docker compose --project-directory "${PDS_DATADIR}" pull
3334

3435
echo "* Restarting PDS"
3536
systemctl restart pds

0 commit comments

Comments
 (0)