Skip to content

Commit

Permalink
Merge branch '2.3.0.release' ci_latest
Browse files Browse the repository at this point in the history
  • Loading branch information
vlo-rte committed Apr 6, 2021
2 parents ba60327 + 64fcac7 commit f281463
Show file tree
Hide file tree
Showing 487 changed files with 6,516 additions and 7,083 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,11 @@ config/docker/businessconfig-storage/**

# now script generated
config/dev/nginx.conf

# MacOS metadata files
**/.DS_Store

# Cypress
src/test/cypress/node_modules
src/test/cypress/package-lock.json

23 changes: 18 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,28 @@ jobs:
script:
- docker login --username ${DOCKER_CLOUD_USER} --password ${DOCKER_CLOUD_PWD}
- docker-compose -f src/main/docker/test-environment/docker-compose.yml up -d
- ./gradlew --build-cache copyDependencies test jacocoTestReport
- ./gradlew --build-cache copyDependencies test jacocoTestReport dockerTag${OF_VERSION}
# [OC-865] Dropping dependency messing with typescript version as a workaround until sonar bug is fixed
# See https://github.com/SonarSource/SonarJS/issues/1928 and https://community.sonarsource.com/t/error-about-unsupported-ts-version-while-project-is-using-supported-version/15776
- rm -r ui/main/node_modules/@compodoc/ngd-core
- rm -r ui/main/node_modules/ts-simple-ast
- sonar-scanner
- docker-compose -f src/main/docker/test-environment/docker-compose.yml down
- cd config/docker
- ./docker-compose.sh
- cd ../../src/test/api/karate
- ./waitForOpfabToStart.sh
- ./launchAll.sh
- cd ../../../../config/docker
- docker-compose down
- stage: doc
script:
- ./gradlew --build-cache generateSwaggerUI asciidoctor
- ./CICD/travis/upload_doc.sh
- stage: doc-latest
script:
- ./gradlew --build-cache generateSwaggerUI asciidoctor
- ./CICD/travis/upload_doc.sh --updateLatest true
- stage: doc-dry-run
script:
- ./gradlew --build-cache generateSwaggerUI asciidoctor
Expand Down Expand Up @@ -106,13 +117,15 @@ stages:
- name: test-sonar
if: NOT (type = pull_request AND head_repo != opfab/operatorfabric-core)
- name: doc
if: ((((type = cron OR commit_message =~ ci_documentation) AND branch = develop) OR branch = master) AND NOT type = pull_request)
if: ((((type = cron OR commit_message =~ ci_documentation) AND branch = develop) OR (commit_message =~ ci_documentation AND NOT commit_message =~ ci_latest AND branch =~ .+hotfixes$)) AND NOT type = pull_request)
- name: doc-latest
if: (branch = master OR (branch =~ .+hotfixes$ AND commit_message =~ ci_latest)) AND NOT type = pull_request
- name: doc-dry-run
if: (branch =~ .+release$) OR (NOT (branch IN (master,develop)) AND commit_message =~ ci_documentation)
if: (NOT branch =~ .+hotfixes$) AND (NOT (branch IN (master,develop)) AND commit_message =~ ci_documentation)
- name: docker-push-version
if: (((type = cron OR commit_message =~ ci_docker) AND branch = develop) OR branch = master) AND NOT type = pull_request
if: (((type = cron OR commit_message =~ ci_docker) AND (branch = develop OR branch =~ .+hotfixes$)) OR branch = master) AND NOT type = pull_request
- name: docker-push-latest
if: branch = master AND commit_message =~ ci_latest AND NOT type = pull_request
if: branch = master OR (branch =~ .+hotfixes$ AND commit_message =~ ci_latest) AND NOT type = pull_request
- name: docker-tag-version
if: (branch =~ .+release$) OR (NOT (branch IN (master,develop)) AND commit_message =~ ci_docker)
before_cache:
Expand Down
13 changes: 9 additions & 4 deletions CICD/travis/check_version.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# Copyright (c) 2018-2020, RTE (http://www.rte-france.com)
# Copyright (c) 2018-2021, RTE (http://www.rte-france.com)
# See AUTHORS.txt
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
Expand All @@ -15,7 +15,7 @@ display_usage() {
echo -e "\tcheck_version.sh [OPTIONS] \n"
echo -e "options:\n"
echo -e "\t-b, --branch : string. Branch on which Travis is running the build"
echo -e "\t-b, --version : string. Version set for current repository state"
echo -e "\t-v, --version : string. Version set for current repository state"
}

# Read parameters
Expand Down Expand Up @@ -58,11 +58,16 @@ fi

echo "check_version: branch $branch, version $version"

minor_version_pattern='([0-9]+\.[0-9]+)'
if [[ $branch =~ $minor_version_pattern\.hotfixes$ ]] ; then
minor_version=${BASH_REMATCH[1]}
[[ $version =~ $minor_version\.[0-9]+\.RELEASE$ ]] && exit 0 || echo "check_version failed: for hotfixes branch $branch version should be $minor_version.X.RELEASE."; exit 1;
fi

[[ $branch == 'develop' ]] && { [[ $version == 'SNAPSHOT' ]] && exit 0 || echo "check_version failed: for branch develop version should be SNAPSHOT."; exit 1;}
[[ $branch == 'master' ]] && { [[ $version =~ [0-9]+\.[0-9]+\.[0-9]+\.RELEASE$ ]] && exit 0 || echo "check_version failed: for branch master version should be X.X.X.RELEASE."; exit 1;}
[[ $branch =~ [0-9]+\.[0-9]+\.[0-9]+\.release$ ]] && { [[ $version == ${branch^^} ]] && exit 0 || echo "check_version failed: for release branch $branch version should be ${branch^^}."; exit 1;}
[[ $branch =~ OC-.+$ ]] && { [[ $version == 'SNAPSHOT' ]] && exit 0 || echo "check_version failed: for feature branches version should be SNAPSHOT."; exit 1;}
[[ $branch =~ HF_OC-.+$ ]] && { [[ $version =~ [0-9]+\.[0-9]+\.[0-9]+\.RELEASE$ ]] && exit 0 || echo "check_version failed: for hotfix branches version should be X.X.X.RELEASE."; exit 1;}
[[ $branch =~ OC-.+$ ]] && { [[ $version == 'SNAPSHOT' || $version =~ [0-9]+\.[0-9]+\.[0-9]+\.RELEASE$ ]] && exit 0 || echo "check_version failed: for feature branches version should be SNAPSHOT or X.X.X.RELEASE."; exit 1;}

echo "check_version failed: unhandled branch type"
exit 1;
41 changes: 39 additions & 2 deletions CICD/travis/upload_doc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,39 @@

. ${BASH_SOURCE%/*}/../../bin/load_variables.sh

updateLatest=false

display_usage() {
echo "This script gets the documentation from the website in its current state, "
echo -e "Usage:\n"
echo -e "\tcheck_version.sh [OPTIONS] \n"
echo -e "options:\n"
echo -e "\t-b, --commitMessage : boolean. If set to true, the script also updates the latest documentation (found under current in the website). Defaults to $updateLatest\n"
}

# Read parameters
while [[ $# -gt 0 ]]
do
key="$1"
# echo $key
case $key in
-u|--updateLatest)
updateLatest="$2"
shift # past argument
shift # past value
;;
-h|--help)
shift # past argument
display_usage
exit 0
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done

CURRENT_PATH=$(pwd)
GH_REPO=github.com/opfab/opfab.github.io.git
HTTP_REPO="https://opfabtech:${GH_DOC_TOKEN}@${GH_REPO}"
Expand All @@ -28,8 +61,10 @@ fi
if [[ $OF_VERSION =~ .+RELEASE$ ]]; then
# Clear existing documentation in archive for current version
rm -r $HOME/documentation/documentation/archives/$OF_VERSION/*
# Update current documentation
rm -r $HOME/documentation/documentation/current/*

# If updateLatest is true, update current documentation
if [[ $updateLatest = true ]]; then
rm -r $HOME/documentation/documentation/current/*
# Copy API documentation for each component
for prj in "${OF_CLIENT_REL_COMPONENTS[@]}"; do
echo "copying $prj documentation"
Expand All @@ -39,6 +74,8 @@ if [[ $OF_VERSION =~ .+RELEASE$ ]]; then
# Copy asciidoctor documentation (including images)
mkdir -p $HOME/documentation/documentation/current/
cp -r $OF_HOME/build/asciidoc/html5/* $HOME/documentation/documentation/current/
fi

fi

# For archives
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.0.RELEASE
2.3.0.RELEASE
2 changes: 1 addition & 1 deletion bin/add_header.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ echo -e "\n"
findCommand+="! -path \"$OF_HOME/services/core/businessconfig/src/test/data/bundles/*\" "
findCommand+="-and ! -path \"$OF_HOME/services/core/businessconfig/src/main/docker/volume/businessconfig-storage/*\" "
findCommand+="-and ! -path \"$OF_HOME/services/core/businessconfig/src/test/docker/volume/businessconfig-storage/*\" "
findCommand+="-and ! -path \"$OF_HOME/src/test/utils/karate/businessconfig/resources/*\" "
findCommand+="-and ! -path \"$OF_HOME/src/test/resources/*\" "

#Exclude generated folders from ui
findCommand+="-and ! -path \"$OF_HOME/ui/main/build/*\" "
Expand Down
4 changes: 2 additions & 2 deletions bin/load_environment_light.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

source ${BASH_SOURCE%/*}/load_variables.sh

sdk install gradle 6.5.1
sdk use gradle 6.5.1
sdk install gradle 6.8.3
sdk use gradle 6.8.3
# the java version is externalized because also needed for travis configuration
sdk install java $(<JAVA_VERSION)-zulu
sdk use java $(<JAVA_VERSION)-zulu
Expand Down
12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import com.github.jk1.license.render.*
plugins {
id "com.github.jk1.dependency-license-report" version "1.6"
id "com.github.jk1.dependency-license-report" version "1.16"
id "com.moowork.node" version "1.2.0"
id "org.asciidoctor.convert" version "1.5.10"
id "org.asciidoctor.convert" version "2.4.0"
id "maven-publish"
id "signing"
id "org.owasp.dependencycheck" version "5.2.0"
id "org.owasp.dependencycheck" version "6.1.5"
id 'org.springframework.boot' version '2.4.0-M1'
id 'org.sonarqube' version '3.0' apply false
id 'org.sonarqube' version '3.1.1' apply false
}

ext.versions = new Properties()
Expand Down Expand Up @@ -81,8 +81,6 @@ ext {
swagger : "io.swagger:swagger-codegen-cli:${versions['swagger']}",
swaggerGeneratorPlugin : "gradle.plugin.org.hidetake:gradle-swagger-generator-plugin:${versions['swagger.generator.plugin']}",
swaggerUI : "org.webjars:swagger-ui:${versions['swaggerUI']}",
springfoxSwagger2 : "io.springfox:springfox-swagger2:${versions['springfox']}",
springfoxSwaggerUI : "io.springfox:springfox-swagger-ui:${versions['springfox']}"
]

plugin = [
Expand Down Expand Up @@ -197,5 +195,5 @@ tasks.withType(JavaCompile) {
}

wrapper {
gradleVersion = '6.5.1'
gradleVersion = '6.8.3'
}
11 changes: 0 additions & 11 deletions client/actions/build.gradle

This file was deleted.

This file was deleted.

This file was deleted.

19 changes: 0 additions & 19 deletions client/actions/src/main/modeling/config.json

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion client/businessconfig/src/main/modeling/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
"singleContentTypes": false,
"importMappings" : {
"AcknowledgmentAllowedEnum": "org.lfenergy.operatorfabric.businessconfig.model.AcknowledgmentAllowedEnum",
"ActionEnum": "org.lfenergy.operatorfabric.businessconfig.model.ActionEnum",
"ResponseBtnColorEnum": "org.lfenergy.operatorfabric.businessconfig.model.ResponseBtnColorEnum",
"LinkTypeEnum": "org.lfenergy.operatorfabric.businessconfig.model.LinkTypeEnum",
"TypeOfStateEnum": "org.lfenergy.operatorfabric.businessconfig.model.TypeOfStateEnum",
Expand Down
2 changes: 0 additions & 2 deletions client/cards/src/main/modeling/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
"importMappings": {
"CardOperationTypeEnum": "org.lfenergy.operatorfabric.cards.model.CardOperationTypeEnum",
"SeverityEnum": "org.lfenergy.operatorfabric.cards.model.SeverityEnum",
"ActionEnum": "org.lfenergy.operatorfabric.cards.model.ActionEnum",
"InputEnum": "org.lfenergy.operatorfabric.cards.model.InputEnum",
"TitlePositionEnum": "org.lfenergy.operatorfabric.cards.model.TitlePositionEnum",
"RecipientEnum": "org.lfenergy.operatorfabric.cards.model.RecipientEnum",
"EpochDate": "java.time.Instant",
"PublisherTypeEnum": "org.lfenergy.operatorfabric.cards.model.PublisherTypeEnum"
Expand Down
Loading

0 comments on commit f281463

Please sign in to comment.