diff --git a/.env.example b/.env.example deleted file mode 100644 index 8631ca572..000000000 --- a/.env.example +++ /dev/null @@ -1,6 +0,0 @@ -# Set the folder name of a data collector (without "data-collector/") -COLLECTOR=event-a22 - -# Do not forget to also create a .env file inside the folder for -# further configuration. See event-a22 if it is missing, and create a -# similar .env.example for each tested project... diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index 532b8bbf6..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,19 +0,0 @@ -# SPDX-FileCopyrightText: NOI Techpark -# -# SPDX-License-Identifier: CC0-1.0 - -version: "3.4" - -services: - app: - image: maven:3-jdk-8-alpine - env_file: - - .env - - ./data-collectors/$COLLECTOR/.env - environment: - MAVEN_CONFIG: /var/maven/.m2 - volumes: - - ./data-collectors/$COLLECTOR/:/code - - ~/.m2/:/var/maven/.m2 - working_dir: /code - command: mvn -Duser.home=/var/maven -U clean tomcat:run diff --git a/docker/.gitignore b/docker/.gitignore deleted file mode 100644 index 0c84ffb73..000000000 --- a/docker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.m2 diff --git a/docker/DockerfileTomcatTest b/docker/DockerfileTomcatTest deleted file mode 100644 index 4fefecd76..000000000 --- a/docker/DockerfileTomcatTest +++ /dev/null @@ -1,17 +0,0 @@ -FROM maven:3-jdk-8-alpine as build -ARG JENKINS_GROUP_ID=1000 -ARG JENKINS_USER_ID=1000 -ARG COLLECTOR -RUN addgroup -g $JENKINS_GROUP_ID jenkins && \ - adduser -D -u $JENKINS_USER_ID -G jenkins jenkins - -COPY docker/entrypoint-java.sh /entrypoint-java.sh -ENTRYPOINT [ "/entrypoint.sh" ] - -WORKDIR /code -COPY data-collectors/${COLLECTOR} /code/${COLLECTOR}/ -RUN cd /code/${COLLECTOR}/ && mvn clean package -DfinalName=ROOT - -FROM tomcat:8.5.57-jdk8-openjdk-buster -ARG COLLECTOR -COPY --from=build /code/${COLLECTOR}/target/ROOT.war /usr/local/tomcat/webapps/ROOT.war diff --git a/docker/dockerfile-java b/docker/dockerfile-java deleted file mode 100644 index 6344861dc..000000000 --- a/docker/dockerfile-java +++ /dev/null @@ -1,17 +0,0 @@ -FROM maven:3-jdk-8-alpine - -ARG JENKINS_GROUP_ID=1000 -ARG JENKINS_USER_ID=1000 - -RUN addgroup -g $JENKINS_GROUP_ID jenkins && \ - adduser -D -u $JENKINS_USER_ID -G jenkins jenkins - -RUN apk add --no-cache xmlstarlet git openssh-client gawk - -RUN mkdir -p /var/log/opendatahub && \ - mkdir -p /var/log/opendatahub/data-collectors && \ - chmod -R 777 /var/log/opendatahub - -COPY docker/entrypoint-java.sh /entrypoint-java.sh - -ENTRYPOINT [ "/entrypoint-java.sh" ] diff --git a/docker/entrypoint-java.sh b/docker/entrypoint-java.sh deleted file mode 100755 index fd4b71870..000000000 --- a/docker/entrypoint-java.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/bash - -mkdir -p ~/.m2 - -cat > ~/.m2/settings.xml << EOF - - $PWD/docker/.m2 - -EOF - -export MAVEN_CONFIG="$HOME" - -/bin/bash -c "/usr/local/bin/mvn-entrypoint.sh $*" diff --git a/skeleton/infrastructure/Jenkinsfile-Prod.groovy b/skeleton/infrastructure/Jenkinsfile-Prod.groovy deleted file mode 100644 index 7cdd5330c..000000000 --- a/skeleton/infrastructure/Jenkinsfile-Prod.groovy +++ /dev/null @@ -1,74 +0,0 @@ -pipeline { - agent any - - environment { - LIMIT = "prod" - LOG_LEVEL = "info" - PROJECT = "project-name-same-as-folder-name" - PROJECT_FOLDER = "data-collectors/${PROJECT}" - ARTIFACT_NAME = "dc-${PROJECT}" - DOCKER_IMAGE = "755952719952.dkr.ecr.eu-west-1.amazonaws.com/${PROJECT}" - DOCKER_TAG = "$LIMIT-$BUILD_NUMBER" - DATACOLLECTORS_CLIENT_SECRET = credentials("keycloak-datacollectors-secret-$LIMIT") - KEYCLOAK_URL = "https://auth.opendatahub.testingmachine.eu" - WRITER_URL = "https://mobility.share.opendatahub.testingmachine.eu" - - // Additional parameters here... - } - - stages { - stage('Configure') { - steps { - sh """ - cd ${PROJECT_FOLDER} - echo 'COMPOSE_PROJECT_NAME=${PROJECT}' > .env - echo 'DOCKER_IMAGE=${DOCKER_IMAGE}' >> .env - echo 'DOCKER_TAG=${DOCKER_TAG}' >> .env - echo 'LOG_LEVEL=${LOG_LEVEL}' >> .env - echo 'ARTIFACT_NAME=${ARTIFACT_NAME}' >> .env - echo 'authorizationUri=${KEYCLOAK_URL}/auth' >> .env - echo 'tokenUri=${KEYCLOAK_URL}/auth/realms/noi/protocol/openid-connect/token' >> .env - echo 'clientId=odh-mobility-datacollector' >> .env - echo 'clientName=odh-mobility-datacollector' >> .env - echo 'clientSecret=${DATACOLLECTORS_CLIENT_SECRET}' >> .env - echo 'scope=openid' >> .env - echo -n 'provenance_version=' >> .env - xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 -t -v '/pom:project/pom:version' pom.xml >> .env - echo '' >> .env - echo -n 'provenance_name=' >> .env - xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 -t -v '/pom:project/pom:artifactId' pom.xml >> .env - echo '' >> .env - echo 'BASE_URI=${WRITER_URL}/json' >> .env - - # Your additional parameters here... - echo 'PARAM1=${PARAM1}' >> .env - echo 'PARAM2=${PARAM2}' >> .env - # ... - """ - - // Never use files if possible, just ENV variables to configure the DC - // ... change the code if not otherwise possible - } - } - stage('Test & Build') { - steps { - sh """ - cd ${PROJECT_FOLDER} - aws ecr get-login --region eu-west-1 --no-include-email | bash - docker-compose --no-ansi -f infrastructure/docker-compose.build.yml build --pull - docker-compose --no-ansi -f infrastructure/docker-compose.build.yml push - """ - } - } - stage('Deploy') { - steps { - sshagent(['jenkins-ssh-key']) { - sh """ - (cd ${PROJECT_FOLDER}/infrastructure/ansible && ansible-galaxy install -f -r requirements.yml) - (cd ${PROJECT_FOLDER}/infrastructure/ansible && ansible-playbook --limit=${LIMIT} deploy.yml --extra-vars "release_name=${BUILD_NUMBER} project_name=${PROJECT}") - """ - } - } - } - } -} diff --git a/skeleton/infrastructure/Jenkinsfile-Test.groovy b/skeleton/infrastructure/Jenkinsfile-Test.groovy deleted file mode 100644 index 44ff626b6..000000000 --- a/skeleton/infrastructure/Jenkinsfile-Test.groovy +++ /dev/null @@ -1,74 +0,0 @@ -pipeline { - agent any - - environment { - LIMIT = "test" - LOG_LEVEL = "info" - PROJECT = "project-name-same-as-folder-name" - PROJECT_FOLDER = "data-collectors/${PROJECT}" - ARTIFACT_NAME = "dc-${PROJECT}" - DOCKER_IMAGE = "755952719952.dkr.ecr.eu-west-1.amazonaws.com/${PROJECT}" - DOCKER_TAG = "$LIMIT-$BUILD_NUMBER" - DATACOLLECTORS_CLIENT_SECRET = credentials("keycloak-datacollectors-secret-$LIMIT") - KEYCLOAK_URL = "https://auth.opendatahub.testingmachine.eu" - WRITER_URL = "https://mobility.share.opendatahub.testingmachine.eu" - - // Additional parameters here... - } - - stages { - stage('Configure') { - steps { - sh """ - cd ${PROJECT_FOLDER} - echo 'COMPOSE_PROJECT_NAME=${PROJECT}' > .env - echo 'DOCKER_IMAGE=${DOCKER_IMAGE}' >> .env - echo 'DOCKER_TAG=${DOCKER_TAG}' >> .env - echo 'LOG_LEVEL=${LOG_LEVEL}' >> .env - echo 'ARTIFACT_NAME=${ARTIFACT_NAME}' >> .env - echo 'authorizationUri=${KEYCLOAK_URL}/auth' >> .env - echo 'tokenUri=${KEYCLOAK_URL}/auth/realms/noi/protocol/openid-connect/token' >> .env - echo 'clientId=odh-mobility-datacollector' >> .env - echo 'clientName=odh-mobility-datacollector' >> .env - echo 'clientSecret=${DATACOLLECTORS_CLIENT_SECRET}' >> .env - echo 'scope=openid' >> .env - echo -n 'provenance_version=' >> .env - xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 -t -v '/pom:project/pom:version' pom.xml >> .env - echo '' >> .env - echo -n 'provenance_name=' >> .env - xmlstarlet sel -N pom=http://maven.apache.org/POM/4.0.0 -t -v '/pom:project/pom:artifactId' pom.xml >> .env - echo '' >> .env - echo 'BASE_URI=${WRITER_URL}/json' >> .env - - # Your additional parameters here... - echo 'PARAM1=${PARAM1}' >> .env - echo 'PARAM2=${PARAM2}' >> .env - # ... - """ - - // Never use files if possible, just ENV variables to configure the DC - // ... change the code if not otherwise possible - } - } - stage('Test & Build') { - steps { - sh """ - cd ${PROJECT_FOLDER} - aws ecr get-login --region eu-west-1 --no-include-email | bash - docker-compose --no-ansi -f infrastructure/docker-compose.build.yml build --pull - docker-compose --no-ansi -f infrastructure/docker-compose.build.yml push - """ - } - } - stage('Deploy') { - steps { - sshagent(['jenkins-ssh-key']) { - sh """ - (cd ${PROJECT_FOLDER}/infrastructure/ansible && ansible-galaxy install -f -r requirements.yml) - (cd ${PROJECT_FOLDER}/infrastructure/ansible && ansible-playbook --limit=${LIMIT} deploy.yml --extra-vars "release_name=${BUILD_NUMBER} project_name=${PROJECT}") - """ - } - } - } - } -} diff --git a/skeleton/infrastructure/ansible/ansible.cfg b/skeleton/infrastructure/ansible/ansible.cfg deleted file mode 100644 index bec5ce050..000000000 --- a/skeleton/infrastructure/ansible/ansible.cfg +++ /dev/null @@ -1,4 +0,0 @@ -[defaults] -inventory = ./hosts -roles_path = ./roles -retry_files_enabled = False diff --git a/skeleton/infrastructure/ansible/deploy.yml b/skeleton/infrastructure/ansible/deploy.yml deleted file mode 100644 index 486406a00..000000000 --- a/skeleton/infrastructure/ansible/deploy.yml +++ /dev/null @@ -1,15 +0,0 @@ ---- -- hosts: all - vars: - ansible_python_interpreter: /usr/bin/python3 - roles: - - role: ansible-docker-deployment - vars: - docker_deployment_project_name: '{{ project_name }}' - docker_deployment_release_name: '{{ release_name }}' - docker_deployment_release_files: - - local: ../docker-compose.run.yml - remote: docker-compose.yml - - local: ../../.env - remote: .env - docker_deployment_aws_ecr_repository: 755952719952.dkr.ecr.eu-west-1.amazonaws.com diff --git a/skeleton/infrastructure/ansible/hosts b/skeleton/infrastructure/ansible/hosts deleted file mode 100644 index bcca0e0e0..000000000 --- a/skeleton/infrastructure/ansible/hosts +++ /dev/null @@ -1,5 +0,0 @@ -[test] -docker01.testingmachine.eu ansible_ssh_common_args='-o StrictHostKeyChecking=no' - -[prod] -docker01.opendatahub.com ansible_ssh_common_args='-o StrictHostKeyChecking=no' diff --git a/skeleton/infrastructure/ansible/requirements.yml b/skeleton/infrastructure/ansible/requirements.yml deleted file mode 100644 index 2e4496fdd..000000000 --- a/skeleton/infrastructure/ansible/requirements.yml +++ /dev/null @@ -1,2 +0,0 @@ -- src: git+https://github.com/noi-techpark/ansible-docker-deployment.git - version: "1.0" diff --git a/skeleton/infrastructure/ansible/roles/.gitignore b/skeleton/infrastructure/ansible/roles/.gitignore deleted file mode 100644 index d6b7ef32c..000000000 --- a/skeleton/infrastructure/ansible/roles/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/skeleton/infrastructure/docker-compose.build.yml b/skeleton/infrastructure/docker-compose.build.yml deleted file mode 100644 index 932804cfc..000000000 --- a/skeleton/infrastructure/docker-compose.build.yml +++ /dev/null @@ -1,9 +0,0 @@ -version: "3.4" - -services: - app: - image: ${DOCKER_IMAGE}:${DOCKER_TAG} - build: - context: ../ - dockerfile: infrastructure/docker/Dockerfile - target: archive diff --git a/skeleton/infrastructure/docker-compose.run.yml b/skeleton/infrastructure/docker-compose.run.yml deleted file mode 100644 index e1c2a2201..000000000 --- a/skeleton/infrastructure/docker-compose.run.yml +++ /dev/null @@ -1,8 +0,0 @@ -version: "3.4" - -services: - app: - image: ${DOCKER_IMAGE}:${DOCKER_TAG} - restart: unless-stopped - env_file: - - .env diff --git a/skeleton/infrastructure/docker/.gitignore b/skeleton/infrastructure/docker/.gitignore deleted file mode 100644 index 0c84ffb73..000000000 --- a/skeleton/infrastructure/docker/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/.m2 diff --git a/skeleton/infrastructure/docker/Dockerfile b/skeleton/infrastructure/docker/Dockerfile deleted file mode 100644 index d36674930..000000000 --- a/skeleton/infrastructure/docker/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -FROM maven:3-jdk-8-alpine as base - -RUN mkdir -p /code - -# Dev -FROM base as dev - -# Build -FROM base as build - -WORKDIR /code - -COPY src /code/src -COPY pom.xml /code/pom.xml -RUN mvn -B package -DfinalName=ROOT - -# Archive -FROM tomcat:8.5-jdk8-openjdk-slim-buster as archive -COPY --from=build /code/target/ROOT.war /usr/local/tomcat/webapps/ROOT.war - -# Run -FROM archive as run -CMD ["catalina.sh", "run"] - - diff --git a/webservices/bdp-api/Jenkinsfile-Production b/webservices/bdp-api/Jenkinsfile-Production deleted file mode 100644 index 346afc4e1..000000000 --- a/webservices/bdp-api/Jenkinsfile-Production +++ /dev/null @@ -1,447 +0,0 @@ -pipeline { - agent { - dockerfile { - filename 'docker/dockerfile-java' - additionalBuildArgs '--build-arg JENKINS_USER_ID=`id -u jenkins` --build-arg JENKINS_GROUP_ID=`id -g jenkins`' - } - } - - environment { - PROJECT_FOLDER = "webservices/bdp-api" - } - - stages { - stage('Configure') { - steps { - sh 'sed -i -e "s%\\(log4j.rootLogger\\s*=\\).*\\$%\\1INFO,stdout,R%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - - stage('Configure - bikesharing') { - environment { - ARTIFACT_NAME = "bikesharing" - STATION_TYPE = "BikesharingStation" - CHILD_STATION_TYPE = "Bicycle" - CHILDREN_PATH = "bikes" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - bikesharing') { - environment { - ARTIFACT_NAME = "bikesharing" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - bikesharing') { - environment { - ARTIFACT_NAME = "bikesharing" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - bluetooth') { - environment { - ARTIFACT_NAME = "bluetooth" - STATION_TYPE = "BluetoothStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - bluetooth') { - environment { - ARTIFACT_NAME = "bluetooth" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - bluetooth') { - environment { - ARTIFACT_NAME = "bluetooth" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - carsharing') { - environment { - ARTIFACT_NAME = "carsharing" - STATION_TYPE = "CarsharingStation" - CHILD_STATION_TYPE = "CarsharingCar" - CHILDREN_PATH = "cars" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - carsharing') { - environment { - ARTIFACT_NAME = "carsharing" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - carsharing') { - environment { - ARTIFACT_NAME = "carsharing" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - emobility') { - environment { - ARTIFACT_NAME = "emobility" - STATION_TYPE = "EChargingStation" - CHILD_STATION_TYPE = "EChargingPlug" - CHILDREN_PATH = "plugs" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - emobility') { - environment { - ARTIFACT_NAME = "emobility" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - emobility') { - environment { - ARTIFACT_NAME = "emobility" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - environment') { - environment { - ARTIFACT_NAME = "environment" - STATION_TYPE = "EnvironmentStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - environment') { - environment { - ARTIFACT_NAME = "environment" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - environment') { - environment { - ARTIFACT_NAME = "environment" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - origin-destination') { - environment { - ARTIFACT_NAME = "origin-destination" - STATION_TYPE = "LinkStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - origin-destination') { - environment { - ARTIFACT_NAME = "origin-destination" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - origin-destination') { - environment { - ARTIFACT_NAME = "origin-destination" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - meteorology') { - environment { - ARTIFACT_NAME = "meteorology" - STATION_TYPE = "MeteoStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - meteorology') { - environment { - ARTIFACT_NAME = "meteorology" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - meteorology') { - environment { - ARTIFACT_NAME = "meteorology" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - parking') { - environment { - ARTIFACT_NAME = "parking" - STATION_TYPE = "ParkingStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - parking') { - environment { - ARTIFACT_NAME = "parking" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - parking') { - environment { - ARTIFACT_NAME = "parking" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - roadweather') { - environment { - ARTIFACT_NAME = "roadweather" - STATION_TYPE = "RWISstation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - roadweather') { - environment { - ARTIFACT_NAME = "roadweather" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - roadweather') { - environment { - ARTIFACT_NAME = "roadweather" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - street') { - environment { - ARTIFACT_NAME = "street" - STATION_TYPE = "Streetstation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - street') { - environment { - ARTIFACT_NAME = "street" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - street') { - environment { - ARTIFACT_NAME = "street" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - - stage('Configure - sensors') { - environment { - ARTIFACT_NAME = "sensors" - STATION_TYPE = "TrafficSensor" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - sensors') { - environment { - ARTIFACT_NAME = "sensors" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - sensors') { - environment { - ARTIFACT_NAME = "sensors" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - stage('Configure - carpooling') { - environment { - ARTIFACT_NAME = "carpooling" - STATION_TYPE = "CarpoolingHub" - CHILD_STATION_TYPE = "CarpoolingUser" - CHILDREN_PATH = "user" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - carpooling') { - environment { - ARTIFACT_NAME = "carpooling" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - carpooling') { - environment { - ARTIFACT_NAME = "carpooling" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - stage('Configure - vms') { - environment { - ARTIFACT_NAME = "vms" - STATION_TYPE = "VMS" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype\\s*=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype\\s*=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath\\s*=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File\\s*=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Build - VMS') { - environment { - ARTIFACT_NAME = "vms" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U clean test package -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Archive - VMS') { - environment { - ARTIFACT_NAME = "vms" - } - steps { - sh 'cp ${PROJECT_FOLDER}/target/${ARTIFACT_NAME}.war ${ARTIFACT_NAME}.war' - archiveArtifacts artifacts: "${ARTIFACT_NAME}.war", onlyIfSuccessful: true - } - } - } -} diff --git a/webservices/bdp-api/Jenkinsfile-Test b/webservices/bdp-api/Jenkinsfile-Test deleted file mode 100644 index d4be7ce78..000000000 --- a/webservices/bdp-api/Jenkinsfile-Test +++ /dev/null @@ -1,344 +0,0 @@ -pipeline { - agent { - dockerfile { - filename 'docker/dockerfile-java' - additionalBuildArgs '--build-arg JENKINS_USER_ID=`id -u jenkins` --build-arg JENKINS_GROUP_ID=`id -g jenkins`' - } - } - - environment { - TESTSERVER_TOMCAT_ENDPOINT = credentials('testserver-tomcat8-url') - TESTSERVER_TOMCAT_CREDENTIALS = credentials('testserver-tomcat8-credentials') - PROJECT_FOLDER = "webservices/bdp-api" - } - - stages { - stage('Configure') { - steps { - sh 'sed -i -e "s/<\\/settings>$//g\" ~/.m2/settings.xml' - sh 'echo " " >> ~/.m2/settings.xml' - sh 'echo " ${TESTSERVER_TOMCAT_CREDENTIALS}" >> ~/.m2/settings.xml' - sh 'echo " " >> ~/.m2/settings.xml' - sh 'echo "" >> ~/.m2/settings.xml' - - sh 'sed -i -e "s%\\(log4j.rootLogger\\s*=\\).*\\$%\\1DEBUG,R%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - - stage('Clean') { - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -U -B clean' - } - } - - stage('Configure - bikesharing') { - environment { - ARTIFACT_NAME = "bikesharing" - STATION_TYPE = "BikesharingStation" - CHILD_STATION_TYPE = "Bicycle" - CHILDREN_PATH = "bikes" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - bikesharing') { - environment { - ARTIFACT_NAME = "bikesharing" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - bluetooth') { - environment { - ARTIFACT_NAME = "bluetooth" - STATION_TYPE = "BluetoothStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - bluetooth') { - environment { - ARTIFACT_NAME = "bluetooth" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - carsharing') { - environment { - ARTIFACT_NAME = "carsharing" - STATION_TYPE = "CarsharingStation" - CHILD_STATION_TYPE = "CarsharingCar" - CHILDREN_PATH = "cars" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - carsharing') { - environment { - ARTIFACT_NAME = "carsharing" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - emobility') { - environment { - ARTIFACT_NAME = "emobility" - STATION_TYPE = "EChargingStation" - CHILD_STATION_TYPE = "EChargingPlug" - CHILDREN_PATH = "plugs" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - emobility') { - environment { - ARTIFACT_NAME = "emobility" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - environment') { - environment { - ARTIFACT_NAME = "environment" - STATION_TYPE = "EnvironmentStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - environment') { - environment { - ARTIFACT_NAME = "environment" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - origin-destination') { - environment { - ARTIFACT_NAME = "origin-destination" - STATION_TYPE = "LinkStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - origin-destination') { - environment { - ARTIFACT_NAME = "origin-destination" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - meteorology') { - environment { - ARTIFACT_NAME = "meteorology" - STATION_TYPE = "MeteoStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - meteorology') { - environment { - ARTIFACT_NAME = "meteorology" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - parking') { - environment { - ARTIFACT_NAME = "parking" - STATION_TYPE = "ParkingStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - parking') { - environment { - ARTIFACT_NAME = "parking" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - roadweather') { - environment { - ARTIFACT_NAME = "roadweather" - STATION_TYPE = "RWISstation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - roadweather') { - environment { - ARTIFACT_NAME = "roadweather" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - street') { - environment { - ARTIFACT_NAME = "street" - STATION_TYPE = "StreetStation" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - street') { - environment { - ARTIFACT_NAME = "street" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - - stage('Configure - sensors') { - environment { - ARTIFACT_NAME = "sensors" - STATION_TYPE = "TrafficSensor" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - sensors') { - environment { - ARTIFACT_NAME = "sensors" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Configure - carpooling') { - environment { - ARTIFACT_NAME = "carpooling" - STATION_TYPE = "CarpoolingHub" - CHILD_STATION_TYPE = "CarpoolingUser" - CHILDREN_PATH = "user" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - carpooling') { - environment { - ARTIFACT_NAME = "carpooling" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - stage('Configure - vms') { - environment { - ARTIFACT_NAME = "vms" - STATION_TYPE = "VMS" - CHILD_STATION_TYPE = "/" - CHILDREN_PATH = "/" - } - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1${STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1${CHILD_STATION_TYPE}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1${CHILDREN_PATH}%" ${PROJECT_FOLDER}/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/${ARTIFACT_NAME}.log%" ${PROJECT_FOLDER}/src/main/resources/log4j.properties' - } - } - stage('Deploy - vms') { - environment { - ARTIFACT_NAME = "vms" - } - steps { - sh 'cd ${PROJECT_FOLDER} && mvn -B -U tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=${ARTIFACT_NAME}' - } - } - } -} diff --git a/webservices/bdp-api/Jenkinsfile-V2-Test b/webservices/bdp-api/Jenkinsfile-V2-Test deleted file mode 100644 index 27ad8c0f5..000000000 --- a/webservices/bdp-api/Jenkinsfile-V2-Test +++ /dev/null @@ -1,208 +0,0 @@ -pipeline { - agent { - dockerfile { - filename 'docker/dockerfile-java' - additionalBuildArgs '--build-arg JENKINS_USER_ID=`id -u jenkins` --build-arg JENKINS_GROUP_ID=`id -g jenkins`' - } - } - - environment { - TESTSERVER_TOMCAT_ENDPOINT=credentials('testserver-tomcat8-url') - TESTSERVER_TOMCAT_CREDENTIALS=credentials('testserver-tomcat8-credentials') - } - - stages { - stage('Configure') { - steps { - sh 'sed -i -e "s/<\\/settings>$//g\" ~/.m2/settings.xml' - sh 'echo " " >> ~/.m2/settings.xml' - sh 'echo " ${TESTSERVER_TOMCAT_CREDENTIALS}" >> ~/.m2/settings.xml' - sh 'echo " " >> ~/.m2/settings.xml' - sh 'echo "" >> ~/.m2/settings.xml' - } - } - - stage('Configure General Things') { - steps { - sh 'sed -i -e "s%\\(bdp.endpoint=\\).*\\$%\\1http://localhost:8080/reader2%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.requestTimeoutInSeconds=\\).*\\$%\\120%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - } - } - - stage('Configure - bikesharing') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1BikesharingStation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1Bicycle%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1bikes%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/bikesharing2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - bikesharing') { - steps { - sh 'cd webservices/bdp-api && mvn -U -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=bikesharing2' - } - } - - stage('Configure - bluetooth') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1Bluetoothstation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/bluetooth2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - bluetooth') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=bluetooth2' - } - } - - stage('Configure - carsharing') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1Carsharingstation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1Carsharingcar%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1cars%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/carsharing2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - carsharing') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=carsharing2' - } - } - - stage('Configure - emobility') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1EChargingStation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1EChargingPlug%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1plugs%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/emobility2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - emobility') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=emobility2' - } - } - - stage('Configure - environment') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1Environmentstation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/environment2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - environment') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=environment2' - } - } - - stage('Configure - origin-destination') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1Linkstation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/origin-destination2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - origin-destination') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=origin-destination2' - } - } - - stage('Configure - meteorology') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1Meteostation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/meteorology2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - meteorology') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=meteorology2' - } - } - - stage('Configure - parking') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1ParkingStation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/parking2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - parking') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=parking2' - } - } - - stage('Configure - roadweather') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1RWISstation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/roadweather2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - roadweather') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=roadweather2' - } - } - - stage('Configure - street') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1Streetstation%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/street2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - street') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=street2' - } - } - - stage('Configure - sensors') { - steps { - sh 'sed -i -e "s%\\(bdp.stationtype=\\).*\\$%\\1TrafficSensor%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childstationtype=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - sh 'sed -i -e "s%\\(bdp.childrenpath=\\).*\\$%\\1/%" webservices/bdp-api/src/main/resources/META-INF/spring/application.properties' - - sh 'sed -i -e "s%\\(log4j.rootLogger=\\).*\\$%\\1DEBUG,stdout,R%" webservices/bdp-api/src/main/resources/log4j.properties' - sh 'sed -i -e "s%\\(log4j.appender.R.File=\\).*\\$%\\1/var/log/opendatahub/webservices/sensors2.log%" webservices/bdp-api/src/main/resources/log4j.properties' - } - } - stage('Deploy - sensors') { - steps { - sh 'cd webservices/bdp-api && mvn -B tomcat:redeploy -Dmaven.tomcat.url=${TESTSERVER_TOMCAT_ENDPOINT} -Dmaven.tomcat.server=testServer -Dwebservice=sensors2' - } - } - } -} diff --git a/webservices/bdp-api/README.md b/webservices/bdp-api/README.md deleted file mode 100644 index 3af1722d3..000000000 --- a/webservices/bdp-api/README.md +++ /dev/null @@ -1,71 +0,0 @@ - - -bdp-api -================= - -This is the *codebase for each internal developed webservice* exposing the big data platform API. This module contains the API of the bdp, means it exposes data as json which it get's from the reader (https://github.com/idm-suedtirol/bdp-core/tree/master/reader). Which also means that alone this module gives you nothing. -For **each typology** of data we create **a specific module/webservice** which exposes the data which is meant to be shown. -e.g. for all data regarding Parking slots we deploy a module which only exposes data relative to the parking domain like capacity or current occupancy of a parking slots. - -Each typology of data is **identified by the stationtype**, which can also have child stations. It only goes down **one level**, which means a child station can not have childs on it's own. Like for example a carsharingstation(the place where you take the car) has multiple children which are the single cars(CarsharingCar) - -## Configuration -For it to work you just need to fill out the configuration file you find under `src/main/resources/META-INF/spring/application.properties` -There you basically do 2 things: -1. Point the module to the reader which was setup previously - - [Default] - host=localhost - port=8080 - ssl=false - endpoint=/reader -2. Define your stationtype and childstationtype and define under which path your children-station will be provided - bdp.stationtype=EChargingStation - bdp.childstationtype=EChargingPlug - bdp.childrenpath=hello - If no children exist for specific station just leave the 2 child fields empty - -Each module(and also each stationtype) will have the same api-structure. If you go to the root site of your app you will find swagger documentation about the API. Generally all api calls will be available under - - [app]/rest/ - - and each all api calls for the child stations(which are the same api calls) will be available under - - [app]/rest/${bdp.childrenpath}/ - -The available stationtypes and childstationtypes are: - -| Stationtype | Childstationtype | Childstationpath | Endpoint -|---------- |:-------------:|--- | ---------- -| BikesharingStation | Bicycle | bikes | bikesharing -| Bluetoothstation | / | / | bluetooth -| Carpoolinghub | / | / | [put on hold] -| Carpoolingservice | / | / | [put on hold] -| CarpoolingUser | / | / | [put on hold] -| Carsharingstation | Carsharingcar | cars | carsharing -| EChargingStation | EChargingPlug | plugs | emobility -| Environmentstation | / | / | environment -| Linkstation | / | / | origin-destination -| Meteostation | / | / | meteorology -| Mobilestation | / | / | [not-needed] -| ParkingStation | / | / | parking -| RWISstation | / | / | roadweather -| Streetstation | / | / | street -| TrafficSensor | / | / | sensors -| Trafficstation | / | / | [not-needed] - -TODO: Further development will provide this mapping through the reader API which should make it dynamic and maintainable - -## Building & Deployment - -Once you finished the configuration steps the building should be handled by maven easily. Just go to the root directory and: - - mvn clean test package - -You will find your war artifact in the target director and you can deploy it to an application server of your choice. - -In case you run into trouble or you need further support, please contact info@opendatahub.com diff --git a/webservices/bdp-api/pom.xml b/webservices/bdp-api/pom.xml deleted file mode 100644 index f0d3d2596..000000000 --- a/webservices/bdp-api/pom.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - 4.0.0 - it.bz.idm.bdp - ${webservice} - war - 1.0.0 - Webservice api - http://maven.apache.org - - UTF-8 - 8 - api - - - - maven-repo.opendatahub.com - OpenDataHub - http://it.bz.opendatahub.s3-website-eu-west-1.amazonaws.com/release - - - - - log4j - log4j - 2.16.0 - - - org.slf4j - slf4j-simple - 1.7.24 - compile - - - commons-logging - commons-logging - 1.2 - - - it.bz.idm.bdp - ws-interface - 3.3.3 - - - - ${webservice} - - - org.apache.maven.plugins - maven-compiler-plugin - 3.8.0 - - ${java.version} - ${java.version} - ${project.build.sourceEncoding} - - - - org.apache.maven.plugins - maven-war-plugin - 3.2.2 - - - org.apache.maven.plugins - maven-surefire-plugin - 2.21.0 - - false - - - - org.apache.maven.plugins - maven-failsafe-plugin - 2.22.1 - - - - integration-test - verify - - - - - - - - org.springframework.build - aws-maven - 5.0.0.RELEASE - - - - - - maven-repo.opendatahub.com - s3://it.bz.opendatahub/snapshot - - - maven-repo.opendatahub.com - s3://it.bz.opendatahub/release - - - diff --git a/webservices/bdp-api/src/main/java/it/bz/idm/bdp/ChildCondition.java b/webservices/bdp-api/src/main/java/it/bz/idm/bdp/ChildCondition.java deleted file mode 100644 index 001ba67c1..000000000 --- a/webservices/bdp-api/src/main/java/it/bz/idm/bdp/ChildCondition.java +++ /dev/null @@ -1,27 +0,0 @@ -// SPDX-FileCopyrightText: NOI Techpark -// -// SPDX-License-Identifier: AGPL-3.0-or-later - -package it.bz.idm.bdp; - -import org.springframework.context.annotation.ConditionContext; -import org.springframework.context.annotation.Configuration; -import org.springframework.context.annotation.ConfigurationCondition; -import org.springframework.core.type.AnnotatedTypeMetadata; - -@Configuration -public class ChildCondition implements ConfigurationCondition { - - @Override - public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) { - String childStationType = context.getEnvironment().getProperty("bdp.childstationtype"); - String childRestPath = context.getEnvironment().getProperty("bdp.childrenpath"); - - return (childStationType != null && !childStationType.isEmpty() && childRestPath != null && !childRestPath.isEmpty()); - } - - @Override - public ConfigurationPhase getConfigurationPhase() { - return ConfigurationPhase.REGISTER_BEAN; - } -} diff --git a/webservices/bdp-api/src/main/java/it/bz/idm/bdp/ChildEntityController.java b/webservices/bdp-api/src/main/java/it/bz/idm/bdp/ChildEntityController.java deleted file mode 100644 index 317b4e4ad..000000000 --- a/webservices/bdp-api/src/main/java/it/bz/idm/bdp/ChildEntityController.java +++ /dev/null @@ -1,36 +0,0 @@ -// SPDX-FileCopyrightText: NOI Techpark -// -// SPDX-License-Identifier: AGPL-3.0-or-later - -package it.bz.idm.bdp; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Conditional; -import org.springframework.context.annotation.PropertySource; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import it.bz.idm.bdp.ws.DataRetriever; -import it.bz.idm.bdp.ws.RestClient; -import it.bz.idm.bdp.ws.RestController; - -@Controller -@Conditional(ChildCondition.class) -@RequestMapping("/rest/${bdp.childrenpath}") -@PropertySource("classpath:META-INF/spring/application.properties") -public class ChildEntityController extends RestController { - - @Autowired - private RestClient childrenRetriever; - - @Value("${bdp.childstationtype}") - protected String stationType; - - @Override - public DataRetriever initDataRetriever() { - childrenRetriever.setStationType(stationType); - childrenRetriever.connect(); - return childrenRetriever; - } -} diff --git a/webservices/bdp-api/src/main/java/it/bz/idm/bdp/EntityController.java b/webservices/bdp-api/src/main/java/it/bz/idm/bdp/EntityController.java deleted file mode 100644 index 91418161e..000000000 --- a/webservices/bdp-api/src/main/java/it/bz/idm/bdp/EntityController.java +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-FileCopyrightText: NOI Techpark -// -// SPDX-License-Identifier: AGPL-3.0-or-later - -package it.bz.idm.bdp; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; - -import it.bz.idm.bdp.ws.DataRetriever; -import it.bz.idm.bdp.ws.RestClient; -import it.bz.idm.bdp.ws.RestController; - -@Controller -@RequestMapping("/rest/") -public class EntityController extends RestController{ - - @Autowired - private RestClient retriever; - - @Value("${bdp.stationtype}") - protected String stationType; - - @Override - public DataRetriever initDataRetriever() { - retriever.setStationType(stationType); - retriever.connect(); - return retriever; - } -} diff --git a/webservices/bdp-api/src/main/resources/META-INF/spring/application.properties b/webservices/bdp-api/src/main/resources/META-INF/spring/application.properties deleted file mode 100644 index 130ae9bee..000000000 --- a/webservices/bdp-api/src/main/resources/META-INF/spring/application.properties +++ /dev/null @@ -1,5 +0,0 @@ -bdp.stationtype= -bdp.childstationtype= -bdp.childrenpath= -bdp.endpoint=http://localhost:8080/reader -bdp.requestTimeoutInSeconds= \ No newline at end of file diff --git a/webservices/bdp-api/src/main/resources/META-INF/spring/applicationContext.xml b/webservices/bdp-api/src/main/resources/META-INF/spring/applicationContext.xml deleted file mode 100644 index 8fac41f65..000000000 --- a/webservices/bdp-api/src/main/resources/META-INF/spring/applicationContext.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - diff --git a/webservices/bdp-api/src/main/resources/log4j.properties b/webservices/bdp-api/src/main/resources/log4j.properties deleted file mode 100644 index 413fd9fbe..000000000 --- a/webservices/bdp-api/src/main/resources/log4j.properties +++ /dev/null @@ -1,12 +0,0 @@ -#Updated at Wed Dec 18 14:59:40 CET 2013 -#Wed Dec 18 14:59:40 CET 2013 -log4j.appender.stdout=org.apache.log4j.ConsoleAppender -log4j.rootLogger=INFO, stdout, R -log4j.appender.R.File=webservice.log -log4j.appender.R.MaxFileSize=1000KB -log4j.appender.R.layout=org.apache.log4j.PatternLayout -log4j.appender.R.MaxBackupIndex=1 -log4j.appender.R.layout.ConversionPattern=%p %t %c - %m%n -log4j.appender.stdout.layout.ConversionPattern=%d [%t] %-5p %c - %m%n -log4j.appender.stdout.layout=org.apache.log4j.PatternLayout -log4j.appender.R=org.apache.log4j.RollingFileAppender diff --git a/webservices/bdp-api/src/main/webapp/WEB-INF/spring/webmvc-config.xml b/webservices/bdp-api/src/main/webapp/WEB-INF/spring/webmvc-config.xml deleted file mode 100644 index 6290206eb..000000000 --- a/webservices/bdp-api/src/main/webapp/WEB-INF/spring/webmvc-config.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/webservices/bdp-api/src/main/webapp/WEB-INF/web.xml b/webservices/bdp-api/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index ec952ebe2..000000000 --- a/webservices/bdp-api/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,70 +0,0 @@ - - - - - - Template - - defaultHtmlEscape - true - - - contextConfigLocation - classpath*:META-INF/spring/applicationContext*.xml - - - CharacterEncodingFilter - org.springframework.web.filter.CharacterEncodingFilter - - encoding - UTF-8 - - - forceEncoding - true - - - - HttpMethodFilter - org.springframework.web.filter.HiddenHttpMethodFilter - - - corsFilter - it.bz.idm.bdp.ws.util.CorsFilter - - - corsFilter - /rest/* - - - CharacterEncodingFilter - /* - - - HttpMethodFilter - /* - - - org.springframework.web.context.ContextLoaderListener - - - api - org.springframework.web.servlet.DispatcherServlet - - contextConfigLocation - WEB-INF/spring/webmvc-config.xml - - 1 - - - api - / - - - 10 - - diff --git a/webservices/i18n/bluetooth-api-description.properties b/webservices/i18n/bluetooth-api-description.properties deleted file mode 100644 index f6293e486..000000000 --- a/webservices/i18n/bluetooth-api-description.properties +++ /dev/null @@ -1,7 +0,0 @@ -bdp-api.title=Open Data Hub - Bluetooth dataset -bdp-api.description=This page belongs to the Open Data Hub project and is part of the Big Data Platform. It contains the documentation about the API REST calls of the Big Data Platform, the core component of the ODH Project.\nMore information about the project in its homepage: http://opendatahub.com/ \nTutorials and technical documentation can be found at http://opendatahub.readthedocs.io/en/latest/index.html\n\nThe data for this datasets are collected by experimental Bluetooth-based sensors and detectorsand represent traffic information, since the detectors scan available Bluetooth devices on board of vehicle that drive on. -bdp-api.version=v1 -bdp-api.termsOfServiceUrl=http://opendatahub.readthedocs.io/en/latest/licenses.html#apis-terms-of-service -bdp-api.contact= -bdp-api.license=API License -bdp-api.licenseUrl=http://opendatahub.readthedocs.io/en/latest/licenses.html diff --git a/webservices/i18n/bluetooth-api-description_de.properties b/webservices/i18n/bluetooth-api-description_de.properties deleted file mode 100644 index fa691b6f9..000000000 --- a/webservices/i18n/bluetooth-api-description_de.properties +++ /dev/null @@ -1,7 +0,0 @@ -bdp-api.title=Open Data Hub - Bluetooth dataset -bdp-api.description=Diese Seite geh�rt zum Open Data Hub-Projekt und ist Teil der Big Data Platform.Sie enth�lt die Dokumentation zu den API-REST-Aufrufen der Big Data Platform, die Kernkomponente des ODH-Projekts.\nWeitere Informationen zum Projekt auf der Homepage: http://opendatahub.com/ \nAnleitungen und technische Dokumentation finden Sie unter http://opendatahub.readthedocs.io/en/latest/index.html\n\nDie Daten f�r diesen Datensatz werden von experimentellen Bluetooth-basierten Sensoren und Detektoren gesammelt und stellen Verkehrsinformationen dar, da die Detektoren verf�gbare Bluetooth-Ger�te an Bord des Fahrzeugs scannen, die vorbei fahren. -bdp-api.version=v1 -bdp-api.termsOfServiceUrl=http://opendatahub.readthedocs.io/en/latest/licenses.html#apis-terms-of-service -bdp-api.contact= -bdp-api.license=API Genehmigung -bdp-api.licenseUrl=http://opendatahub.readthedocs.io/en/latest/licenses.html \ No newline at end of file diff --git a/webservices/i18n/bluetooth-api-description_it.properties b/webservices/i18n/bluetooth-api-description_it.properties deleted file mode 100644 index b5332bd5b..000000000 --- a/webservices/i18n/bluetooth-api-description_it.properties +++ /dev/null @@ -1,7 +0,0 @@ -bdp-api.title=Open Data Hub - Bluetooth dataset -bdp-api.description=Questa pagina appartiene al progetto Open Data Hub,parte della Big Data Platform. In queta pagina si trova la documentazione delle chiamate API REST della Big Data Platform.\nMaggiori informazioni sul progetto si possono trovare nella homepage: http://opendatahub.com/ \nTutorial documentazione tecnica si trova invece a http://opendatahub.readthedocs.io/en/latest/index.html\n\nI dati presenti in questo dataset sono raccolti da sensori e rilevatori basati su tecnologia Bluetooth e mostrano informazioni sul traffico, poiché i rilevatori scansionano dispositivi Bluetooth a bordo dei veicoli di passaggio. -bdp-api.version=v1 -bdp-api.termsOfServiceUrl=http://opendatahub.readthedocs.io/en/latest/licenses.html#apis-terms-of-service -bdp-api.contact= -bdp-api.license=Licenza API -bdp-api.licenseUrl=http://opendatahub.readthedocs.io/en/latest/licenses.html