From f277b263b6c8d0247b08707ad527ef35e43cf10f Mon Sep 17 00:00:00 2001 From: Daya Adianto <dayaadianto@cs.ui.ac.id> Date: Fri, 10 Nov 2023 20:55:48 +0700 Subject: [PATCH] Try to fix the deployment CI job --- .gitlab-ci.yml | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5a7f22f9..2ae349d1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -86,23 +86,19 @@ deploy: DOKKU_APP_NAME: spring-petclinic-rest DOKKU_SSH_REMOTE: "ssh://dokku@dokku-ppl.cs.ui.ac.id:22" DOKKU_SSH_PRIVATE_KEY: $PRODUCTION_SSH_PRIVATE_KEY - script: - - dokku network:exists "${APP_NAME}-network" || - dokku network:create "${APP_NAME}-network" - - dokku postgres:exists "${APP_NAME}-database" || - dokku postgres:create "${APP_NAME}-database" - --image docker.io/library/postgres - --image-version 16.0-alpine + script: > + dokku network:exists "${APP_NAME}-network" || dokku network:create "${APP_NAME}-network" + dokku postgres:exists "${APP_NAME}-database" || dokku postgres:create "${APP_NAME}-database" \ + --image docker.io/library/postgres \ + --image-version 16.0-alpine \ --post-create-network "${APP_NAME}-network" - - dokku apps:exists "$APP_NAME" || - dokku apps:create "$APP_NAME" - - dokku network:set "$APP_NAME" attach-post-create "${APP_NAME}-network" - - dokku postgres:link "${APP_NAME}-database" "$APP_NAME" - - dokku config:set "$APP_NAME" SPRING_PROFILES_ACTIVE="default,csui" - - dokku-deploy - - sh .gitlab/bin/dokku-ci-post-deploy.sh - needs: - - test + dokku apps:exists "$APP_NAME" || dokku apps:create "$APP_NAME" + dokku network:set "$APP_NAME" attach-post-create "${APP_NAME}-network" + dokku postgres:link "${APP_NAME}-database" "$APP_NAME" + dokku config:set "$APP_NAME" SPRING_PROFILES_ACTIVE="default,csui" + dokku-deploy + sh .gitlab/bin/dokku-ci-post-deploy.sh + needs: [] environment: name: production url: "https://${APP_NAME}.dokku-ppl.cs.ui.ac.id" -- GitLab