From 51ff20eb2ded73e9713b5e384f0a80d3e1133b93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Laurent?= <francois.laurent@posteo.net>
Date: Wed, 2 Apr 2025 16:15:32 +0200
Subject: [PATCH] fix: release-related hotfixes

---
 README.md                   | 12 ++++--------
 doc/develop.md              |  2 ++
 recipes/README.md           |  6 +-----
 recipes/release.sh          | 26 ++++++++++++++++++++++++++
 test/deploy_and_test.sh     |  3 ++-
 test/predict_and_retrain.sh |  2 ++
 6 files changed, 37 insertions(+), 14 deletions(-)
 create mode 100755 recipes/release.sh

diff --git a/README.md b/README.md
index 6f7173b..da5807a 100644
--- a/README.md
+++ b/README.md
@@ -16,6 +16,8 @@ The *LarvaTagger* project is divided into several components. Although this READ
 
 This package features a web-based graphical user interface (GUI) for visualizing the tracked larvae and assigning discrete behavior tags, at each time step.
 
+As a web GUI, a public instance can be found at [nyx.pasteur.cloud](https://nyx.pasteur.cloud/larvatagger). Demo data can be found in the [Quick start](#quick-start-with-docker) section below.
+
 A command-line interface (CLI) is also available for batch processing, including the automatic tagging of track data files, training new taggers from labeled data, etc.
 
 Although *LarvaTagger.jl* alone comes with no automatic tagger, it is designed to work primarily in combination with [*MaggotUBA*](https://gitlab.pasteur.fr/nyx/MaggotUBA-adapter) for the identification of larval actions or postures.
@@ -53,7 +55,7 @@ Change directory (`cd`) to the Downloads directory. In this example, we will ass
 
 On macOS and Linux, change the permissions of the script file so that it can be executed:
 ```
-chmod a+x larvatagger.sh
+chmod +x larvatagger.sh
 ```
 
 The demo data can be opened in the web browser for visual inspection, on macOS and Linux with:
@@ -132,12 +134,6 @@ cd LarvaTagger
 julia --project=. -e 'using Pkg; Pkg.instantiate()'
 ```
 
-In May 2024, the gitlab.pasteur.fr server began to request an authentication token on cloning public repositories.
-If the `git clone` command requests an authentication token you do not have, do instead:
-```
-curl -sSL https://gitlab.pasteur.fr/nyx/larvatagger.jl/-/archive/main/larvatagger.jl-main.tar.gz | tar zxv && mv larvatagger.jl-main LarvaTagger
-```
-
 Calling `Pkg.instantiate` in a copy of the project is preferred over using `Pkg.add`,
 because *LarvaTagger.jl* depends on several unregistered packages.
 
@@ -218,7 +214,7 @@ Feel free to adjust the value if the 2D view is too small or large.
 
 ## Automatic tagging
 
-*LarvaTagger.jl* comes with no automatic tagger per default, unless run using Docker or installed with the *scripts/install.sh* script and the `--with-default-backend` option.
+*LarvaTagger.jl* comes with no automatic tagger per default, unless you run the Docker image or you installed LarvaTagger with the *scripts/install.sh* script and the `--with-default-backend` option.
 
 To extend the editor with automatic tagging capabilities, see the [recommended installation steps for *TaggingBackends* and *MaggotUBA*](https://gitlab.pasteur.fr/nyx/TaggingBackends#recommended-installation).
 
diff --git a/doc/develop.md b/doc/develop.md
index 6648bcc..322d13f 100644
--- a/doc/develop.md
+++ b/doc/develop.md
@@ -59,3 +59,5 @@ scripts/larvatagger-gui.jl http://localhost:9285
 The `docker=docker` environment variable is required if command `podman` is available.
 The `scripts/larvatagger.sh` script falls back on using `podman` instead of `docker`, if `podman` is available, but it is recommended to perform tests using Docker.
 In addition, at present, building the image works with Docker buildx only.
+
+See also the `recipes/release.sh` script.
diff --git a/recipes/README.md b/recipes/README.md
index 5ad9e8e..f0302b0 100644
--- a/recipes/README.md
+++ b/recipes/README.md
@@ -149,10 +149,6 @@ Optionally, you can also get the default backend (currently *20230311*) with:
 ```
 scripts/larvatagger.sh build --with-default-backend
 ```
-Currently, Docker images on Docker Hub are built with:
-```
-scripts/larvatagger.sh --target confusion build --with-default-backend
-```
 
 If you want another tagger, *e.g.* the *20230129* tagger implemented by the *20230129* branch of the *MaggotUBA-adapter* repository, do:
 ```
@@ -177,7 +173,7 @@ docker pull flaur/larvatagger
 ```
 
 Beware that images that ship with a tagging backend are relatively large files (>5GB on disk).
-If you are not interested in automatic tagging, use the `flaur/larvatagger:0.19-standalone` image instead.
+If you are not interested in automatic tagging, use the `flaur/larvatagger:0.20-standalone` image instead.
 
 ### Upgrading
 
diff --git a/recipes/release.sh b/recipes/release.sh
new file mode 100755
index 0000000..396d858
--- /dev/null
+++ b/recipes/release.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+set -e
+
+RELEASE=$1
+
+if [ -z "$RELEASE" ]; then
+  echo "Usage: $0 <version-number>"
+  exit 1
+fi
+
+docker=docker LARVATAGGER_IMAGE=flaur/larvatagger:$RELEASE-standalone scripts/larvatagger.sh build
+docker=docker LARVATAGGER_IMAGE=flaur/larvatagger:$RELEASE-20230311 scripts/larvatagger.sh --target confusion build --with-default-backend
+docker tag flaur/larvatagger:$RELEASE-20230311 flaur/larvatagger:latest
+docker build -t flaur/larvatagger:$RELEASE-bigfat -f recipes/Dockerfile.pasteurjanelia --no-cache .
+
+test/predict_and_retrain.sh
+
+cat <<EOF
+Next steps are:
+docker login
+docker push flaur/larvatagger:$RELEASE-standalone
+docker push flaur/larvatagger:$RELEASE-20230311
+docker push flaur/larvatagger:$RELEASE-bigfat
+docker push flaur/larvatagger:latest
+EOF
diff --git a/test/deploy_and_test.sh b/test/deploy_and_test.sh
index b0c0113..0de5508 100755
--- a/test/deploy_and_test.sh
+++ b/test/deploy_and_test.sh
@@ -23,7 +23,8 @@ if ! [ -f scripts/install.sh ]; then
 fi
 
 scripts/install.sh --uninstall
-scripts/install.sh --with-default-backend
+LARVATAGGER_BRANCH=dev \
+  scripts/install.sh --with-default-backend
 
 #############
 ## Maestro ##
diff --git a/test/predict_and_retrain.sh b/test/predict_and_retrain.sh
index 771145d..fd68d62 100755
--- a/test/predict_and_retrain.sh
+++ b/test/predict_and_retrain.sh
@@ -3,6 +3,8 @@
 # this script performs a few tests with the Docker image
 # TODO: implement more use cases as in scenarii.sh
 
+set -e
+
 trap 'rm -rf "$TMPDIR"' EXIT
 
 TMPDIR=$(mktemp -d) || exit 1
-- 
GitLab