Skip to content

Commit

Permalink
Merge pull request #2547 from dzhw/release
Browse files Browse the repository at this point in the history
Release v1.0.100
  • Loading branch information
René Reitmann authored May 18, 2020
2 parents 90eb061 + 3357930 commit 38fafb9
Show file tree
Hide file tree
Showing 68 changed files with 1,517 additions and 958 deletions.
19 changes: 6 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
sudo: required
language: java
os:
- linux
jdk:
- openjdk11
- openjdk13
python:
- '2.7'
cache:
Expand Down Expand Up @@ -50,7 +49,7 @@ jobs:
after_success:
- bash <(curl -s https://codecov.io/bash)
- stage: build and deploy
name: Build and Deploy to PWS
name: Build and Deploy to AWS
install:
- export CXX=g++-7
- export NODE_OPTIONS=--max-old-space-size=4096
Expand All @@ -59,21 +58,15 @@ jobs:
- unzip -qq apache-maven-3.6.1-bin.zip
- export M2_HOME=$PWD/apache-maven-3.6.1
- export PATH=$M2_HOME/bin:$PATH
- sudo apt-get -y install python-pip python-dev --allow-unauthenticated
- sudo apt-get -y install python-pip python-dev jq --allow-unauthenticated
- pip install --user awscli
- pip install git+https://github.com/dzhw/javasphinx.git --user
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd
~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh
&& nvm install 14.1.0
- npm install -g grunt-cli
- wget -q -O - https://packages.cloudfoundry.org/debian/cli.cloudfoundry.org.key
| sudo apt-key add -
- echo "deb http://packages.cloudfoundry.org/debian stable main" | sudo tee /etc/apt/sources.list.d/cloudfoundry-cli.list
- sudo apt-get update -qq
- sudo apt-get install cf-cli -y --allow-unauthenticated
- sudo netstat -pelnut
script:
- "./deploy/build-and-deploy.sh unused $CI_DEPLOY_USERNAME $CI_DEPLOY_PASSWORD
$TRAVIS_BRANCH $TRAVIS_EVENT_TYPE"
script:
- "./deploy/build-and-deploy.sh unused $TRAVIS_BRANCH"
after_success:
- bash <(curl -s https://codecov.io/bash)
- stage: nightly e2e tests publicuser
Expand Down
21 changes: 15 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
FROM openjdk:8-jdk-alpine
MAINTAINER René Reitmann <[email protected]>
FROM openjdk:13.0.2-slim

ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.war"]
MAINTAINER René Reitmann <[email protected]>

VOLUME /tmp

# Add the service itself
ARG JAR_FILE
COPY ${JAR_FILE} app.war
# use unpacked spring boot jar to avoid file io
COPY target/app /app/
COPY run.sh run.sh

# add kill agent for correct OutOfMemory Handling
RUN apt update \
&& apt install -y --no-install-recommends curl\
&& rm -rf /var/lib/apt/lists/*\
&& curl https://java-buildpack.cloudfoundry.org/jvmkill/bionic/x86_64/jvmkill-1.16.0-RELEASE.so --output /app/jvmkill.so\
&& apt remove curl -y\
&& apt autoremove -y

ENTRYPOINT ["/run.sh"]
14 changes: 4 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Please checkout the development branch before starting to code and create a new

Before you can build this project, you must install and configure the following dependencies on your machine:

1. Java: You need to install java 11 sdk on your system. On Ubuntu you should use [SDKMAN!][]
1. Java: You need to install java 13 sdk on your system. On Ubuntu you should use [SDKMAN!][]
2. Maven: You need to install maven 3.6.1 or above on your system. On Ubuntu you should use [SDKMAN!][]
3. [Node.js][]: Node.js (latest) and npm (coming with node.js) are required as well. On Ubuntu you should install node using [NVM][]

Expand All @@ -33,7 +33,7 @@ On Windows, `patch.exe` has to exist in the PATH. It is distributed as part of g

Before starting the app on your local machine you need to start the following Document Stores:
1. Mongodb: Mongodb must be running on the default port, on ubuntu you should install it from here https://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
2. Elasticsearch (7.3.2): Elasticsearch must be running on its default port. You can download it from here https://www.elastic.co/downloads/elasticsearch
2. Elasticsearch (7.7.0): Elasticsearch must be running on its default port. You can download it from here https://www.elastic.co/downloads/elasticsearch

Make sure that you have read-write-access on the ***data*** directory (in your project directory) for Elasticsearch.

Expand Down Expand Up @@ -82,16 +82,10 @@ Once Python is installed, run:

Note that the `--user` flag installs the dependency somewhere in your user directory (e.g. /home/{user}/local/bin on Linux). Make sure that the installed binaries/scripts are on your path.

Before deploying the `{dev|test|prod}` system you need to [install the cloudfoundry cli](https://docs.cloudfoundry.org/cf-cli/install-go-cli.html#-linux-installation).

You can build and deploy the jar to the desired environment by running

./deploy/build-and-deploy.sh {dev|test|prod}

We test our project continuously with the Robot Framework. Test Developers can get further info [here](https://github.com/dzhw/metadatamanagement/wiki/Robot-Framework).

## Pivotal Cloudfoundry
This project is currently built and deployed to Pivotal Cloudfoundry by [Travis CI][TravisCI]. You can test the latest version on https://metadatamanagement-dev.cfapps.io/
## AWS Fargate
This project is currently built and deployed to AWS Fargate by [Travis CI][TravisCI]. You can test the latest version on https://dev.metadata.fdz.dzhw.eu/

## Big Thanks

Expand Down
30 changes: 15 additions & 15 deletions deploy/build-and-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
#!/bin/bash
# this script builds the project with a given profile and deploys it
# to the correct space in cloudfoundry
# to Amazon ECR and AWS Fargate
if [[ $0 != ./deploy/* ]]; then
echo "Please run this script from the root of our repository!"
exit -1
fi
PROFILE="$1"
USERNAME="$2"
PASSWORD="$3"
TRAVIS_BRANCH="$4"
TRAVIS_BRANCH="$2"
if [ -n "${TRAVIS_BRANCH}" ]; then
PROFILE="dev"
fi
Expand All @@ -22,23 +20,25 @@ if [ -z ${PROFILE} ]; then
echo "Please provide a valid profile e.g.: $0 dev"
exit -1
fi
echo "Going to run maven build and cloudfoundry deployment with profile: ${PROFILE}"
if [ -z ${USERNAME} ] || [ -z ${PASSWORD} ]; then
cf login -o DZHW -s ${PROFILE} -a https://api.run.pivotal.io
else
cf login -o DZHW -s ${PROFILE} -u ${USERNAME} -p ${PASSWORD} -a https://api.run.pivotal.io
fi
echo "Going to run maven build with profile: ${PROFILE}"
mvn --settings .travis.settings.xml --no-transfer-progress -P${PROFILE} clean install
if [ $? -ne 0 ]; then
echo "cf login failed!"
echo "Maven build failed!"
exit -1
fi
mvn --settings .travis.settings.xml --no-transfer-progress -P${PROFILE} clean package
AWS_CRED=($(aws sts assume-role --role-arn arn:aws:iam::347729458675:role/Admin --role-session-name travis-deployment --query 'Credentials.[AccessKeyId,SecretAccessKey,SessionToken]' --output text))
export AWS_ACCESS_KEY_ID=${AWS_CRED[0]}
export AWS_SECRET_ACCESS_KEY=${AWS_CRED[1]}
export AWS_SESSION_TOKEN=${AWS_CRED[2]}
$(aws ecr get-login --no-include-email --region eu-central-1)
mvn -P${PROFILE} dockerfile:push dockerfile:push@push-image-latest
if [ $? -ne 0 ]; then
echo "Maven build failed!"
echo "Maven Docker push failed!"
exit -1
fi
cf push -f ./deploy/manifest-${PROFILE}.yml -s cflinuxfs3
aws ecs list-tasks --cluster ${PROFILE} --service metadatamanagement | jq -r ".taskArns[]" | awk -v profile=${PROFILE} '{print "aws ecs stop-task --cluster "profile " --task \""$0"\""}' | sh
aws ecs list-tasks --cluster ${PROFILE} --service metadatamanagement-worker | jq -r ".taskArns[]" | awk -v profile=${PROFILE} '{print "aws ecs stop-task --cluster "profile " --task \""$0"\""}' | sh
if [ $? -ne 0 ]; then
echo "cf push failed!"
echo "Task redeployment failed!"
exit -1
fi
8 changes: 5 additions & 3 deletions deploy/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ if [[ $0 != ./deploy/* ]]; then
exit -1
fi
PROFILE="$1"
TRAVIS_BRANCH="$4"
COVERALLS_TOKEN="$5"
TRAVIS_BRANCH="$2"
if [ "${PROFILE}" = "unused" ]; then
PROFILE="dev"
fi
if [ "${TRAVIS_BRANCH}" = "test" ]; then
PROFILE="test"
fi
if [ "${TRAVIS_BRANCH}" = "master" ]; then
PROFILE="prod"
fi
Expand All @@ -18,7 +20,7 @@ if [ -z ${PROFILE} ]; then
exit -1
fi
echo "Going to run maven build with profile: ${PROFILE}"
mvn --settings .travis.settings.xml --no-transfer-progress -P${PROFILE} clean package
mvn --settings .travis.settings.xml --no-transfer-progress -P${PROFILE} clean install
if [ $? -ne 0 ]; then
echo "Maven build failed!"
exit -1
Expand Down
35 changes: 0 additions & 35 deletions deploy/deploy.sh

This file was deleted.

27 changes: 0 additions & 27 deletions deploy/manifest-dev.yml

This file was deleted.

29 changes: 0 additions & 29 deletions deploy/manifest-prod.yml

This file was deleted.

27 changes: 0 additions & 27 deletions deploy/manifest-test.yml

This file was deleted.

6 changes: 6 additions & 0 deletions deploy/unjar.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash
# unjar the spring boot fat jar
JAR="$1"
mkdir -p target/app
cd target/app
jar -xf ../${JAR}
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
ports:
- "27017:27017"
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.3.2
image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0
container_name: elasticsearch
environment:
- discovery.type=single-node
Expand Down
2 changes: 1 addition & 1 deletion docs/source/issues_testen.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Testen von MDM-Issues
=====================

Issues des metadatamanagement-Repos werden im Testsystem getestet:
https://metadatamanagement-test.cfapps.io Für einige Issues ist eine
https://test.metadata.fdz.dzhw.eu Für einige Issues ist eine
Anmeldung notwendig.

Wie genau beim Testen vorzugehen ist, hängt stark vom jeweiligen Issue
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"bowser": "https://github.com/lancedikson/bowser/archive/1.9.4.tar.gz",
"cheet.js": "0.3.3",
"clientjs": "0.1.11",
"elasticsearch-browser": "https://github.com/elastic/bower-elasticsearch-js/archive/v16.4.0.tar.gz",
"elasticsearch-browser": "https://github.com/elastic/bower-elasticsearch-js/archive/v16.7.1.tar.gz",
"es5-shim": "4.5.14",
"es6-shim": "0.35.5",
"fdz-paginator": "1.0.9",
Expand Down
Loading

0 comments on commit 38fafb9

Please sign in to comment.