dokku-redis icon indicating copy to clipboard operation
dokku-redis copied to clipboard

Unify url setting

Open fruitl00p opened this issue 6 years ago • 5 comments

In order to fix #94 and finalize #122 this PR tracks the progress.. From what i've seen this seems right...

@josegonzalez what'd you think?

fruitl00p avatar May 09 '19 07:05 fruitl00p

DOKKU_VERSION=v0.14.0

Build Url

1..8 (service_promote.bats)

not ok 5 (redis:promote) changes REDIS_URL in 7sec
(from function `assert_equal' in file test_helper.bash, line 17,
 in test file service_promote.bats, line 46)
  `assert_equal "$url" "redis://l:$password@dokku-redis-l:6379"' failed
       Waiting for container to be ready
=====> Redis container created: l
=====> Container Information
       Config dir:          /var/lib/dokku/services/redis/l/config
       Data dir:            /var/lib/dokku/services/redis/l/data
       Dsn:                 redis://l:e60839c1ce38c2493d869c6089847dc67b23df29ee445fcf9d7d70c4f916efbe@dokku-redis-l:6379
       Exposed ports:       -                        
       Id:                  fa03e3a482c47f0a005f448a85c7b7e7bada6f127fe66c899f6a4a194b103ed0
       Internal ip:         172.17.0.2               
       Links:               -                        
       Service root:        /var/lib/dokku/services/redis/l
       Status:              running                  
       Version:             redis:5.0.4              
-----> Creating my_app... done
-----> Setting config vars
       REDIS_URL:  redis://l:e60839c1ce38c2493d869c6089847dc67b23df29ee445fcf9d7d70c4f916efbe@dokku-redis-l:6379
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       REDIS_JDBC_URL:  jdbc:redis://dokku-redis-l:6379?user=l&password=e60839c1ce38c2493d869c6089847dc67b23df29ee445fcf9d7d70c4f916efbe
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_BLUE_URL:  redis://l:e60839c1ce38c2493d869c6089847dc67b23df29ee445fcf9d7d70c4f916efbe@dokku-redis-l:6379
       REDIS_URL:             redis://u:p@host:6379/db
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_AQUA_JDBC_URL:  
       DOKKU_REDIS_AQUA_URL:       redis://u:p@host:6379/db
       REDIS_URL:                  redis://l:e60839c1ce38c2493d869c6089847dc67b23df29ee445fcf9d7d70c4f916efbe@dokku-redis-l:6379JDBC_REDIS_URL=
-----> Restarting app my_app
 !     App my_app has not been deployed
expected: redis://l:e60839c1ce38c2493d869c6089847dc67b23df29ee445fcf9d7d70c4f916efbe@dokku-redis-l:6379JDBC_REDIS_URL=
actual:   redis://l:e60839c1ce38c2493d869c6089847dc67b23df29ee445fcf9d7d70c4f916efbe@dokku-redis-l:6379
FAILED: Invalid key name: 'DOKKU_REDIS_BLUE_URL REDIS_URL'
=====> Deleting l
=====> Stopping container
       Container stopped
       Removing container
       Removing data
=====> Redis container deleted: l
Destroying my_app (including all add-ons)
App image (dokku/my_app:latest) not found
       Unlinking from *
App my_app has not been deployed
not ok 7 (redis:promote) uses REDIS_DATABASE_SCHEME variable in 6sec
(from function `assert_equal' in file test_helper.bash, line 17,
 in test file service_promote.bats, line 62)
  `assert_equal "$url" "redis2://l:$password@dokku-redis-l:6379"' failed
       Waiting for container to be ready
=====> Redis container created: l
=====> Container Information
       Config dir:          /var/lib/dokku/services/redis/l/config
       Data dir:            /var/lib/dokku/services/redis/l/data
       Dsn:                 redis://l:b73b7f2474f144d8010a96ea2071c6dd74950cd7fbc68b7d1102e94e530afed7@dokku-redis-l:6379
       Exposed ports:       -                        
       Id:                  6a138386369767facb97a7306a53b56fa68ae91819bdae80e0c74daa19e9fa5b
       Internal ip:         172.17.0.2               
       Links:               -                        
       Service root:        /var/lib/dokku/services/redis/l
       Status:              running                  
       Version:             redis:5.0.4              
-----> Creating my_app... done
-----> Setting config vars
       REDIS_URL:  redis://l:b73b7f2474f144d8010a96ea2071c6dd74950cd7fbc68b7d1102e94e530afed7@dokku-redis-l:6379
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       REDIS_JDBC_URL:  jdbc:redis://dokku-redis-l:6379?user=l&password=b73b7f2474f144d8010a96ea2071c6dd74950cd7fbc68b7d1102e94e530afed7
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_BLUE_URL:   redis2://l:b73b7f2474f144d8010a96ea2071c6dd74950cd7fbc68b7d1102e94e530afed7@dokku-redis-l:6379
       REDIS_DATABASE_SCHEME:  redis2
       REDIS_URL:              redis://u:p@host:6379
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_AQUA_JDBC_URL:  
       DOKKU_REDIS_AQUA_URL:       redis://u:p@host:6379
       REDIS_URL:                  redis2://l:b73b7f2474f144d8010a96ea2071c6dd74950cd7fbc68b7d1102e94e530afed7@dokku-redis-l:6379JDBC_REDIS_URL=
-----> Restarting app my_app
 !     App my_app has not been deployed
expected: redis2://l:b73b7f2474f144d8010a96ea2071c6dd74950cd7fbc68b7d1102e94e530afed7@dokku-redis-l:6379JDBC_REDIS_URL=
actual:   redis2://l:b73b7f2474f144d8010a96ea2071c6dd74950cd7fbc68b7d1102e94e530afed7@dokku-redis-l:6379
FAILED: Invalid key name: 'DOKKU_REDIS_BLUE_URL REDIS_URL'
=====> Deleting l
=====> Stopping container
       Container stopped
       Removing container
       Removing data
=====> Redis container deleted: l
Destroying my_app (including all add-ons)
App image (dokku/my_app:latest) not found
       Unlinking from *
App my_app has not been deployed

dokku-bot avatar May 09 '19 07:05 dokku-bot

DOKKU_VERSION=master

Build Url

1..8 (service_promote.bats)

not ok 5 (redis:promote) changes REDIS_URL in 8sec
(from function `assert_equal' in file test_helper.bash, line 17,
 in test file service_promote.bats, line 46)
  `assert_equal "$url" "redis://l:$password@dokku-redis-l:6379"' failed
       Waiting for container to be ready
=====> Redis container created: l
=====> Container Information
       Config dir:          /var/lib/dokku/services/redis/l/config
       Data dir:            /var/lib/dokku/services/redis/l/data
       Dsn:                 redis://l:a1679dbc7a8a31d7882e3fb5132c08074627b8db9f2e25482dc7d2ab1e52b51a@dokku-redis-l:6379
       Exposed ports:       -                        
       Id:                  fd5bbcef67aba84f2276ca28cff00e66a4a3a44e3d2681f677104c9bd75fa5cf
       Internal ip:         172.17.0.2               
       Links:               -                        
       Service root:        /var/lib/dokku/services/redis/l
       Status:              running                  
       Version:             redis:5.0.4              
-----> Creating my_app... done
-----> Setting config vars
       REDIS_URL:  redis://l:a1679dbc7a8a31d7882e3fb5132c08074627b8db9f2e25482dc7d2ab1e52b51a@dokku-redis-l:6379
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       REDIS_JDBC_URL:  jdbc:redis://dokku-redis-l:6379?user=l&password=a1679dbc7a8a31d7882e3fb5132c08074627b8db9f2e25482dc7d2ab1e52b51a
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_BLUE_URL:  redis://l:a1679dbc7a8a31d7882e3fb5132c08074627b8db9f2e25482dc7d2ab1e52b51a@dokku-redis-l:6379
       REDIS_URL:             redis://u:p@host:6379/db
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_AQUA_JDBC_URL:  
       DOKKU_REDIS_AQUA_URL:       redis://u:p@host:6379/db
       REDIS_URL:                  redis://l:a1679dbc7a8a31d7882e3fb5132c08074627b8db9f2e25482dc7d2ab1e52b51a@dokku-redis-l:6379JDBC_REDIS_URL=
-----> Restarting app my_app
 !     App my_app has not been deployed
expected: redis://l:a1679dbc7a8a31d7882e3fb5132c08074627b8db9f2e25482dc7d2ab1e52b51a@dokku-redis-l:6379JDBC_REDIS_URL=
actual:   redis://l:a1679dbc7a8a31d7882e3fb5132c08074627b8db9f2e25482dc7d2ab1e52b51a@dokku-redis-l:6379
FAILED: Invalid key name: 'DOKKU_REDIS_BLUE_URL REDIS_URL'
=====> Deleting l
=====> Stopping container
       Container stopped
       Removing container
       Removing data
=====> Redis container deleted: l
Destroying my_app (including all add-ons)
App image (dokku/my_app:latest) not found
json: cannot unmarshal array into Go value of type types.ContainerJSON
       Unlinking from *
App my_app has not been deployed
not ok 7 (redis:promote) uses REDIS_DATABASE_SCHEME variable in 8sec
(from function `assert_equal' in file test_helper.bash, line 17,
 in test file service_promote.bats, line 62)
  `assert_equal "$url" "redis2://l:$password@dokku-redis-l:6379"' failed
       Waiting for container to be ready
=====> Redis container created: l
=====> Container Information
       Config dir:          /var/lib/dokku/services/redis/l/config
       Data dir:            /var/lib/dokku/services/redis/l/data
       Dsn:                 redis://l:29b94e585dcd689ccd5b0ac13c9c7a76b1ba41cb51efd2487009fc9d2c81b570@dokku-redis-l:6379
       Exposed ports:       -                        
       Id:                  0ff01f38dfdcbbc81e54260127cb3653da368524798bc14bf49b36483bdc0cbe
       Internal ip:         172.17.0.2               
       Links:               -                        
       Service root:        /var/lib/dokku/services/redis/l
       Status:              running                  
       Version:             redis:5.0.4              
-----> Creating my_app... done
-----> Setting config vars
       REDIS_URL:  redis://l:29b94e585dcd689ccd5b0ac13c9c7a76b1ba41cb51efd2487009fc9d2c81b570@dokku-redis-l:6379
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       REDIS_JDBC_URL:  jdbc:redis://dokku-redis-l:6379?user=l&password=29b94e585dcd689ccd5b0ac13c9c7a76b1ba41cb51efd2487009fc9d2c81b570
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_BLUE_URL:   redis2://l:29b94e585dcd689ccd5b0ac13c9c7a76b1ba41cb51efd2487009fc9d2c81b570@dokku-redis-l:6379
       REDIS_DATABASE_SCHEME:  redis2
       REDIS_URL:              redis://u:p@host:6379
-----> Restarting app my_app
 !     App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_AQUA_JDBC_URL:  
       DOKKU_REDIS_AQUA_URL:       redis://u:p@host:6379
       REDIS_URL:                  redis2://l:29b94e585dcd689ccd5b0ac13c9c7a76b1ba41cb51efd2487009fc9d2c81b570@dokku-redis-l:6379JDBC_REDIS_URL=
-----> Restarting app my_app
 !     App my_app has not been deployed
expected: redis2://l:29b94e585dcd689ccd5b0ac13c9c7a76b1ba41cb51efd2487009fc9d2c81b570@dokku-redis-l:6379JDBC_REDIS_URL=
actual:   redis2://l:29b94e585dcd689ccd5b0ac13c9c7a76b1ba41cb51efd2487009fc9d2c81b570@dokku-redis-l:6379
FAILED: Invalid key name: 'DOKKU_REDIS_BLUE_URL REDIS_URL'
=====> Deleting l
=====> Stopping container
       Container stopped
       Removing container
       Removing data
=====> Redis container deleted: l
Destroying my_app (including all add-ons)
App image (dokku/my_app:latest) not found
json: cannot unmarshal array into Go value of type types.ContainerJSON
       Unlinking from *
App my_app has not been deployed

dokku-bot avatar May 09 '19 07:05 dokku-bot

DOKKU_VERSION=v0.12.0

Build Url

1..8 (service_promote.bats)

not ok 5 (redis:promote) changes REDIS_URL in 7sec
(from function `assert_equal' in file test_helper.bash, line 17,
 in test file service_promote.bats, line 46)
  `assert_equal "$url" "redis://l:$password@dokku-redis-l:6379"' failed
       Waiting for container to be ready
=====> Redis container created: l
=====> Container Information
       Config dir:          /var/lib/dokku/services/redis/l/config
       Data dir:            /var/lib/dokku/services/redis/l/data
       Dsn:                 redis://l:ed3e1875201b150127aadeb4b4913eb42fe7c71a51a03aad54af23e416cdc6c3@dokku-redis-l:6379
       Exposed ports:       -                        
       Id:                  f3c6e89dfa60d7c22ad8cce4785f6a8a7b7867a72bb7fb3ce8650de63aac8bb5
       Internal ip:         172.17.0.2               
       Links:               -                        
       Service root:        /var/lib/dokku/services/redis/l
       Status:              running                  
       Version:             redis:5.0.4              
-----> Creating my_app... done
-----> Setting config vars
       REDIS_URL:  redis://l:ed3e1875201b150127aadeb4b4913eb42fe7c71a51a03aad54af23e416cdc6c3@dokku-redis-l:6379
-----> Restarting app my_app
App my_app has not been deployed
-----> Setting config vars
       REDIS_JDBC_URL:  jdbc:redis://dokku-redis-l:6379?user=l&password=ed3e1875201b150127aadeb4b4913eb42fe7c71a51a03aad54af23e416cdc6c3
-----> Restarting app my_app
App my_app has not been deployed
-----> Setting config vars
       REDIS_URL:             redis://u:p@host:6379/db
       DOKKU_REDIS_BLUE_URL:  redis://l:ed3e1875201b150127aadeb4b4913eb42fe7c71a51a03aad54af23e416cdc6c3@dokku-redis-l:6379
-----> Restarting app my_app
App my_app has not been deployed
-----> Setting config vars
       DOKKU_REDIS_AQUA_URL:       redis://u:p@host:6379/db
       DOKKU_REDIS_AQUA_JDBC_URL:  
       REDIS_URL:                  redis://l:ed3e1875201b150127aadeb4b4913eb42fe7c71a51a03aad54af23e416cdc6c3@dokku-redis-l:6379JDBC_REDIS_URL=
-----> Restarting app my_app
App my_app has not been deployed
expected: redis://l:ed3e1875201b150127aadeb4b4913eb42fe7c71a51a03aad54af23e416cdc6c3@dokku-redis-l:6379JDBC_REDIS_URL=
actual:   redis://l:ed3e1875201b150127aadeb4b4913eb42fe7c71a51a03aad54af23e416cdc6c3@dokku-redis-l:6379
FAILED: Invalid key name: 'DOKKU_REDIS_BLUE_URL REDIS_URL'
=====> Deleting l
=====> Stopping container
       Container stopped
       Removing container
       Removing data
=====> Redis container deleted: l
Destroying my_app (including all add-ons)
App image (dokku/my_app:latest) not found
       Unlinking from *
App my_app has not been deployed
not ok 7 (redis:promote) uses REDIS_DATABASE_SCHEME variable in 7sec
(from function `assert_equal' in file test_helper.bash, line 17,
 in test file service_promote.bats, line 62)
  `assert_equal "$url" "redis2://l:$password@dokku-redis-l:6379"' failed
       Waiting for container to be ready
=====> Redis container created: l
=====> Container Information
       Config dir:          /var/lib/dokku/services/redis/l/config
       Data dir:            /var/lib/dokku/services/redis/l/data
       Dsn:                 redis://l:3b52f6abd2a13d677e9ec9575bdfe9ceda7c29e1c1373a28cf55e5929ca49760@dokku-redis-l:6379
       Exposed ports:       -                        
       Id:                  3801d338edbf782b5f96c79210e31b3b54c5dbe57d47f6c648607836a214de46
       Internal ip:         172.17.0.2               
       Links:               -                        
       Service root:        /var/lib/dokku/services/redis/l
       Status:              running                  
       Version:             redis:5.0.4              
-----> Creating my_app... done
-----> Setting config vars
       REDIS_URL:  redis://l:3b52f6abd2a13d677e9ec9575bdfe9ceda7c29e1c1373a28cf55e5929ca49760@dokku-redis-l:6379
-----> Restarting app my_app
App my_app has not been deployed
-----> Setting config vars
       REDIS_JDBC_URL:  jdbc:redis://dokku-redis-l:6379?user=l&password=3b52f6abd2a13d677e9ec9575bdfe9ceda7c29e1c1373a28cf55e5929ca49760
-----> Restarting app my_app
App my_app has not been deployed
-----> Setting config vars
       REDIS_DATABASE_SCHEME:  redis2
       REDIS_URL:              redis://u:p@host:6379
       DOKKU_REDIS_BLUE_URL:   redis2://l:3b52f6abd2a13d677e9ec9575bdfe9ceda7c29e1c1373a28cf55e5929ca49760@dokku-redis-l:6379
-----> Restarting app my_app
App my_app has not been deployed
-----> Setting config vars
       REDIS_URL:                  redis2://l:3b52f6abd2a13d677e9ec9575bdfe9ceda7c29e1c1373a28cf55e5929ca49760@dokku-redis-l:6379JDBC_REDIS_URL=
       DOKKU_REDIS_AQUA_URL:       redis://u:p@host:6379
       DOKKU_REDIS_AQUA_JDBC_URL:  
-----> Restarting app my_app
App my_app has not been deployed
expected: redis2://l:3b52f6abd2a13d677e9ec9575bdfe9ceda7c29e1c1373a28cf55e5929ca49760@dokku-redis-l:6379JDBC_REDIS_URL=
actual:   redis2://l:3b52f6abd2a13d677e9ec9575bdfe9ceda7c29e1c1373a28cf55e5929ca49760@dokku-redis-l:6379
FAILED: Invalid key name: 'DOKKU_REDIS_BLUE_URL REDIS_URL'
=====> Deleting l
=====> Stopping container
       Container stopped
       Removing container
       Removing data
=====> Redis container deleted: l
Destroying my_app (including all add-ons)
App image (dokku/my_app:latest) not found
       Unlinking from *
App my_app has not been deployed

dokku-bot avatar May 09 '19 07:05 dokku-bot

Is there anything one can do to test or help somehow to get this into the master branch (in particular into the psql plugin)? It would really ease the deployment of java apps.

atomfrede avatar Jun 16 '19 08:06 atomfrede

I don't currently have time to pick up this change due to work constraints, but if you're interested in sponsoring the work, feel free to contact me.

josegonzalez avatar Jun 17 '19 14:06 josegonzalez

I've thought about this and I think we're just going to settle on the dsn format we have now. If someone wants to sponsor the work, great! If not, its too complex for me to justify adding to the official plugins.

Most frameworks have a way to pre-prepare connection strings, so I would suggest parsing the DSN format we use instead.

josegonzalez avatar Feb 07 '23 13:02 josegonzalez