Commit 4b6c8cd4 authored by Raphaël Flores's avatar Raphaël Flores
Browse files

Merge branch 'chore/rename_rare-with-basket' into 'master'

Rename 'rare-with-basket' in 'brc4env'. GNP-5796.

See merge request urgi-is/data-discovery!314
parents 3027022d 76aaf5c3
......@@ -205,9 +205,9 @@ build-rare:
APP_NAME: ${RARE_APP_NAME}
<<: *build_app # Merge the contents of the 'build_app' alias
build-rare-with-basket:
build-brc4env:
variables:
APP_NAME: "rare-with-basket"
APP_NAME: "brc4env"
<<: *build_app # Merge the contents of the 'build_app' alias
build-wheatis:
......@@ -309,11 +309,11 @@ build-data-discovery:
ES_PORT: ${ES_DEV_PORT} # TODO: TO BE FIXED WHEN PROD CLUSTER AVAILABLE IN OPENSTACK
APP_CONTEXT: ${APP_NAME}
.variables-rare-with-basket-beta-openstack: &variables-rare-with-basket-beta-openstack
.variables-brc4env-beta-openstack: &variables-brc4env-beta-openstack
variables:
ENV: beta
APP_NAME: rare-with-basket
APP_PORT: ${BETA_RARE_WITH_BASKET_PORT}
APP_NAME: brc4env
APP_PORT: ${BETA_BRC4ENV_PORT}
DATA_DIR: rare
SERVER_IP: ${SERVER_IP_OPENSTACK}
SERVER_USER: ${SERVER_USER_OPENSTACK}
......@@ -322,11 +322,11 @@ build-data-discovery:
ES_PORT: ${ES_DEV_PORT}
APP_CONTEXT: ${APP_NAME}
.variables-rare-with-basket-staging-openstack: &variables-rare-with-basket-staging-openstack
.variables-brc4env-staging-openstack: &variables-brc4env-staging-openstack
variables:
ENV: staging
APP_NAME: rare-with-basket
APP_PORT: ${STAGING_RARE_WITH_BASKET_PORT}
APP_NAME: brc4env
APP_PORT: ${STAGING_BRC4ENV_PORT}
DATA_DIR: rare
SERVER_IP: ${SERVER_IP_OPENSTACK}
SERVER_USER: ${SERVER_USER_OPENSTACK}
......@@ -336,13 +336,13 @@ build-data-discovery:
APP_CONTEXT: ${APP_NAME}
# ALPHA
.variables-rare-with-basket-prod-openstack: &variables-rare-with-basket-prod-openstack
.variables-brc4env-prod-openstack: &variables-brc4env-prod-openstack
variables:
ENV: prod
APP_NAME: rare-with-basket
APP_PORT: ${PROD_RARE_WITH_BASKET_PORT}
APP_NAME: brc4env
APP_PORT: ${PROD_BRC4ENV_PORT}
DATA_DIR: rare
SERVER_IP: ${SERVER_IP_OPENSTACK}
SERVER_IP: ${SERVER_IP_OPENSTACK_PROD}
SERVER_USER: ${SERVER_USER_OPENSTACK}
ES_HOST: ${ES_PROD_HOST_OPENSTACK} # TODO: TO BE FIXED WHEN PROD CLUSTER AVAILABLE IN OPENSTACK
ES_HOSTS: ${ES_PROD_HOSTS_OPENSTACK} # TODO: TO BE FIXED WHEN PROD CLUSTER AVAILABLE IN OPENSTACK
......@@ -516,11 +516,11 @@ deploy-rare-to-prod-openstack:
when: manual
allow_failure: false
deploy-rare-with-basket-to-beta-openstack:
deploy-brc4env-to-beta-openstack:
stage: deploy-beta
tags:
- openstack
<<: *variables-rare-with-basket-beta-openstack
<<: *variables-brc4env-beta-openstack
<<: *deploy_to_vm_openstack
only:
changes:
......@@ -533,11 +533,11 @@ deploy-rare-with-basket-to-beta-openstack:
- master
allow_failure: false # mandatory to block the execution of the pipeline
deploy-rare-with-basket-to-staging-openstack:
deploy-brc4env-to-staging-openstack:
stage: deploy-staging
tags:
- openstack
<<: *variables-rare-with-basket-staging-openstack
<<: *variables-brc4env-staging-openstack
<<: *deploy_to_vm_openstack
only:
changes:
......@@ -551,11 +551,11 @@ deploy-rare-with-basket-to-staging-openstack:
when: manual
# ALPHA
deploy-rare-with-basket-to-prod-openstack:
deploy-brc4env-to-prod-openstack:
stage: deploy-production
tags:
- openstack
<<: *variables-rare-with-basket-prod-openstack
<<: *variables-brc4env-prod-openstack
<<: *deploy_to_vm_openstack
only:
changes:
......@@ -794,16 +794,16 @@ data-integration-rare-prod-openstack:
refs:
- master
data-integration-rare-with-basket-beta-openstack:
data-integration-brc4env-beta-openstack:
stage: data-integration-beta
tags:
- openstack
<<: *variables-rare-with-basket-beta-openstack
<<: *variables-brc4env-beta-openstack
<<: *data-integration-openstack
only:
changes:
- data/rare/*.json.gz
- data/rare/suggestions/rare-with-basket_bulk*.json.gz
- data/rare/suggestions/brc4env_bulk*.json.gz
- scripts/*
refs:
- branches
......@@ -811,16 +811,16 @@ data-integration-rare-with-basket-beta-openstack:
refs:
- master
data-integration-rare-with-basket-staging-openstack:
data-integration-brc4env-staging-openstack:
stage: data-integration-staging
tags:
- openstack
<<: *variables-rare-with-basket-staging-openstack
<<: *variables-brc4env-staging-openstack
<<: *data-integration-openstack
only:
changes:
- data/rare/*.json.gz
- data/rare/suggestions/rare-with-basket_bulk*.json.gz
- data/rare/suggestions/brc4env_bulk*.json.gz
- scripts/*
refs:
- branches
......@@ -830,16 +830,16 @@ data-integration-rare-with-basket-staging-openstack:
when: manual
# ALPHA
data-integration-rare-with-basket-prod-openstack:
data-integration-brc4env-prod-openstack:
stage: data-integration-production
tags:
- openstack
<<: *variables-rare-with-basket-prod-openstack
<<: *variables-brc4env-prod-openstack
<<: *data-integration-openstack
only:
changes:
- data/rare/*.json.gz
- data/rare/suggestions/rare-with-basket_bulk*.json.gz
- data/rare/suggestions/brc4env_bulk*.json.gz
- scripts/*
refs:
- master
......
......@@ -102,7 +102,7 @@ Then run `yarn start` to start the app, using the proxy conf to reroute calls to
The application will be available on:
- <http://localhost:4000/rare-dev> for RARe (runs with: `yarn start:rare` or simply `yarn start`)
- <http://localhost:4000/rare-dev> for RARe with basket (runs with: `yarn start:rare-with-basket`)
- <http://localhost:4000/rare-dev> for RARe with basket (runs with: `yarn start:brc4env`)
- <http://localhost:4100/wheatis-dev> for WheatIS (runs with: `yarn start:wheatis`)
- <http://localhost:4200/data-discovery-dev> for DataDiscovery (runs with: `yarn start:data-discovery`)
......@@ -125,14 +125,14 @@ or
or
```sh
./gradlew assemble -Papp=rare-with-basket
./gradlew assemble -Papp=brc4env
```
This will build a standalone jar at `backend/build/libs/`, that you can run with either:
```sh
java -jar backend/build/libs/rare.jar
java -jar backend/build/libs/rare-with-basket.jar
java -jar backend/build/libs/brc4env.jar
java -jar backend/build/libs/wheatis.jar
java -jar backend/build/libs/data-discovery.jar
```
......@@ -142,7 +142,7 @@ And the full app running on:
- <http://localhost:8080/rare-dev>
- <http://localhost:8180/wheatis-dev>
- <http://localhost:8280/data-discovery-dev>
- <http://localhost:8580/rare-with-basket-dev>
- <http://localhost:8580/brc4env-dev>
## CI
......@@ -264,20 +264,20 @@ You can also run the backend WheatIS application using
To assemble the RARe app with support for adding accessions to a basket, run the following command
```sh
./gradlew assemble -Papp=rare-with-basket
./gradlew assemble -Papp=brc4env
```
You can also run the backend RARe application with basket support using
```sh
./gradlew bootRun -Papp=rare-with-basket
./gradlew bootRun -Papp=brc4env
```
Adding this property has the following consequences:
- the generated jar file (in `backend/build/libs`) is named `wheatis.jar` (resp. `rare-with-basket.jar` instead of `rare.jar`;
- the Spring active profile in `bootstrap.yml` is `wheatis-app` (resp. `rare-with-basket-app`) instead of `rare-app`;
- the frontend application built and embedded inside the jar file is the WheatIS frontend application (resp. the RARe application with basket support) instead of the RARe frontend application, i.e. the frontend command `yarn build:wheatis` (resp. `yarn build:rare-with-basket`) is executed instead of the command `yarn:rare`.
- the generated jar file (in `backend/build/libs`) is named `wheatis.jar` (resp. `brc4env.jar` instead of `rare.jar`;
- the Spring active profile in `bootstrap.yml` is `wheatis-app` (resp. `brc4env-app`) instead of `rare-app`;
- the frontend application built and embedded inside the jar file is the WheatIS frontend application (resp. the RARe application with basket support) instead of the RARe frontend application, i.e. the frontend command `yarn build:wheatis` (resp. `yarn build:brc4env`) is executed instead of the command `yarn:rare`.
Since the active Spring profile is different, all the properties specific to this profile
are applied. In particular:
......
......@@ -9,7 +9,7 @@ package fr.inra.urgi.datadiscovery.config;
public final class AppProfile {
public static final String RARE = "rare-app";
public static final String RARE_WITH_BASKET = "rare-with-basket-app";
public static final String BRC4ENV = "brc4env-app";
public static final String WHEATIS = "wheatis-app";
public static final String DATADISCOVERY = "data-discovery-app";
......
......@@ -8,7 +8,7 @@ import fr.inra.urgi.datadiscovery.dao.rare.RareImplicitAggregation;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Profile;
@Profile({AppProfile.RARE, AppProfile.RARE_WITH_BASKET})
@Profile({AppProfile.RARE, AppProfile.BRC4ENV})
@ConfigurationProperties(prefix = "rare")
public class RareImplicitRefinementsProperties {
private Map<RareImplicitAggregation, Set<String>> implicitTerms = new HashMap<>();
......
......@@ -17,7 +17,7 @@ import org.springframework.stereotype.Component;
* @author JB Nizet
*/
@Component
@Profile({AppProfile.RARE, AppProfile.RARE_WITH_BASKET})
@Profile({AppProfile.RARE, AppProfile.BRC4ENV})
public class RareAggregationAnalyzer implements AggregationAnalyzer {
private static final List<AppAggregation> AGGREGATIONS =
Collections.unmodifiableList(Arrays.asList(RareAggregation.values()));
......
......@@ -9,7 +9,7 @@ import org.springframework.context.annotation.Profile;
/**
* DAO for {@link RareDocument}
*/
@Profile({AppProfile.RARE, AppProfile.RARE_WITH_BASKET})
@Profile({AppProfile.RARE, AppProfile.BRC4ENV})
public interface RareDocumentDao
extends DocumentDao<RareDocument, RareIndexedDocument>, RareDocumentDaoCustom {
}
......@@ -48,7 +48,6 @@ spring:
data-discovery:
elasticsearch-prefix: 'rare-dev-'
resource-dir: /tmp/rare-dev/resources
server:
port: 8080
......@@ -57,28 +56,27 @@ server:
---
spring:
profiles: rare-with-basket-app
cloud.config.name: rare-with-basket
profiles: brc4env-app
cloud.config.name: brc4env
security.user:
name: rare
password: f01a7031fc17
## Below properties should not be enabled here because it makes tests failing.
## But they may be enabled in cloud-config server if relevant to apply the
## filter (for rare-with-basket) or not (for main rare application)
## filter (for brc4env) or not (for main rare application)
# rare:
# implicit-terms:
# PILLAR:
# - Pilier Environnement
data-discovery:
elasticsearch-prefix: 'rare-with-basket-dev-'
resource-dir: /tmp/rare-dev/resources
elasticsearch-prefix: 'brc4env-dev-'
server:
port: 8580
servlet:
context-path: /rare-with-basket-dev
context-path: /brc4env-dev
---
spring:
......@@ -90,7 +88,6 @@ spring:
data-discovery:
elasticsearch-prefix: 'wheatis-dev-'
resource-dir: /tmp/wheatis-dev/resources
server:
port: 8180
......@@ -107,7 +104,6 @@ spring:
data-discovery:
elasticsearch-prefix: 'data-discovery-dev-'
resource-dir: /tmp/data-discovery-dev/resources
server:
port: 8280
......
......@@ -15,7 +15,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
@ExtendWith(SpringExtension.class)
@SpringBootTest
@TestPropertySource("/test-rare.properties")
@ActiveProfiles(AppProfile.RARE_WITH_BASKET)
@ActiveProfiles(AppProfile.BRC4ENV)
public class RareWithBasketApplicationTest {
@Test
public void shouldLoadContext() {}
......
......@@ -42,7 +42,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
@Import(ElasticSearchConfig.class)
@JsonTest
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@ActiveProfiles({AppProfile.RARE, AppProfile.RARE_WITH_BASKET})
@ActiveProfiles({AppProfile.RARE, AppProfile.BRC4ENV})
class RareDocumentDaoTest extends DocumentDaoTest {
private static final String PHYSICAL_INDEX = "test-rare-resource-physical-index";
......
......@@ -39,7 +39,7 @@ import org.springframework.test.context.junit.jupiter.SpringExtension;
@Import(ElasticSearchConfig.class)
@JsonTest
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@ActiveProfiles({AppProfile.RARE, AppProfile.RARE_WITH_BASKET})
@ActiveProfiles({AppProfile.RARE, AppProfile.BRC4ENV})
class RareDocumentDaoWithImplicitTermsTest extends DocumentDaoTest {
private static final String PHYSICAL_INDEX = "test-rare-resource-physical-index";
......
import org.gradle.api.*
private val acceptableValues = setOf("rare", "rare-with-basket", "wheatis", "data-discovery")
private val acceptableValues = setOf("rare", "brc4env", "wheatis", "data-discovery")
val Project.app: String
get() = findProperty("app")
......
......@@ -112,7 +112,7 @@
}
]
},
"rare-with-basket": {
"brc4env": {
"budgets": [
{
"type": "anyComponentStyle",
......@@ -122,7 +122,7 @@
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.rare-with-basket.ts"
"with": "src/environments/environment.brc4env.ts"
},
{
"replace": "src/assets/rare/band.jpg",
......@@ -133,13 +133,13 @@
"with": "src/environments/rare-with-basket.ts"
}
],
"baseHref": "/rare-with-basket-dev/"
"baseHref": "/brc4env-dev/"
},
"rare-with-basket-production": {
"brc4env-production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.rare-with-basket.prod.ts"
"with": "src/environments/environment.brc4env.prod.ts"
},
{
"replace": "src/assets/rare/band.jpg",
......@@ -319,11 +319,11 @@
"rare-production": {
"browserTarget": "data-discovery-frontend:build:rare-production"
},
"rare-with-basket": {
"browserTarget": "data-discovery-frontend:build:rare-with-basket"
"brc4env": {
"browserTarget": "data-discovery-frontend:build:brc4env"
},
"rare-with-basket-production": {
"browserTarget": "data-discovery-frontend:build:rare-with-basket-production"
"brc4env-production": {
"browserTarget": "data-discovery-frontend:build:brc4env-production"
},
"wheatis": {
"browserTarget": "data-discovery-frontend:build:wheatis"
......
......@@ -5,13 +5,13 @@
"ng": "ng",
"start": "ng serve --configuration=rare --port=4000",
"start:rare": "ng serve --configuration=rare --port=4000",
"start:rare-with-basket": "ng serve --configuration=rare-with-basket --port=4000",
"start:brc4env": "ng serve --configuration=brc4env --port=4000",
"start:wheatis": "ng serve --configuration=wheatis --port=4100",
"start:wheatis-production": "ng serve --configuration=wheatis-production --port=4101",
"start:data-discovery": "ng serve --configuration=data-discovery --port=4200",
"build": "ng build --configuration=rare-production --no-progress",
"build:rare": "ng build --configuration=rare-production --no-progress",
"build:rare-with-basket": "ng build --configuration=rare-with-basket-production --no-progress",
"build:brc4env": "ng build --configuration=brc4env-production --no-progress",
"build:wheatis": "ng build --configuration=wheatis-production --no-progress",
"build:data-discovery": "ng build --configuration=data-discovery-production --no-progress",
"test": "ng test --code-coverage --no-progress --no-watch",
......
......@@ -25,8 +25,8 @@ const PROXY_CONFIG = [
},
{
context: [
"/rare-with-basket-dev/api",
"/rare-with-basket-dev/actuator"
"/brc4env-dev/api",
"/brc4env-dev/actuator"
],
target: "http://localhost:8580",
secure: false
......
......@@ -2,10 +2,10 @@
* Configuration variables for RARe Basket.
* This contains the configuration for production.
* This file is only used by the RARe version (without basket) of the application.
* It replaces rare-with-basket.ts when the application is built with the rare-with-basket + production configuration.
* It replaces rare-with-basket.ts when the application is built with the brc4env + production configuration.
* See angular.json for more details.
*/
export const rareBasket = {
isBasketEnabled: true,
url: 'https://beta-urgi.versailles.inrae.fr/rare-basket/' // TODO update to proper URL for production
url: 'https://urgi.versailles.inrae.fr/rare-basket'
};
......@@ -8,5 +8,5 @@
*/
export const rareBasket = {
isBasketEnabled: true,
url: 'http://localhost:4201/rare-basket' // TODO update to proper URL
url: 'http://localhost:4201/rare-basket'
};
......@@ -91,7 +91,7 @@ DATE_TMSTP=$(${DATE_CMD} -d @${TIMESTAMP})
echo "Using timestamp corresponding to date: ${DATE_TMSTP}"
TMP_FILE=$(mktemp)
if [ "${APP_NAME}" == "rare-with-basket" ]; then
if [ "${APP_NAME}" == "brc4env" ]; then
APP_SETTINGS_NAME="rare"
else
APP_SETTINGS_NAME="${APP_NAME}"
......
......@@ -99,7 +99,7 @@ RARE_FIELDS_TO_EXTRACT=".pillar , .databaseSource , .name , .domain, .taxon, .fa
if [ "${APP_NAME}" == "rare" ] ; then
FIELDS_TO_EXTRACT="${RARE_FIELDS_TO_EXTRACT}"
elif [ "${APP_NAME}" == "rare-with-basket" ]; then
elif [ "${APP_NAME}" == "brc4env" ]; then
FIELDS_TO_EXTRACT="${RARE_FIELDS_TO_EXTRACT}"
FILTER_DATA_SCRIPT="${BRC4ENV_FILTER_DATA_SCRIPT}"
DATADIR=$(readlink -f "$BASEDIR/../data/rare")
......@@ -108,7 +108,7 @@ elif [ "${APP_NAME}" == "wheatis" ]; then
elif [ "${APP_NAME}" == "data-discovery" ]; then
FIELDS_TO_EXTRACT="${WHEATIS_FIELDS_TO_EXTRACT}"
else
echo -e "${RED_BOLD}ERROR: app value is invalid, please specify one among following: ${GREEN}rare${RED}, ${GREEN}rare-with-basket${RED}, ${GREEN}wheatis${RED}, or ${GREEN}data-discovery${RED}.${NC}" && help && exit 5
echo -e "${RED_BOLD}ERROR: app value is invalid, please specify one among following: ${GREEN}rare${RED}, ${GREEN}brc4env${RED}, ${GREEN}wheatis${RED}, or ${GREEN}data-discovery${RED}.${NC}" && help && exit 5
fi
[ ! -d "${DATADIR}/suggestions" ] && echo "Creating missing directory:" && mkdir -v "${DATADIR}/suggestions"
......@@ -116,7 +116,7 @@ fi
export FILTER_DATA_SCRIPT FIELDS_TO_EXTRACT
extract_suggestions() {
bash -c "set -o pipefail; gunzip -c $1 | # jq below add a filter on some data if needed (noop by default, or only brc4env pillar for rare-with-basket)
bash -c "set -o pipefail; gunzip -c $1 | # jq below add a filter on some data if needed (noop by default, or only brc4env pillar for brc4env)
jq -rc -f ${FILTER_DATA_SCRIPT} | # tee below allows to redirect previous gunzip stdout to several processes using: >(subprocess)
tee \
>(
......
Supports Markdown
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