diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fd4625e824d6af08460eaf084ce2d54bf98fa581..890c2a8387e340ee480a5b1ff1886f36cb01169a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -17,8 +17,9 @@ # overwrite vars when build from main branch. to omit a second # job (see dependency in pages stage). - if [[ $CI_COMMIT_REF_SLUG == "main" ]]; then - - VUE_APP_BASE_URL_VIEWER=$API_MAIN - - VUE_APP_BASE_URL_VIEWER="/ahiqar/website/" + - VUE_APP_BASE_URL_API=$API_MAIN + - VUE_APP_BASE_URL_VIEWER=$MAIN + - VUE_APP_PUBLIC_PATH="/ahiqar/website/" - fi - npm run build - mkdir --parents public/${CI_COMMIT_REF_SLUG} @@ -39,8 +40,10 @@ variables: GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_PROJECT_PATH/$CI_JOB_NAME # ↓ reduces the amount of data transfered to the runner (shallow clone) GIT_DEPTH: 2 - API_DEV: 'https://ahikar-dev.sub.uni-goettingen.de' - API_MAIN: 'https://ahikar.sub.uni-goettingen.de' + DEV: 'https://ahikar-dev.sub.uni-goettingen.de' + MAIN: 'https://ahikar.sub.uni-goettingen.de' + API_DEV: '$DEV/api' + API_MAIN: '$MAIN/api' BASE_BACKEND: '/website' @@ -66,7 +69,8 @@ install: build_page-all: variables: VUE_APP_BASE_URL_API: $API_DEV - VUE_APP_BASE_URL_VIEWER: '/ahiqar/website/$CI_COMMIT_REF_SLUG' + VUE_APP_BASE_URL_VIEWER: $DEV + VUE_APP_PUBLIC_PATH: '/ahiqar/website/$CI_COMMIT_REF_SLUG' <<: *build-defaults build_page-develop-backend: @@ -74,7 +78,8 @@ build_page-develop-backend: - develop variables: VUE_APP_BASE_URL_API: $API_DEV - VUE_APP_BASE_URL_VIEWER: $BASE_BACKEND + VUE_APP_BASE_URL_VIEWER: $DEV + VUE_APP_PUBLIC_PATH: $BASE_BACKEND <<: *build-defaults build_page-main-backend: @@ -82,7 +87,8 @@ build_page-main-backend: - main variables: VUE_APP_BASE_URL_API: $API_MAIN - VUE_APP_BASE_URL_VIEWER: $BASE_BACKEND + VUE_APP_BASE_URL_VIEWER: $MAIN + VUE_APP_PUBLIC_PATH: $BASE_BACKEND <<: *build-defaults