Skip to content
Snippets Groups Projects
Commit 9ef0a24a authored by Ludovic Claude's avatar Ludovic Claude
Browse files

Modernise release management

parent 5b2012eb
No related branches found
No related tags found
No related merge requests found
Showing
with 306 additions and 68 deletions
[bumpversion]
current_version = 2.0.0
commit = True
tag = True
tag_name = {new_version}
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)-(?P<package>\d+)
serialize = {major}.{minor}.{patch}-{package}
[bumpversion:file:pom.xml]
search = <version>{current_version}</version><!-- BUMP_VERSION -->
[bumpversion:file:Dockerfile]
[bumpversion:file:hbp.yml]
- repo: git://github.com/pre-commit/pre-commit-hooks
sha: v0.7.1
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-merge-conflict
- id: check-added-large-files
- id: check-yaml
FROM java:openjdk-8u92-jdk-alpine FROM openjdk:8u121-jre-alpine
MAINTAINER Mirco Nasuti <mirco.nasuti@chuv.ch>
MAINTAINER mirco.nasuti@chuv.ch ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
ENV DOCKERIZE_VERSION=v0.2.0 ENV DOCKERIZE_VERSION=v0.4.0
RUN apk add --update ca-certificates wget \ RUN apk add --update ca-certificates wget \
&& rm -rf /var/cache/apk/* /tmp/* \
&& update-ca-certificates \ && update-ca-certificates \
&& wget -O /tmp/dockerize.tar.gz https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz \ && wget -O /tmp/dockerize.tar.gz https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-${DOCKERIZE_VERSION}.tar.gz \
&& tar -C /usr/local/bin -xzvf /tmp/dockerize.tar.gz \ && tar -C /usr/local/bin -xzvf /tmp/dockerize.tar.gz \
&& rm -rf /tmp/dockerize.tar.gz && rm -rf /var/cache/apk/* /tmp/*
COPY docker/runner/config/application.tmpl /config/application.tmpl COPY docker/runner/config/application.tmpl /config/application.tmpl
COPY docker/runner/README.md docker/runner/run.sh / COPY docker/runner/README.md docker/runner/run.sh /
ENV PORTAL_BACKEND_VERSION=1.1 ENV PORTAL_BACKEND_VERSION=2.0.0
COPY target/portal-backend-$PORTAL_BACKEND_VERSION.jar backend.jar COPY target/portal-backend-$PORTAL_BACKEND_VERSION.jar backend.jar
# org.label-schema.build-date=$BUILD_DATE
# org.label-schema.vcs-ref=$VCS_REF
LABEL org.label-schema.schema-version="1.0" \
org.label-schema.license="AGPLv3" \
org.label-schema.name="portal-backend" \
org.label-schema.description="Java backend for the MIP portal" \
org.label-schema.url="https://mip.humanbrainproject.eu" \
org.label-schema.vcs-type="git" \
org.label-schema.vcs-url="https://github.com/LREN-CHUV/portal-backend" \
org.label-schema.vendor="LREN CHUV" \
org.label-schema.docker.dockerfile="Dockerfile" \
org.label-schema.memory-hint="2048"
EXPOSE 8080 EXPOSE 8080
CMD ["./run.sh"] ENTRYPOINT ["/run.sh"]
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="hbpmip/portal-backend" \
org.label-schema.description="Java backend for the MIP portal" \
org.label-schema.url="https://mip.humanbrainproject.eu" \
org.label-schema.vcs-type="git" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url="https://github.com/LREN-CHUV/portal-backend" \
org.label-schema.version="$VERSION" \
org.label-schema.vendor="LREN CHUV" \
org.label-schema.license="AGPLv3" \
org.label-schema.docker.dockerfile="Dockerfile" \
org.label-schema.memory-hint="2048" \
org.label-schema.schema-version="1.0"
Original developer’s Attribution Information
____________________________________________
Attribution Copyright Notice: © 2016-2017 LREN CHUV.
Attribution Phrase: Powered by the Medical Informatics Platform of the Human Brain Project
Attribution URL: https://mip.humanbrainproject.eu
All trademarks, service marks and/or trade names contained within the Attribution
Information distributed with the covered code are the exclusive property of their
owners and may only be used with the permission of their owners, or under
circumstances otherwise permitted by law or as expressly set out in this License.
---
GNU AFFERO GENERAL PUBLIC LICENSE GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007 Version 3, 19 November 2007
...@@ -65,7 +79,7 @@ License. ...@@ -65,7 +79,7 @@ License.
"Copyright" also means copyright-like laws that apply to other kinds "Copyright" also means copyright-like laws that apply to other kinds
of works, such as semiconductor masks. of works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this "The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations. "recipients" may be individuals or organizations.
...@@ -660,4 +674,3 @@ specific requirements. ...@@ -660,4 +674,3 @@ specific requirements.
if any, to sign a "copyright disclaimer" for the program, if necessary. if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU AGPL, see For more information on this, and how to apply and follow the GNU AGPL, see
<http://www.gnu.org/licenses/>. <http://www.gnu.org/licenses/>.
## Backend for the MIP portal [![CHUV](https://img.shields.io/badge/CHUV-LREN-AF4C64.svg)](https://www.unil.ch/lren/en/home.html) [![License](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.html)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/05ba08087da24b3980475f88e1a591b7)](https://www.codacy.com/app/hbp-mip/portal-backend?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=LREN-CHUV/portal-backend&amp;utm_campaign=Badge_Grade)
[![License](https://img.shields.io/badge/license-AGPL--3.0-blue.svg)](https://www.gnu.org/licenses/agpl-3.0.html)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/087c83d0601a46c7a4dd91f2e5935a5a)](https://www.codacy.com/app/mirco-nasuti/portal-backend?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=LREN-CHUV/portal-backend&amp;utm_campaign=Badge_Grade)
[![DockerHub](https://img.shields.io/badge/docker-hbpmip%2Fportal--backend-008bb8.svg)](https://hub.docker.com/r/hbpmip/portal-backend/) [![DockerHub](https://img.shields.io/badge/docker-hbpmip%2Fportal--backend-008bb8.svg)](https://hub.docker.com/r/hbpmip/portal-backend/)
[![CircleCI](https://circleci.com/gh/LREN-CHUV/portal-backend/tree/master.svg?style=svg)](https://circleci.com/gh/LREN-CHUV/portal-backend/tree/master) [![CircleCI](https://circleci.com/gh/LREN-CHUV/portal-backend/tree/master.svg?style=svg)](https://circleci.com/gh/LREN-CHUV/portal-backend/tree/master)
# Backend for the MIP portal
## Usage ## Usage
* Build a versioned image: `./build.sh` * Build a versioned image: `./build.sh`
...@@ -14,9 +14,17 @@ ...@@ -14,9 +14,17 @@
* See here: https://hub.docker.com/r/hbpmip/portal-backend/ * See here: https://hub.docker.com/r/hbpmip/portal-backend/
## Build
Run: `./build.sh`
## Publish on Docker Hub
Run: `./publish.sh`
## License ## License
Copyright © 2016 LREN CHUV Copyright © 2016-2017 LREN CHUV
Licensed under the GNU Affero General Public License, Version 3.0 (the "License"); Licensed under the GNU Affero General Public License, Version 3.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
......
#!/bin/sh
pre-commit install
#!/bin/sh
pre-commit install
...@@ -13,8 +13,6 @@ get_script_dir () { ...@@ -13,8 +13,6 @@ get_script_dir () {
pwd pwd
} }
export WORKSPACE=$(get_script_dir)
if pgrep -lf sshuttle > /dev/null ; then if pgrep -lf sshuttle > /dev/null ; then
echo "sshuttle detected. Please close this program as it messes with networking and prevents builds inside Docker to work" echo "sshuttle detected. Please close this program as it messes with networking and prevents builds inside Docker to work"
exit 1 exit 1
...@@ -26,4 +24,8 @@ else ...@@ -26,4 +24,8 @@ else
CAPTAIN="sudo captain" CAPTAIN="sudo captain"
fi fi
$CAPTAIN build BUILD_DATE=$(date --iso-8601=seconds) \
VCS_REF=$(git describe --tags --dirty) \
VERSION=$(git describe --tags --dirty) \
WORKSPACE=$(get_script_dir) \
$CAPTAIN build
...@@ -21,12 +21,12 @@ Environment variables: ...@@ -21,12 +21,12 @@ Environment variables:
* META_DB_USER: User to use when connecting to the metadata database * META_DB_USER: User to use when connecting to the metadata database
* META_DB_PASSWORD: Password to use when connecting to the metadata database * META_DB_PASSWORD: Password to use when connecting to the metadata database
* SCIENCE_DB_URL: JDBC URL to connect to the science database * FEATURES_DB_URL: JDBC URL to connect to the features database
* SCIENCE_DB_SCHEMA: Database schema, default value is "public" * FEATURES_DB_SCHEMA: Database schema, default value is "public"
* SCIENCE_DB_SERVER: optional, address of the science database server. Used to wait for the database to be up and running. * FEATURES_DB_SERVER: optional, address of the features database server. Used to wait for the database to be up and running.
* SCIENCE_DB_USER: User to use when connecting to the science database * FEATURES_DB_USER: User to use when connecting to the features database
* SCIENCE_DB_PASSWORD: Password to use when connecting to the science database * FEATURES_DB_PASSWORD: Password to use when connecting to the features database
* SCIENCE_DB_MAIN_TABLE: Table that contains the scientific data to use, default value is adni_merge * FEATURES_DB_MAIN_TABLE: Table that contains the scientific data to use, default value is adni_merge
* CONTEXT_PATH: context path appended to all services running in this container. Default to "/services" * CONTEXT_PATH: context path appended to all services running in this container. Default to "/services"
......
...@@ -14,12 +14,12 @@ spring: ...@@ -14,12 +14,12 @@ spring:
username: {{ default .Env.META_DB_USER "postgres" }} username: {{ default .Env.META_DB_USER "postgres" }}
password: {{ .Env.META_DB_PASSWORD }} password: {{ .Env.META_DB_PASSWORD }}
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver
scienceDatasource: featuresDatasource:
url: {{ default .Env.SCIENCE_DB_URL "jdbc:postgresql://172.22.0.1:5433/science" }} url: {{ default .Env.FEATURES_DB_URL "jdbc:postgresql://172.22.0.1:5433/features" }}
schema: {{ default .Env.SCIENCE_DB_SCHEMA "public" }} schema: {{ default .Env.FEATURES_DB_SCHEMA "public" }}
main-table: {{ default .Env.SCIENCE_DB_MAIN_TABLE "adni_merge" }} main-table: {{ default .Env.FEATURES_DB_MAIN_TABLE "adni_merge" }}
username: {{ default .Env.SCIENCE_DB_USER "postgres" }} username: {{ default .Env.FEATURES_DB_USER "postgres" }}
password: {{ .Env.SCIENCE_DB_PASSWORD }} password: {{ .Env.FEATURES_DB_PASSWORD }}
driver-class-name: org.postgresql.Driver driver-class-name: org.postgresql.Driver
jpa: jpa:
hibernate: hibernate:
...@@ -86,5 +86,5 @@ services: ...@@ -86,5 +86,5 @@ services:
akka: akka:
woken: woken:
host: {{ default .Env.WOKEN_HOST "woken" }} host: {{ default .Env.WOKEN_HOST "woken" }}
port: {{ default .Env.WOKEN_PORT "8088" }} port: {{ default .Env.WOKEN_AKKA_PORT "8088" }}
path: {{ default .Env.WOKEN_PATH "/user/entrypoint" }} path: {{ default .Env.WOKEN_AKKA_PATH "/user/entrypoint" }}
...@@ -7,7 +7,7 @@ fi ...@@ -7,7 +7,7 @@ fi
if [ ! -z "$META_DB_SERVER" ]; then if [ ! -z "$META_DB_SERVER" ]; then
OPTS="$OPTS -wait tcp://$META_DB_SERVER -timeout 60s" OPTS="$OPTS -wait tcp://$META_DB_SERVER -timeout 60s"
fi fi
if [ ! -z "$SCIENCE_DB_SERVER" ]; then if [ ! -z "$FEATURES_DB_SERVER" ]; then
OPTS="$OPTS -wait tcp://$SCIENCE_DB_SERVER -timeout 60s" OPTS="$OPTS -wait tcp://$FEATURES_DB_SERVER -timeout 60s"
fi fi
dockerize $OPTS java -jar backend.jar dockerize $OPTS java -jar backend.jar
hbp.yml 0 → 100644
description: "Backend for the MIP portal"
long_description: |
Backend for the MIP portal
authors:
- author: Mirco Nasuti
author_email:
- mirco.nasuti@chuv.ch
organisation: LREN-CHUV
organisation_badge: https://img.shields.io/badge/CHUV-LREN-AF4C64.svg
- author: Ludovic Claude
author_email:
- ludovic.claude@chuv.ch
- ludovic.claude54@gmail.com
- ludovic.claude54@googlemail.com
- ludovic.claude@laposte.net
organisation: LREN-CHUV
organisation_badge: https://img.shields.io/badge/CHUV-LREN-AF4C64.svg
- author: Than Luu-tho
author_email:
- Thanh.Luu-Tho@chuv.ch
organisation: LREN-CHUV
organisation_badge: https://img.shields.io/badge/CHUV-LREN-AF4C64.svg
platform: MIP
component:
mip_building_block: web-analytics
nature: server
license:
name: GNU Affero General Public License, Version 3.0
badge: https://img.shields.io/badge/license-AGPL--3.0-blue.svg
url: https://github.com/LREN-CHUV/portal-backend/blob/master/LICENSE
code_repositories:
- name: chuv-gitlab
visibility: private
url: https://___.chuv.ch/web-analytics/portal-backend/
git_clone: https://___.chuv.ch/web-analytics/portal-backend.git
- name: github/LREN-CHUV
visibility: public
url: https://github.io/LREN-CHUV/portal-backend/
git_clone: https://github.io/LREN-CHUV/portal-backend.git
- name: github/HBPMedical
visibility: public
url: https://github.io/HBPMedical/portal-backend/
git_clone: https://github.io/HBPMedical/portal-backend.git
code_quality_checks:
codacy:
badge: https://api.codacy.com/project/badge/Grade/05ba08087da24b3980475f88e1a591b7
url: "https://www.codacy.com/app/hbp-mip/portal-backend?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=LREN-CHUV/portal-backend&amp;utm_campaign=Badge_Grade"
testing:
unit_testing:
source: src/test/java
command: ./test.sh
release_management:
current_version: 2.0.0
current_code_release: https://github.com/HBPMedical/portal-backend/archive/2.0.0.zip
current_binary_release: https://pypi.python.org/pypi/portal-backend/2.0.0
release_script: 'publish.sh'
continuous_integration:
- name: CircleCI
description: "Check style and execute unit tests"
url: https://circleci.com/gh/LREN-CHUV/portal-backend/tree/master
badge: https://circleci.com/gh/LREN-CHUV/portal-backend/tree/master.svg?style=svg
actions:
- build
- unit_tests
distribution:
docker_hub:
name: hbpmip/portal-backend
current_tag: 2.0.0
url: https://hub.docker.com/r/hbpmip/portal-backend/
badge: https://img.shields.io/badge/docker-hbpmip%2Fportal--backend-008bb8.svg
command: docker pull hbpmip/portal-backend:2.0.0
planning:
github:
name: Issues on Github
url: https://github.com/LREN-CHUV/portal-backend/issues
trello:
name: "[plans] Web front end"
url: https://trello.com/b/lr3NS4W6/plans-web-front-end
related_projects:
- name: portal-frontend
mip_building_block: web-analytics
relationship: other-depends-on
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<groupId>eu.hbp.mip</groupId> <groupId>eu.hbp.mip</groupId>
<artifactId>portal-backend</artifactId> <artifactId>portal-backend</artifactId>
<version>1.1</version> <version>2.0.0</version><!-- BUMP_VERSION -->
<packaging>jar</packaging> <packaging>jar</packaging>
<name>portal-backend</name> <name>portal-backend</name>
......
...@@ -26,7 +26,64 @@ else ...@@ -26,7 +26,64 @@ else
CAPTAIN="sudo captain" CAPTAIN="sudo captain"
fi fi
$CAPTAIN push --branch-tags=false --commit-tags=true portal-backend count=$(git status --porcelain | wc -l)
if test $count -gt 0; then
git status
echo "Not all files have been committed in Git. Release aborted"
exit 1
fi
select_part() {
local choice=$1
case "$choice" in
"Patch release")
bumpversion patch
;;
"Minor release")
bumpversion minor
;;
"Major release")
bumpversion major
;;
*)
read -p "Version > " version
bumpversion --new-version=$version all
;;
esac
}
git pull --tags
# Look for a version tag in Git. If not found, ask the user to provide one
[ $(git tag --points-at HEAD | wc -l) == 1 ] || (
latest_version=$(git describe --abbrev=00 || \
(bumpversion --dry-run --list patch | grep current_version | sed -r s,"^.*=",,) || echo '0.0.1')
echo
echo "Current commit has not been tagged with a version. Latest known version is $latest_version."
echo
echo 'What do you want to release?'
PS3='Select the version increment> '
options=("Patch release" "Minor release" "Major release" "Release with a custom version")
select choice in "${options[@]}";
do
select_part "$choice"
break
done
updated_version=$(bumpversion --dry-run --list patch | grep current_version | sed -r s,"^.*=",,)
read -p "Release version $updated_version? [y/N] > " ok
if [ "$ok" != "y" ]; then
echo "Release aborted"
exit 1
fi
)
git push
git push --tags
updated_version=$(bumpversion --dry-run --list patch | grep current_version | sed -r s,"^.*=",,)
# WARNING: Requires captain 1.1.0 to push user tags
BUILD_DATE=$(date --iso-8601=seconds) VCS_REF=$updated_version VERSION=$updated_version \
$CAPTAIN push portal-backend --branch-tags=false --commit-tags=false --tag $updated_version
sed "s/USER/${USER^}/" $WORKSPACE/docker/runner/slack.json > $WORKSPACE/target/slack.json sed "s/USER/${USER^}/" $WORKSPACE/docker/runner/slack.json > $WORKSPACE/target/slack.json
sed -i.bak "s/VERSION/$updated_version/" $WORKSPACE/target/slack.json
curl -k -X POST --data-urlencode payload@$WORKSPACE/target/slack.json https://hbps1.chuv.ch/slack/dev-activity curl -k -X POST --data-urlencode payload@$WORKSPACE/target/slack.json https://hbps1.chuv.ch/slack/dev-activity
rm -f $WORKSPACE/target/slack.json rm -f $WORKSPACE/target/slack.json
{"channel": "#dev-activity", "username": "webhookbot", "text": "USER pushed a new version of hbpmip/portal-backend:VERSION to Docker hub", "icon_emoji": ":whale:"}
...@@ -26,8 +26,8 @@ import javax.sql.DataSource; ...@@ -26,8 +26,8 @@ import javax.sql.DataSource;
@EntityScan(basePackages = "eu.hbp.mip.model") @EntityScan(basePackages = "eu.hbp.mip.model")
public class PersistenceConfiguration { public class PersistenceConfiguration {
@Value("#{'${spring.scienceDatasource.main-table:adni_merge}'}") @Value("#{'${spring.featuresDatasource.main-table:adni_merge}'}")
private String scienceMainTable; private String featuresMainTable;
@Primary @Primary
@Bean(name = "portalDatasource") @Bean(name = "portalDatasource")
...@@ -42,9 +42,9 @@ public class PersistenceConfiguration { ...@@ -42,9 +42,9 @@ public class PersistenceConfiguration {
return DataSourceBuilder.create().build(); return DataSourceBuilder.create().build();
} }
@Bean(name = "scienceDatasource") @Bean(name = "featuresDatasource")
@ConfigurationProperties(prefix="spring.scienceDatasource") @ConfigurationProperties(prefix="spring.featuresDatasource")
public DataSource scienceDataSource() { public DataSource featuresDataSource() {
return DataSourceBuilder.create().build(); return DataSourceBuilder.create().build();
} }
...@@ -57,9 +57,9 @@ public class PersistenceConfiguration { ...@@ -57,9 +57,9 @@ public class PersistenceConfiguration {
@Bean @Bean
@Autowired @Autowired
@Qualifier("scienceJdbcTemplate") @Qualifier("featuresJdbcTemplate")
public JdbcTemplate scienceJdbcTemplate() { public JdbcTemplate featuresJdbcTemplate() {
return new JdbcTemplate(scienceDataSource()); return new JdbcTemplate(featuresDataSource());
} }
@Bean(name = "entityManagerFactory") @Bean(name = "entityManagerFactory")
...@@ -83,7 +83,7 @@ public class PersistenceConfiguration { ...@@ -83,7 +83,7 @@ public class PersistenceConfiguration {
@Bean(name = "dataUtil") @Bean(name = "dataUtil")
@Scope("singleton") @Scope("singleton")
public DataUtil dataUtil() { public DataUtil dataUtil() {
return new DataUtil(scienceJdbcTemplate(), scienceMainTable); return new DataUtil(featuresJdbcTemplate(), featuresMainTable);
} }
} }
...@@ -17,12 +17,12 @@ public class DataUtil { ...@@ -17,12 +17,12 @@ public class DataUtil {
private static final int TABLESAMPLE_SEED = 42; private static final int TABLESAMPLE_SEED = 42;
private JdbcTemplate jdbcTemplate; private JdbcTemplate jdbcTemplate;
private String scienceMainTable; private String featuresMainTable;
public DataUtil(JdbcTemplate jdbcTemplate, String scienceMainTable) public DataUtil(JdbcTemplate jdbcTemplate, String featuresMainTable)
{ {
this.jdbcTemplate = jdbcTemplate; this.jdbcTemplate = jdbcTemplate;
this.scienceMainTable = scienceMainTable; this.featuresMainTable = featuresMainTable;
} }
@Cacheable("varsdata") @Cacheable("varsdata")
...@@ -39,7 +39,7 @@ public class DataUtil { ...@@ -39,7 +39,7 @@ public class DataUtil {
int nb_samples = Math.min(nbRows, MAX_NB_SAMPLES); int nb_samples = Math.min(nbRows, MAX_NB_SAMPLES);
int samplingPercentage = 100 * nb_samples / nbRows; int samplingPercentage = 100 * nb_samples / nbRows;
List<Object> queryResult = jdbcTemplate.queryForList( List<Object> queryResult = jdbcTemplate.queryForList(
"SELECT " + var + " FROM "+scienceMainTable+" " + "SELECT " + var + " FROM "+featuresMainTable+" " +
"TABLESAMPLE SYSTEM ("+ samplingPercentage +") REPEATABLE ( "+ TABLESAMPLE_SEED +" )", Object.class); "TABLESAMPLE SYSTEM ("+ samplingPercentage +") REPEATABLE ( "+ TABLESAMPLE_SEED +" )", Object.class);
for (Object value : queryResult) for (Object value : queryResult)
{ {
...@@ -62,14 +62,14 @@ public class DataUtil { ...@@ -62,14 +62,14 @@ public class DataUtil {
{ {
return jdbcTemplate.queryForObject( return jdbcTemplate.queryForObject(
"SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS " + "SELECT COUNT(*) FROM INFORMATION_SCHEMA.COLUMNS " +
"WHERE table_name = '"+scienceMainTable+"'", Long.class); "WHERE table_name = '"+featuresMainTable+"'", Long.class);
} }
@Cacheable("rowscount") @Cacheable("rowscount")
public long countDatasetRows() public long countDatasetRows()
{ {
return jdbcTemplate.queryForObject( return jdbcTemplate.queryForObject(
"SELECT COUNT(*) FROM "+scienceMainTable, Long.class); "SELECT COUNT(*) FROM "+featuresMainTable, Long.class);
} }
} }
...@@ -11,4 +11,4 @@ ...@@ -11,4 +11,4 @@
"polynominal": false "polynominal": false
} }
} }
} }
\ No newline at end of file
...@@ -14,4 +14,4 @@ echo "exp1: $response" ...@@ -14,4 +14,4 @@ echo "exp1: $response"
response=$(curl -s http://backend:8080/services/experiments -X POST -H "Content-Type: application/json" -d @expQuery2.json) response=$(curl -s http://backend:8080/services/experiments -X POST -H "Content-Type: application/json" -d @expQuery2.json)
echo "exp2: $response" echo "exp2: $response"
response=$(curl -s http://backend:8080/services/experiments -X POST -H "Content-Type: application/json" -d @expQuery3.json) response=$(curl -s http://backend:8080/services/experiments -X POST -H "Content-Type: application/json" -d @expQuery3.json)
echo "exp3: $response" echo "exp3: $response"
\ No newline at end of file
...@@ -9,8 +9,8 @@ fi ...@@ -9,8 +9,8 @@ fi
if [ $(docker ps | grep portal-db-test | wc -l) -gt 0 ]; then if [ $(docker ps | grep portal-db-test | wc -l) -gt 0 ]; then
docker kill portal-db-test docker kill portal-db-test
fi fi
if [ $(docker ps | grep science-db-test | wc -l) -gt 0 ]; then if [ $(docker ps | grep features-db-test | wc -l) -gt 0 ]; then
docker kill science-db-test docker kill features-db-test
fi fi
if [ $(docker ps | grep meta-db-test | wc -l) -gt 0 ]; then if [ $(docker ps | grep meta-db-test | wc -l) -gt 0 ]; then
docker kill meta-db-test docker kill meta-db-test
...@@ -25,8 +25,8 @@ fi ...@@ -25,8 +25,8 @@ fi
if [ $(docker ps -a | grep portal-db-test | wc -l) -gt 0 ]; then if [ $(docker ps -a | grep portal-db-test | wc -l) -gt 0 ]; then
docker rm -f portal-db-test docker rm -f portal-db-test
fi fi
if [ $(docker ps -a | grep science-db-test | wc -l) -gt 0 ]; then if [ $(docker ps -a | grep features-db-test | wc -l) -gt 0 ]; then
docker rm -f science-db-test docker rm -f features-db-test
fi fi
if [ $(docker ps -a | grep meta-db-test | wc -l) -gt 0 ]; then if [ $(docker ps -a | grep meta-db-test | wc -l) -gt 0 ]; then
docker rm -f meta-db-test docker rm -f meta-db-test
......
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