Automatic old image switch for stable
authorRafael dos Santos Silva <xfalcox@gmail.com>
Wed, 28 Dec 2022 15:11:38 +0000 (12:11 -0300)
committerRafael dos Santos Silva <xfalcox@gmail.com>
Wed, 28 Dec 2022 15:21:49 +0000 (12:21 -0300)
launcher

index 9e35d05b6e1231e76a1de4ee1f6defc5fa4d4237..2ef55619d2a10c067f0fb85b5f9b7992f5820738 100755 (executable)
--- a/launcher
+++ b/launcher
@@ -91,7 +91,8 @@ git_rec_version='1.8.0'
 config_file=containers/"$config".yml
 cidbootstrap=cids/"$config"_bootstrap.cid
 local_discourse=local_discourse
-image="discourse/base:2.0.20220818-0047"
+image="discourse/base:2.0.20221221-0050"
+image_stable="discourse/base:2.0.20220818-0047"
 docker_path=`which docker.io 2> /dev/null || which docker`
 git_path=`which git`
 
@@ -235,6 +236,14 @@ check_prereqs() {
     pull_image
   fi
 
+  # use an older image for stable
+  version=$(cat $config_file | $docker_path run $user_args --rm -i -a stdout -a stdin $image ruby -e \
+      "require 'yaml'; puts YAML.load(STDIN.readlines.join)['params']['version']")
+  if [ "$version" = "stable" ]; then
+    image=$image_stable
+    pull_image
+  fi
+
   # 5. running recommended git version
   test=($($git_path --version))  # Get git version string
   test=${test[2]//,/}  # Get version alone and strip comma if exists