From dcccbc432b741b0512e47b7bfca788f3fca83037 Mon Sep 17 00:00:00 2001 From: Rob Court Date: Mon, 5 Aug 2019 13:37:33 +0100 Subject: [PATCH 1/6] adding build type --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 250bd8709..f5258b2d7 100755 --- a/.travis.yml +++ b/.travis.yml @@ -12,6 +12,9 @@ env: - secure: nG+5a2LvKsXfLGwIG3hqEqQOhMvsLdB4N0pQ5Oq47vLKkQLQMO9RvUn9fSArYy4nVJKOSHiSEuEyFFCN84XBSjK5c+VuRyucrcph7myufhMLogVhlbjuuoTg5EESLGfQ5d/cbQ2YKSfLwETG9eoNCElGyu39FP1KmmVVk2CVaB9Tkvd/pIXx98oR1QuQOWQgNj3h6EFZbQOOmCnrFD+gtHq4yWeu2/eUg+8GcgpXkFYPpyeHPkoorrGsu8EfgyObVO8moFnKTrtpJmg886yXV5BpMwMEv8LKLxjTwSJX29rhf1uZkXNlCrF9zvfQ6iQ05gWDbsf+Ttio3CSVqCIudfez/ZC/uJ4qS/ZGFlOE/Dc4ulE/UBKQE9vE5EWlsJjoZRlTePlNJ1jrhezuJRISXVo7wQUGUtXiI7t3ko5PUO/Kc/UWBKQPZVU0AXwgkrXsXJFTaGSkBMf07OolHjI5v7/QdGctI/pmnox3l1IHr2Wq+3iAhPzyUL6aPQPS/ClYZTqTSCTTXCdQPWVkfkw4AnNuaNdQC7HkpsLRJ47G5XNVoGJIGvFevhSc1Pjy/fT51sh6Lznzc0rsDirFoXGAkWtibszuTHjzN9pGISXLzSqTe6fIYQYM22bO0FApwqdCrSc4TsTFTJCJIPyABlhj5vfaLmplPb2U3z8Q5eQ+wwU= - secure: MgVs6eMaOJwmSVQlTjHRE1rDNJftnDpytewRnZF+0kTVwzTM02/UQm9eNB2nNSBCzGbAj4YhrXPkt9d+kJ4o7MfFhgD2MNnIC7wZQQQxgHC0rZLAll8HdvcaiaGVofMzuzJL6CPvFeA5sNBmzF7aoy89vrxxBTm+AUqLrqZztcG0H5FcxCc+l4oGPxzXykascJUEHdEgnRx6me4BNnDLj+K+xh1zWQEHwc2b6Mux06uZzcBm9IRhp/01W+FDlsgAuuD7wZ997I+YgrfRMhilTjOK58Ao21rqUFICb63Uk14yDcMQhUaGXj4QPkSdWiEgzG3egcq32iegG4PI5/Fuwlr2xtNaNrS+UzZy4JN/vuXjJqEUzeqdsttgwBF915duRqfFUGJFRyCMjpqE5qDfIG78th/dwL0NxAlz+mV71jf3qkVXeWtLMTsKWR2XZVDw9Fd6VWYkhLBoUaomtJi+H1Gq6ShIPCnvm16P7rMEtQ5g/ayUjExzfr1tybdLGr7oV+qEqcToUpiB4I69vYe+PrUVHen0j9RgGMRBXxBBpnPKdj42HS3jGb9w74BNUjNKenNJnaiuLWxtZ8M1pJecOf4n5Ip5DiljGOJ4IqMF/Oaox16WbAa2FI7RJU0hXKMbaic1DGyYzPihLXvH/Vx0l5E4VeVVCogwwwz9QV/NzzE= - COMMIT=${TRAVIS_COMMIT::8} + matrix: + - BUILD_TYPE=production + - BUILD_TYPE=development services: - docker before_install: @@ -25,7 +28,7 @@ before_script: script: - echo -e "travis_fold:start:Docker_Build" || true - export BRANCH=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then echo $TRAVIS_BRANCH; else echo $TRAVIS_PULL_REQUEST_BRANCH; fi) - - travis_retry docker build --cache-from metacell/java-virgo-maven:development -t=$REPO:$TAG --build-arg targetBranch=$TRAVIS_BRANCH --build-arg originBranch=$BRANCH --build-arg defaultBranch=$DEFAULT_BRANCH $DOCKER_FOLDER || travis_terminate 1 + - travis_retry docker build --cache-from metacell/java-virgo-maven:development -t=$REPO:$TAG --build-arg build_type=$BUILD_TYPE --build-arg targetBranch=$TRAVIS_BRANCH --build-arg originBranch=$BRANCH --build-arg defaultBranch=$DEFAULT_BRANCH $DOCKER_FOLDER || travis_terminate 1 - echo -e "travis_fold:end:Docker_Build" || true - echo -e "travis_fold:start:Docker_Run" || true - travis_retry docker run -t -dit --name=$CONTAINER_NAME -p 8080:8080 $REPO:$TAG || travis_terminate 1 From fafa4a0f256f9de21b0c22585565b483ce00b4c1 Mon Sep 17 00:00:00 2001 From: Rob Court Date: Mon, 5 Aug 2019 13:52:28 +0100 Subject: [PATCH 2/6] enabling debug --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index aaf284844..c2ab2d216 100755 --- a/Dockerfile +++ b/Dockerfile @@ -6,6 +6,8 @@ ARG targetBranch=development ARG originBranch=development ARG defaultBranch=development +ARG build_type=production + ARG googleAnalyticsSiteCode=UA-45841517-1 ENV VFB_PDB_SERVER=http://pdb.virtualflybrain.org @@ -49,8 +51,12 @@ RUN ../copy.sh https://github.com/openworm/org.geppetto.datasources.git "${targe mvn -Dhttps.protocols=TLSv1.2 -DskipTests --quiet install &&\ rm -rf src -RUN ../copy.sh https://github.com/VirtualFlyBrain/uk.ac.vfb.geppetto.git "${targetBranch}" "${originBranch}" "${defaultBranch}" &&\ - cd uk.ac.vfb.geppetto &&\ +RUN ../copy.sh https://github.com/VirtualFlyBrain/uk.ac.vfb.geppetto.git "${targetBranch}" "${originBranch}" "${defaultBranch}" + +RUN export DEBUG=false; if [ "$build_type" == "development" ]; then export DEBUG=true; fi && \ + /bin/grep -rls "Boolean debug=" $HOME/workspace/uk.ac.vfb.geppetto/src/ | xargs /bin/sed -i "s@Boolean debug=.*;@Boolean debug=$DEBUG;@g" + +RUN cd uk.ac.vfb.geppetto &&\ /bin/echo -e "\e[96mMaven install uk.ac.vfb.geppetto\e[0m" &&\ mvn -Dhttps.protocols=TLSv1.2 -DskipTests --quiet install &&\ rm -rf src From 3e15201f723b4daa85a8deeeaafe09e4551284f2 Mon Sep 17 00:00:00 2001 From: Rob Court Date: Mon, 5 Aug 2019 13:59:00 +0100 Subject: [PATCH 3/6] adding -development sub tag --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f5258b2d7..6ea689569 100755 --- a/.travis.yml +++ b/.travis.yml @@ -20,7 +20,8 @@ services: before_install: - export VFB_REPO=$(echo ${TRAVIS_REPO_SLUG##*/} | awk '{gsub(/\-/,"_",$0);gsub(/\./,"_",$0);print toupper($0)}') - export REPO=$(echo ${TRAVIS_REPO_SLUG} | awk '{gsub(/\./,"_",$0);print tolower($0)}') - - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo ${TRAVIS_BRANCH/\//-} ; fi` + - export TAG=`if [ "$TRAVIS_BRANCH" == "master" ]; then echo "latest"; else echo ${TRAVIS_BRANCH/\//-}; fi` + - export TAG=`if [ "$BUILD_TYPE" == "development" ]; then echo "$TAG-development"; else echo "$TAG"; fi` install: - npm install jest@24.8.0 puppeteer@1.17.0 jest-puppeteer@3.9.0 babel-preset-env@1.6.0 url-join@4.0.0 before_script: From ce5404bff52852e4978ea721f91f850b63dafc72 Mon Sep 17 00:00:00 2001 From: Rob Court Date: Mon, 5 Aug 2019 15:40:37 +0100 Subject: [PATCH 4/6] sh syntax fix --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index c2ab2d216..126c82417 100755 --- a/Dockerfile +++ b/Dockerfile @@ -53,7 +53,7 @@ RUN ../copy.sh https://github.com/openworm/org.geppetto.datasources.git "${targe RUN ../copy.sh https://github.com/VirtualFlyBrain/uk.ac.vfb.geppetto.git "${targetBranch}" "${originBranch}" "${defaultBranch}" -RUN export DEBUG=false; if [ "$build_type" == "development" ]; then export DEBUG=true; fi && \ +RUN export DEBUG=false; if test "$build_type" = "development" ; then export DEBUG=true; fi && \ /bin/grep -rls "Boolean debug=" $HOME/workspace/uk.ac.vfb.geppetto/src/ | xargs /bin/sed -i "s@Boolean debug=.*;@Boolean debug=$DEBUG;@g" RUN cd uk.ac.vfb.geppetto &&\ From 6c2df15e295eff39617ef98ea29172ffc97795a8 Mon Sep 17 00:00:00 2001 From: Rob Court Date: Mon, 5 Aug 2019 16:34:20 +0100 Subject: [PATCH 5/6] assing exclusion field --- components/VFBMain.js | 1 + components/interface/VFBTermInfo.js | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/components/VFBMain.js b/components/VFBMain.js index 2c134d323..f7a2d1093 100644 --- a/components/VFBMain.js +++ b/components/VFBMain.js @@ -858,6 +858,7 @@ export default class VFBMain extends React.Component { showButtonBar={true} termInfoName={this.termInfoName} termInfoId={this.termInfoId} + exclude={["ClassQueriesFrom"]} order={['Name', 'Label', 'Alternative Names', diff --git a/components/interface/VFBTermInfo.js b/components/interface/VFBTermInfo.js index 179db0c15..cd638dded 100644 --- a/components/interface/VFBTermInfo.js +++ b/components/interface/VFBTermInfo.js @@ -396,6 +396,15 @@ class VFBTermInfo extends React.Component { this.contentBackup.keys = this.contentTermInfo.keys.slice(); this.contentBackup.values = this.contentTermInfo.values.slice(); var tempArray = []; + if ((this.props.exclude !== undefined ) && (this.props.exclude.length > 0)) { + for (var x = 0; x < this.props.exclude.length; x++) { + var index = this.contentTermInfo.keys.indexOf(this.props.exclude[x]); + if (index > -1) { + this.contentTermInfo.keys.splice(index, 1); + this.contentTermInfo.values.splice(index, 1); + } + } + } for (var x = 0; x < this.props.order.length; x++) { var index = this.contentTermInfo.keys.indexOf(this.props.order[x]); if (index > -1) { @@ -796,6 +805,7 @@ export default class VFBTermInfoWidget extends React.Component { id={this.idWidget} ref="termInfoRef" order={this.props.order} + exclude={this.props.exclude} closeHandler={this.closeHandler} customHandler={this.customHandler} showButtonBar={this.props.showButtonBar} From 76967c45f10d50032ff1fcc8874df53a8935486d Mon Sep 17 00:00:00 2001 From: Rob Court Date: Mon, 5 Aug 2019 17:17:53 +0100 Subject: [PATCH 6/6] hiding Debug from normal view --- components/VFBMain.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/VFBMain.js b/components/VFBMain.js index f7a2d1093..3906c13e6 100644 --- a/components/VFBMain.js +++ b/components/VFBMain.js @@ -858,7 +858,7 @@ export default class VFBMain extends React.Component { showButtonBar={true} termInfoName={this.termInfoName} termInfoId={this.termInfoId} - exclude={["ClassQueriesFrom"]} + exclude={["ClassQueriesFrom", "Debug"]} order={['Name', 'Label', 'Alternative Names',