Commit 74d039f7 authored by Guillaume Cornut's avatar Guillaume Cornut Committed by Raphaël Flores
Browse files

fix: MR feedback. Remove public beta & other fixes.

parent 2e1a9ab2
......@@ -5,8 +5,10 @@ stages:
- staging
- production
image: urgi/docker-browsers:latest
# Disable the Gradle daemon for Continuous Integration servers as correctness
# is usually a priority over speed in CI environments. Using a fresh
# runtime for each build is more reliable since the runtime is completely
......@@ -17,6 +19,7 @@ variables:
APP_NAME: gpds
JAR_PATH: "backend/build/libs/${APP_NAME}.jar"
# Gradle cache for all jobs
cache:
key: "$CI_COMMIT_REF_NAME"
......@@ -24,14 +27,16 @@ cache:
- ".gradle"
- "frontend/.gradle/"
- "frontend/node_modules/"
- "$JAR_PATH"
# TESTS
lint:
stage: test
script: "./gradlew lint"
test-frontend:
stage: test
script: "./gradlew :frontend:test --parallel"
......@@ -40,6 +45,7 @@ test-frontend:
junit:
- "./frontend/karma-junit-tests-report/TEST*.xml"
test-backend:
stage: test
script: "./gradlew :backend:test --parallel"
......@@ -62,8 +68,10 @@ test-backend:
junit:
- "./backend/build/test-results/test/TEST-*.xml"
# BUILD
build:
stage: build
script:
......@@ -78,8 +86,10 @@ build:
- backend/src/**/*
- frontend/**/*
# DEPLOY
.deploy-to-vm: &deploy_to_vm
# Hidden job which serves as template for executed jobs below.
# See https://docs.gitlab.com/ee/ci/yaml/#anchors
......@@ -90,31 +100,28 @@ build:
- ssh-add <(echo "${SSH_PRIVATE_KEY}")
- ssh -o StrictHostKeyChecking=no root@${SERVER_IP} 'echo "Successfully connected on $(hostname)"'
script:
# Copy jar and data (cleaning them before) to the server
- "scp ./$JAR_PATH root@${SERVER_IP}:/opt/${APP_NAME}/${APP_NAME}-${ENV}.jar"
# Copy jar
- scp ./$JAR_PATH root@${SERVER_IP}:/opt/${APP_NAME}/${APP_NAME}-${ENV}.jar
# Restarting service with the updated jar and the according Spring profiles enabled
- "ssh root@${SERVER_IP} \"systemctl restart ${APP_NAME}-${ENV}\""
- ssh root@${SERVER_IP} "systemctl restart ${APP_NAME}@${ENV}"
- eval $(ssh-agent -k)
- "echo \"Deploy done. Application should be available at: http://${SERVER_IP}:${APP_PORT}/${CONTEXT_PATH} \""
only:
changes:
- .gitlab-ci.yml
- backend/src/**/*
- frontend/**/*
- echo "Deploy done. Application should be available at http://${SERVER_IP}:${APP_PORT}/${CONTEXT_PATH}"
deploy-to-prod:
stage: production
deploy-to-staging:
stage: staging
variables:
ENV: prod
APP_PORT: ${PROD_GPDS_PORT}
CONTEXT_PATH: ${PROD_GPDS_CONTEXT_PATH}
ENV: staging
APP_PORT: ${STAGING_GPDS_PORT}
CONTEXT_PATH: ${STAGING_GPDS_CONTEXT_PATH}
<<: *deploy_to_vm
only:
refs:
- master
when: manual
allow_failure: false
changes:
- .gitlab-ci.yml
- backend/src/**/*
- frontend/**/*
deploy-to-beta:
......@@ -127,64 +134,63 @@ deploy-to-beta:
only:
refs:
- branches
except:
refs:
- master
changes:
- .gitlab-ci.yml
- backend/src/**/*
- frontend/**/*
when: manual
allow_failure: false
deploy-to-staging:
stage: staging
variables:
ENV: staging
APP_PORT: ${STAGING_GPDS_PORT}
CONTEXT_PATH: ${STAGING_GPDS_CONTEXT_PATH}
<<: *deploy_to_vm
only:
refs:
- master
deploy-to-private-prod:
deploy-to-int:
stage: production
variables:
ENV: private-prod
APP_PORT: ${PRIVATE_PROD_GPDS_PORT}
CONTEXT_PATH: ${PRIVATE_PROD_GPDS_CONTEXT_PATH}
ENV: int
APP_PORT: ${INT_GPDS_PORT}
CONTEXT_PATH: ${INT_GPDS_CONTEXT_PATH}
<<: *deploy_to_vm
only:
refs:
- master
changes:
- .gitlab-ci.yml
- backend/src/**/*
- frontend/**/*
when: manual
allow_failure: false
deploy-to-private-int:
deploy-to-public-prod:
stage: production
variables:
ENV: private-int
APP_PORT: ${PRIVATE_INT_GPDS_PORT}
CONTEXT_PATH: ${PRIVATE_INT_GPDS_CONTEXT_PATH}
ENV: public-prod
APP_PORT: ${PUBLIC_PROD_GPDS_PORT}
CONTEXT_PATH: ${PUBLIC_PROD_GPDS_CONTEXT_PATH}
<<: *deploy_to_vm
only:
refs:
- master
changes:
- .gitlab-ci.yml
- backend/src/**/*
- frontend/**/*
when: manual
allow_failure: false
deploy-to-private-beta:
stage: staging
deploy-to-private-prod:
stage: production
variables:
ENV: private-beta
APP_PORT: ${PRIVATE_BETA_GPDS_PORT}
CONTEXT_PATH: ${PRIVATE_BETA_GPDS_CONTEXT_PATH}
ENV: private-prod
APP_PORT: ${PRIVATE_PROD_GPDS_PORT}
CONTEXT_PATH: ${PRIVATE_PROD_GPDS_CONTEXT_PATH}
<<: *deploy_to_vm
only:
refs:
- branches
except:
refs:
- master
changes:
- .gitlab-ci.yml
- backend/src/**/*
- frontend/**/*
when: manual
allow_failure: false
......@@ -105,7 +105,7 @@ The details of this remote server are filled in the `bootstrap.yml` file.
By default, it tries to connect to the remote server on http://localhost:8888
but it can of course be changed, or even configured via the `SPRING_CONFIG_URI` environment variable.
It will try to fetch the configuration for the application name `rare`, and the default profile.
It will try to fetch the configuration for the application name `gpds`, and the default profile.
If such a configuration is not found, it will then fallback to the local `application.yml` properties.
To avoid running the Spring Cloud config server every time when developing the application,
all the properties are still available in `application.yml` even if they are configured on the remote Spring Cloud server as well.
......@@ -114,7 +114,7 @@ If you want to use the Spring Cloud config app locally,
see https://forgemia.inra.fr/urgi-is/data-discovery-config
The configuration is currently only read on startup,
meaning the application has to be reboot if the configuration is changed on the Spring Cloud server.
meaning the application has to be rebooted if the configuration is changed on the Spring Cloud server.
For a dynamic reload without restarting the application,
see http://cloud.spring.io/spring-cloud-static/Finchley.SR1/single/spring-cloud.html#refresh-scope
to check what has to be changed.
......@@ -124,14 +124,4 @@ and append the `--spring.cloud.config.label=<branch name to test>` parameter whe
More info on how pass a parameter to a Spring Boot app:
https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-external-config.html#boot-features-external-config
### Application port & context path
| | GPDS GnpIS |
| :------------: | :---------------------- |
| dev | :8060/gnpis/gpds |
| beta | :8061/gnpis/gpds-beta |
| staging | :8062/staging/gnpis/gpds |
| prod | :8063/gnpis/gpds |
| private prod | :8064/private/gnpis/gpds |
| private beta | :8065/beta/gnpis/gpds |
| private int | :8066/int/gnpis/gpds |
See the [`data-discovery-config` README.md file](https://forgemia.inra.fr/urgi-is/data-discovery-config/blob/master/README.md) for the list of application environments (server ports and context paths).
Markdown is supported
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