From a59dec9e685e3d7e6c579cd95c0698060716567b Mon Sep 17 00:00:00 2001 From: root Date: Mon, 2 Aug 2021 08:26:59 +0000 Subject: [PATCH] feat: various update stack version, scripts --- cozystack/Dockerfile | 2 +- cozystack/install.sh | 6 +++--- create-instance.sh | 13 +++++++++---- db-init.sh | 4 +++- docker-compose.yml | 23 +++++++++++++++-------- update_apps.sh | 3 ++- update_konnectors.sh | 6 +++--- 7 files changed, 36 insertions(+), 21 deletions(-) diff --git a/cozystack/Dockerfile b/cozystack/Dockerfile index 095c6c2..64611ae 100644 --- a/cozystack/Dockerfile +++ b/cozystack/Dockerfile @@ -1,6 +1,6 @@ FROM ubuntu:20.10 AS installer -ARG COZY_VERSION=1.4.18 +ARG COZY_VERSION=1.4.36 ARG NODE_VERSION=12.13.0 WORKDIR /tmp diff --git a/cozystack/install.sh b/cozystack/install.sh index 99a4ca4..d195087 100755 --- a/cozystack/install.sh +++ b/cozystack/install.sh @@ -17,10 +17,10 @@ fi echo "Install cozy-stack..." -wget -O /tmp/cozy-stack-linux-${COZY_ARCH}-${COZY_VERSION} https://github.com/cozy/cozy-stack/releases/download/${COZY_VERSION}/cozy-stack-linux-${COZY_ARCH} -wget -O /tmp/cozy.sha256 https://github.com/cozy/cozy-stack/releases/download/${COZY_VERSION}/cozy-stack.sha256 +wget -O /tmp/cozy-stack-linux-${COZY_ARCH}-${COZY_VERSION} https://github.com/cozy/cozy-stack/releases/download/${COZY_VERSION}/cozy-stack-linux-${COZY_ARCH}-${COZY_VERSION} +wget -O /tmp/cozy.sha256 https://github.com/cozy/cozy-stack/releases/download/${COZY_VERSION}/cozy-stack-linux-${COZY_ARCH}-${COZY_VERSION}.sha256 -grep linux-${COZY_ARCH} /tmp/cozy.sha256 > /tmp/SHA256 +awk '/cozy-stack-linux-'${COZY_ARCH}'-'${COZY_VERSION}'/{print $NF " cozy-stack-linux-'${COZY_ARCH}'-'${COZY_VERSION}'"}' /tmp/cozy.sha256 > /tmp/SHA256 echo "Expected checkum : $(cat /tmp/SHA256)" echo "Checksum of the downloaded file : $(sha256sum --tag /tmp/cozy-stack-linux-${COZY_ARCH}-${COZY_VERSION})" diff --git a/create-instance.sh b/create-instance.sh index 034bab7..0dc17db 100755 --- a/create-instance.sh +++ b/create-instance.sh @@ -10,6 +10,10 @@ INSTANCE_ID=$1 if [ "$2" = "oidc" ]; then OIDC_CONTEXT="--context-name open-id-connect" +else + #Use for service Pilote app / No impact for other instance + OIDC_CONTEXT="--context-name pilotedemo" + echo "Context pilotedemo added" fi source .env @@ -21,10 +25,11 @@ echo "Creating instance ${INSTANCE_ID}.${COZY_TLD} ..." docker-compose exec cozy ./cozy instances add $OIDC_CONTEXT --host 0.0.0.0 --apps drive,collect,settings,home "${INSTANCE_ID}.${COZY_TLD}" | tee "${TMPFILE}" # Install grand lyon apps -docker-compose exec cozy ./cozy konnectors install enedis --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/web-et-numerique/llle_project/enedis-konnector.git#build -docker-compose exec cozy ./cozy konnectors install grdf --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/web-et-numerique/llle_project/grdf-konnector.git#build -docker-compose exec cozy ./cozy konnectors install egl --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/web-et-numerique/llle_project/egl-konnector.git#build -docker-compose exec cozy ./cozy apps install ecolyo --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo.git#build +docker-compose exec cozy ./cozy konnectors install enedisgrandlyon --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/web-et-numerique/llle_project/enedis-konnector.git#build-dev +docker-compose exec cozy ./cozy konnectors install grdfgrandlyon --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/web-et-numerique/llle_project/grdf-konnector.git#build-dev +docker-compose exec cozy ./cozy konnectors install eglgrandlyon --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/web-et-numerique/llle_project/egl-konnector.git#build-dev +docker-compose exec cozy ./cozy apps install ecolyo --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo.git#build-dev +docker-compose exec cozy ./cozy apps install pilote --domain "${INSTANCE_ID}.${COZY_TLD}" git://forge.grandlyon.com/solidarite/monparcourssocial/mps-usager.git#build-dev ## To replace by registry://store/something after next cozy-stack release docker-compose exec cozy ./cozy apps install --domain "${INSTANCE_ID}.${COZY_TLD}" store registry://store/stable | tee -a "${TMPFILE}" diff --git a/db-init.sh b/db-init.sh index 1f7662d..2d9cf18 100755 --- a/db-init.sh +++ b/db-init.sh @@ -8,4 +8,6 @@ source .env docker-compose exec db curl -X PUT -d "{\"_id\":\"eglgrandlyon\",\"grant_mode\":\"secret\",\"slug\":\"eglgrandlyon\",\"secret\":{\"eglBaseURL\":\"${EGL_BASE_URL}\",\"eglAPIAuthKey\":\"${EGL_API_AUTH_KEY}\"}}" http://127.0.0.1:5984/secrets%2Fio-cozy-account_types/eglgrandlyon docker-compose exec db curl -X PUT -d "{\"_id\":\"enedisgrandlyon\",\"grant_mode\":\"authorization_code\",\"client_id\":\"${ENEDIS_CLIENT_ID}\",\"client_secret\":\"${ENEDIS_CLIENT_SECRET}\",\"auth_endpoint\":\"${ENEDIS_AUTH_ENDPOINT}\",\"token_endpoint\": \"${ENEDIS_TOKEN_ENDPOINT}\",\"token_mode\":\"get\"}" http://127.0.0.1:5984/secrets%2Fio-cozy-account_types/enedisgrandlyon -docker-compose exec db curl -X PUT -d "{\"_id\":\"grdfgrandlyon\",\"grant_mode\":\"authorization_code\",\"client_id\":\"${GRDF_CLIENT_ID}\",\"client_secret\":\"${GRDF_CLIENT_SECRET}\",\"auth_endpoint\":\"${GRDF_AUTH_ENDPOINT}\",\"token_endpoint\": \"${GRDF_TOKEN_ENDPOINT}\",\"token_mode\":\"get\"}" http://127.0.0.1:5984/secrets%2Fio-cozy-account_types/grdfgrandlyon \ No newline at end of file +docker-compose exec db curl -X PUT -d "{\"_id\":\"grdfgrandlyon\",\"grant_mode\":\"authorization_code\",\"client_id\":\"${GRDF_CLIENT_ID}\",\"client_secret\":\"${GRDF_CLIENT_SECRET}\",\"auth_endpoint\":\"${GRDF_AUTH_ENDPOINT}\",\"token_endpoint\": \"${GRDF_TOKEN_ENDPOINT}\",\"token_mode\":\"get\"}" http://127.0.0.1:5984/secrets%2Fio-cozy-account_types/grdfgrandlyon +docker-compose exec db curl -X PUT -d "{\"_id\":\"cc.cozycloud.dacc.dev\",\"token\":\"${DACC_DEV_TOKEN}\"}" http://127.0.0.1:5984/secrets%2Fio-cozy-remote-secrets/cc.cozycloud.dacc.dev +docker-compose exec db curl -X PUT -d "{\"_id\":\"org.ecolyo.dju\",\"token\":\"${API_DATAGRANDLYON_TOKEN}\"}" http://127.0.0.1:5984/secrets%2Fio-cozy-remote-secrets/org.ecolyo.dju diff --git a/docker-compose.yml b/docker-compose.yml index 92b1cd1..8d68f97 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -11,13 +11,14 @@ services: - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro logging: - driver: "json-file" + driver: loki options: - max-size: "1M" - max-file: "10" + loki-url: http://localhost:3100/loki/api/v1/push restart: unless-stopped ports: - - 5984:5984 + - 5984:5984 + networks: + - cozy-network cozy: image: npernoud/easy-cozy:latest-amd64 @@ -37,12 +38,13 @@ services: depends_on: - db logging: - driver: "json-file" + driver: loki options: - max-size: "1M" - max-file: "10" + loki-url: http://localhost:3100/loki/api/v1/push restart: unless-stopped - + networks: + - cozy-network + keycloak: image: jboss/keycloak:latest volumes: @@ -55,3 +57,8 @@ services: - KEYCLOAK_USER=admin - KEYCLOAK_PASSWORD=admin - KEYCLOAK_IMPORT=/tmp/kc/realm.json + networks: + - cozy-network + +networks: + cozy-network: diff --git a/update_apps.sh b/update_apps.sh index b76d94b..c699377 100755 --- a/update_apps.sh +++ b/update_apps.sh @@ -3,4 +3,5 @@ echo "Updating Apps ..." -docker-compose exec cozy ./cozy apps update ecolyo --all-domains git://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo.git#build +docker-compose exec cozy ./cozy apps update ecolyo --all-domains git://forge.grandlyon.com/web-et-numerique/llle_project/ecolyo.git#build-dev +# docker-compose exec cozy ./cozy apps install pilote --all-domains git://forge.grandlyon.com/solidarite/monparcourssocial/mps-usager.git#build diff --git a/update_konnectors.sh b/update_konnectors.sh index 691e65d..4fb2ace 100644 --- a/update_konnectors.sh +++ b/update_konnectors.sh @@ -3,6 +3,6 @@ echo "Updating Konnectors ..." -docker-compose exec cozy ./cozy konnectors update enedisgrandlyon --all-domains git://forge.grandlyon.com/web-et-numerique/llle_project/enedis-konnector.git#build -docker-compose exec cozy ./cozy konnectors update grdfgrandlyon --all-domains git://forge.grandlyon.com/web-et-numerique/llle_project/grdf-konnector.git#build -docker-compose exec cozy ./cozy konnectors update eglgrandlyon --all-domains git://forge.grandlyon.com/web-et-numerique/llle_project/egl-konnector.git#build +docker-compose exec cozy ./cozy konnectors update enedisgrandlyon --all-domains git://forge.grandlyon.com/web-et-numerique/llle_project/enedis-konnector.git#build-dev +docker-compose exec cozy ./cozy konnectors update grdfgrandlyon --all-domains git://forge.grandlyon.com/web-et-numerique/llle_project/grdf-konnector.git#build-dev +docker-compose exec cozy ./cozy konnectors update eglgrandlyon --all-domains git://forge.grandlyon.com/web-et-numerique/llle_project/egl-konnector.git#build-dev -- GitLab