Skip to content
Snippets Groups Projects
Commit cf8b04ec authored by Steffen Köhler's avatar Steffen Köhler
Browse files

try new installation method.

parent 426dafd0
Branches
No related merge requests found
Pipeline #34382 passed with stages
in 1 minute and 51 seconds
...@@ -13,7 +13,7 @@ variables: ...@@ -13,7 +13,7 @@ variables:
docker_build: docker_build:
stage: build stage: build
image: ubleipzig/deployer:1.5.0-rc2 image: ubleipzig/deployer:1.5.1
services: services:
- docker:dind - docker:dind
script: | script: |
...@@ -31,7 +31,7 @@ docker_build: ...@@ -31,7 +31,7 @@ docker_build:
docker_publish_alpha: docker_publish_alpha:
stage: publish stage: publish
image: ubleipzig/deployer:1.5.0-rc2 image: ubleipzig/deployer:1.5.1
services: services:
- docker:dind - docker:dind
script: | script: |
...@@ -52,7 +52,7 @@ docker_publish_alpha: ...@@ -52,7 +52,7 @@ docker_publish_alpha:
docker_publish_staging: docker_publish_staging:
stage: publish stage: publish
image: ubleipzig/deployer:1.5.0-rc2 image: ubleipzig/deployer:1.5.1
services: services:
- docker:dind - docker:dind
script: | script: |
...@@ -70,7 +70,7 @@ docker_publish_staging: ...@@ -70,7 +70,7 @@ docker_publish_staging:
docker_publish_production: docker_publish_production:
stage: publish stage: publish
image: ubleipzig/deployer:1.5.0-rc2 image: ubleipzig/deployer:1.5.1
services: services:
- docker:dind - docker:dind
script: | script: |
......
...@@ -14,6 +14,7 @@ permissions="" ...@@ -14,6 +14,7 @@ permissions=""
module_descriptor="" module_descriptor=""
loadSample=false loadSample=false
loadReference=false loadReference=false
jsonfile=/etc/registertenant/install.json
parse_cmdline_parameters() { parse_cmdline_parameters() {
! getopt --test >/dev/null ! getopt --test >/dev/null
...@@ -352,6 +353,37 @@ EOF ...@@ -352,6 +353,37 @@ EOF
return 12 return 12
} }
install_modules_new() {
echo -ne "Installing modules for tenant ... the new way"
debug "install_modules() new style"
while true; do
if [ $INSTALL_TRY_COUNT = 0 ]; then break; fi
result=`curl \
-s \
-X POST \
-w "|%{http_code}" \
-H 'Content-type: application/json' \
--connect-timeout ${CURL_CONNECT_TIMEOUT} \
"${OKAPI_URL}/_/proxy/tenants/${tenant_id}/install?tenantParameters=loadSample=${loadSample},loadReference=${loadReference}" \
-d @${jsonfile} 2>&1`
case "${result##*|}" in
200|201)
echo "done."
return 0
;;
esac
let INSTALL_TRY_COUNT=$INSTALL_TRY_COUNT-1
sleep 1
done
echo "${result##*|} ("${result%|*}")"
return 12
}
find_module_authtoken() { find_module_authtoken() {
echo -ne "Find module authtoken for tenant..." echo -ne "Find module authtoken for tenant..."
...@@ -637,13 +669,13 @@ main() { ...@@ -637,13 +669,13 @@ main() {
&& wait_for_okapi \ && wait_for_okapi \
&& register_frontend_modules $frontend_modules \ && register_frontend_modules $frontend_modules \
&& (tenant_exists || create_tenant) \ && (tenant_exists || create_tenant) \
&& wait_for_backend_modules $backend_modules && install_modules $modules \ && wait_for_backend_modules $backend_modules && install_modules_new \
&& find_module_authtoken \ && find_module_authtoken \
&& disable_module_for_tenant $authtoken \ && disable_module_for_tenant $authtoken \
&& create_admin \ && create_admin \
&& create_admin_credentials \ && create_admin_credentials \
&& create_admin_permission '"perms.all", "perms.users.item.post", "perms.users.assign.immutable", "perms.users.assign.mutable", "perms.users.assign.okapi"' \ && create_admin_permission '"perms.all", "perms.users.item.post", "perms.users.assign.immutable", "perms.users.assign.mutable", "perms.users.assign.okapi"' \
&& install_modules $modules \ && install_modules_new \
&& login \ && login \
&& get_permissions \ && get_permissions \
&& assign_permissions $permissions && assign_permissions $permissions
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment