Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
urgi-is
FAIDARE
Commits
74d039f7
Commit
74d039f7
authored
Feb 14, 2019
by
Guillaume Cornut
Committed by
Raphaël Flores
Feb 22, 2019
Browse files
fix: MR feedback. Remove public beta & other fixes.
parent
2e1a9ab2
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
74d039f7
...
...
@@ -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-p
rivate-int
:
deploy-to-p
ublic-prod
:
stage
:
production
variables
:
ENV
:
p
rivate-int
APP_PORT
:
${P
RIVATE_INT
_GPDS_PORT}
CONTEXT_PATH
:
${P
RIVATE_INT
_GPDS_CONTEXT_PATH}
ENV
:
p
ublic-prod
APP_PORT
:
${P
UBLIC_PROD
_GPDS_PORT}
CONTEXT_PATH
:
${P
UBLIC_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
README.md
View file @
74d039f7
...
...
@@ -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 reboot
ed
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).
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment