feat: upgrade an app with no user input with --minor/major/patch flag #104

Merged
decentral1se merged 4 commits from knoflook/abra:recipe-upgrade into main 2021-10-05 09:55:25 +00:00
Owner
closes https://git.coopcloud.tech/coop-cloud/organising/issues/172
knoflook force-pushed recipe-upgrade from 7991e88ed9 to 3f1ddc049e 2021-10-03 08:20:28 +00:00 Compare
Author
Owner

fixed the merge conflict

fixed the merge conflict
knoflook added 1 commit 2021-10-04 11:40:33 +00:00
Author
Owner

works for me 🤷

works for me 🤷
Owner

This is so fucking rad to see come together. Here are my test logs, some more bugs lurking it seems.

It is pretty wild that you can change all the tags of the entire stack but I wonder, will we also only want to do certain tags? I guess we'll figure it out as we go tho.

nextcloud

➜  abra (recipe-upgrade) ✔ ./abra recipe upgrade -p nextcloud
INFO[0002] tag updated from '1.20.0' to '1.20.1' for 'nextcloud' 
INFO[0003] tag updated from '22.1.0-fpm' to '22.1.1-fpm' for 'nextcloud' 
INFO[0003] tag updated from '10.5' to '' for 'nextcloud' 
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x81bcfe]

goroutine 1 [running]:
github.com/docker/distribution/reference.Path({0x0, 0x0})
	/home/foo/go/pkg/mod/github.com/docker/distribution@v2.7.1+incompatible/reference/reference.go:162 +0x3e
coopcloud.tech/abra/pkg/compose.UpdateTag({0xc0004fa100, 0x12}, {0xc0006b4a62, 0x9}, {0xc0002d00d0, 0xa}, {0x7ffc810ed6f9, 0x9})
	/home/foo/work/coop-cloud/abra/pkg/compose/compose.go:51 +0x3c5
coopcloud.tech/abra/pkg/recipe.Recipe.UpdateTag({{0x7ffc810ed6f9, 0x2}, 0xc00010f680}, {0xc0006b4a62, 0x9}, {0xc0002d00d0, 0xa})
	/home/foo/work/coop-cloud/abra/pkg/recipe/recipe.go:38 +0xfb
coopcloud.tech/abra/cli/recipe.glob..func7(0xc00010efc0)
	/home/foo/work/coop-cloud/abra/cli/recipe/upgrade.go:154 +0xeca
github.com/urfave/cli/v2.(*Command).Run(0x14eef20, 0xc000426740)
	/home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x64a
github.com/urfave/cli/v2.(*App).RunAsSubcommand(0xc0001036c0, 0xc000426580)
	/home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:434 +0x9a6
github.com/urfave/cli/v2.(*Command).startApp(0x14ef160, 0xc000426580)
	/home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:278 +0x713
github.com/urfave/cli/v2.(*Command).Run(0xc0004262c0, 0x7ffc810ed6e7)
	/home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:94 +0x7bc
github.com/urfave/cli/v2.(*App).RunContext(0xc000103520, {0xef4178, 0xc00003a1f0}, {0xc0000320a0, 0x5, 0x5})
	/home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0x81e
github.com/urfave/cli/v2.(*App).Run(...)
	/home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224
coopcloud.tech/abra/cli.RunApp({0xd98aa1, 0x3}, {0xee98c0, 0xc0000001a0})
	/home/foo/work/coop-cloud/abra/cli/cli.go:96 +0x4f6
main.main()
	/home/foo/work/coop-cloud/abra/cmd/abra/main.go:23 +0xbb
diff --git a/compose.yml b/compose.yml
index 82179d3..e096f88 100644
--- a/compose.yml
+++ b/compose.yml
@@ -1,7 +1,7 @@
 version: "3.8"
 services:
   web:
-    image: nginx:1.20.0
+    image: nginx:1.20.1
     configs:
       - source: nginx_conf
         target: /etc/nginx/nginx.conf
@@ -34,7 +34,7 @@ services:
         - "coop-cloud.${STACK_NAME}.web.version=1.20.0-ea4560b8"
 
   app:
-    image: nextcloud:22.1.0-fpm
+    image: nextcloud:22.1.1-fpm
     depends_on:
       - db
     configs:
@@ -77,7 +77,7 @@ services:
         - "coop-cloud.${STACK_NAME}.app.version=22.1.0-fpm-d1c56487"
 
   db:
-    image: "mariadb:10.5"
+    image: "mariadb:"
     environment:
       - MYSQL_DATABASE=nextcloud
       - MYSQL_USER=nextcloud
@@ -98,7 +98,7 @@ services:
         - "coop-cloud.${STACK_NAME}.db.version=10.5-62601155"
 
   cron:
-    image: nextcloud:22.1.0-fpm
+    image: nextcloud:22.1.1-fpm
     volumes:
       - nextcloud:/var/www/html/
       - nextapps:/var/www/html/custom_apps:cached

peertube

➜  abra (recipe-upgrade) ✔ ./abra recipe upgrade -p peertube                                                                                                   <<<
INFO[0001] tag updated from 'v3.3.0-buster' to '' for 'peertube' 
FATA[0001] yaml: line 38: mapping values are not allowed in this context 
diff --git a/compose.yml b/compose.yml
index dbf834a..a46ce93 100644
--- a/compose.yml
+++ b/compose.yml
@@ -35,7 +35,7 @@ services:
         - coop-cloud.${STACK_NAME}.web.version=1.20.0-ea4560b8
 
   app:
-    image: chocobozzz/peertube:v3.3.0-buster
+    image: chocobozzz/peertube:
     environment:
       - PEERTUBE_ADMIN_EMAIL
       - PEERTUBE_CONTACT_FORM_ENABLED

keycloak

➜  abra (recipe-upgrade) ✔ ./abra recipe upgrade -p keycloak 
INFO[0001] tag updated from '13.0.1' to '' for 'keycloak' 
INFO[0002] no new versions available for 'mariadb', '10.6' is the latest 
diff --git a/compose.yml b/compose.yml
index 8d56837..31d3377 100644
--- a/compose.yml
+++ b/compose.yml
@@ -1,7 +1,7 @@
 version: "3.8"
 services:
   app:
-    image: "jboss/keycloak:13.0.1"
+    image: "jboss/keycloak:"
     networks:
       - proxy
       - internal
This is so fucking rad to see come together. Here are my test logs, some more bugs lurking it seems. It is pretty wild that you can change all the tags of the entire stack but I wonder, will we also only want to do certain tags? I guess we'll figure it out as we go tho. ### nextcloud ``` ➜ abra (recipe-upgrade) ✔ ./abra recipe upgrade -p nextcloud INFO[0002] tag updated from '1.20.0' to '1.20.1' for 'nextcloud' INFO[0003] tag updated from '22.1.0-fpm' to '22.1.1-fpm' for 'nextcloud' INFO[0003] tag updated from '10.5' to '' for 'nextcloud' panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x81bcfe] goroutine 1 [running]: github.com/docker/distribution/reference.Path({0x0, 0x0}) /home/foo/go/pkg/mod/github.com/docker/distribution@v2.7.1+incompatible/reference/reference.go:162 +0x3e coopcloud.tech/abra/pkg/compose.UpdateTag({0xc0004fa100, 0x12}, {0xc0006b4a62, 0x9}, {0xc0002d00d0, 0xa}, {0x7ffc810ed6f9, 0x9}) /home/foo/work/coop-cloud/abra/pkg/compose/compose.go:51 +0x3c5 coopcloud.tech/abra/pkg/recipe.Recipe.UpdateTag({{0x7ffc810ed6f9, 0x2}, 0xc00010f680}, {0xc0006b4a62, 0x9}, {0xc0002d00d0, 0xa}) /home/foo/work/coop-cloud/abra/pkg/recipe/recipe.go:38 +0xfb coopcloud.tech/abra/cli/recipe.glob..func7(0xc00010efc0) /home/foo/work/coop-cloud/abra/cli/recipe/upgrade.go:154 +0xeca github.com/urfave/cli/v2.(*Command).Run(0x14eef20, 0xc000426740) /home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:163 +0x64a github.com/urfave/cli/v2.(*App).RunAsSubcommand(0xc0001036c0, 0xc000426580) /home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:434 +0x9a6 github.com/urfave/cli/v2.(*Command).startApp(0x14ef160, 0xc000426580) /home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:278 +0x713 github.com/urfave/cli/v2.(*Command).Run(0xc0004262c0, 0x7ffc810ed6e7) /home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/command.go:94 +0x7bc github.com/urfave/cli/v2.(*App).RunContext(0xc000103520, {0xef4178, 0xc00003a1f0}, {0xc0000320a0, 0x5, 0x5}) /home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:313 +0x81e github.com/urfave/cli/v2.(*App).Run(...) /home/foo/go/pkg/mod/github.com/urfave/cli/v2@v2.3.0/app.go:224 coopcloud.tech/abra/cli.RunApp({0xd98aa1, 0x3}, {0xee98c0, 0xc0000001a0}) /home/foo/work/coop-cloud/abra/cli/cli.go:96 +0x4f6 main.main() /home/foo/work/coop-cloud/abra/cmd/abra/main.go:23 +0xbb ``` ```diff diff --git a/compose.yml b/compose.yml index 82179d3..e096f88 100644 --- a/compose.yml +++ b/compose.yml @@ -1,7 +1,7 @@ version: "3.8" services: web: - image: nginx:1.20.0 + image: nginx:1.20.1 configs: - source: nginx_conf target: /etc/nginx/nginx.conf @@ -34,7 +34,7 @@ services: - "coop-cloud.${STACK_NAME}.web.version=1.20.0-ea4560b8" app: - image: nextcloud:22.1.0-fpm + image: nextcloud:22.1.1-fpm depends_on: - db configs: @@ -77,7 +77,7 @@ services: - "coop-cloud.${STACK_NAME}.app.version=22.1.0-fpm-d1c56487" db: - image: "mariadb:10.5" + image: "mariadb:" environment: - MYSQL_DATABASE=nextcloud - MYSQL_USER=nextcloud @@ -98,7 +98,7 @@ services: - "coop-cloud.${STACK_NAME}.db.version=10.5-62601155" cron: - image: nextcloud:22.1.0-fpm + image: nextcloud:22.1.1-fpm volumes: - nextcloud:/var/www/html/ - nextapps:/var/www/html/custom_apps:cached ``` ### peertube ``` ➜ abra (recipe-upgrade) ✔ ./abra recipe upgrade -p peertube <<< INFO[0001] tag updated from 'v3.3.0-buster' to '' for 'peertube' FATA[0001] yaml: line 38: mapping values are not allowed in this context ``` ```diff diff --git a/compose.yml b/compose.yml index dbf834a..a46ce93 100644 --- a/compose.yml +++ b/compose.yml @@ -35,7 +35,7 @@ services: - coop-cloud.${STACK_NAME}.web.version=1.20.0-ea4560b8 app: - image: chocobozzz/peertube:v3.3.0-buster + image: chocobozzz/peertube: environment: - PEERTUBE_ADMIN_EMAIL - PEERTUBE_CONTACT_FORM_ENABLED ``` ### keycloak ``` ➜ abra (recipe-upgrade) ✔ ./abra recipe upgrade -p keycloak INFO[0001] tag updated from '13.0.1' to '' for 'keycloak' INFO[0002] no new versions available for 'mariadb', '10.6' is the latest ``` ``` diff --git a/compose.yml b/compose.yml index 8d56837..31d3377 100644 --- a/compose.yml +++ b/compose.yml @@ -1,7 +1,7 @@ version: "3.8" services: app: - image: "jboss/keycloak:13.0.1" + image: "jboss/keycloak:" networks: - proxy - internal ```
Author
Owner

yeah my testing methodology was a bit half-assed with this PR 😆 I'm looking into those errors now

yeah my testing methodology was a bit half-assed with this PR 😆 I'm looking into those errors now
knoflook added 1 commit 2021-10-05 09:39:17 +00:00
decentral1se merged commit 11c4651a3b into main 2021-10-05 09:55:25 +00:00
Sign in to join this conversation.
No description provided.