Skip to content

Commit

Permalink
Merge branch 'release-0.7.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
psp committed Oct 26, 2019
2 parents e2d2919 + 79bd1b0 commit 28f15c8
Show file tree
Hide file tree
Showing 356 changed files with 113,499 additions and 1,800 deletions.
117 changes: 117 additions & 0 deletions .mvn/wrapper/MavenWrapperDownloader.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
/*
* Copyright 2007-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.net.*;
import java.io.*;
import java.nio.channels.*;
import java.util.Properties;

public class MavenWrapperDownloader {

private static final String WRAPPER_VERSION = "0.5.5";
/**
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
*/
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";

/**
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
* use instead of the default one.
*/
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
".mvn/wrapper/maven-wrapper.properties";

/**
* Path where the maven-wrapper.jar will be saved to.
*/
private static final String MAVEN_WRAPPER_JAR_PATH =
".mvn/wrapper/maven-wrapper.jar";

/**
* Name of the property which should be used to override the default download url for the wrapper.
*/
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";

public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());

// If the maven-wrapper.properties exists, read it and check if it contains a custom
// wrapperUrl parameter.
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
String url = DEFAULT_DOWNLOAD_URL;
if(mavenWrapperPropertyFile.exists()) {
FileInputStream mavenWrapperPropertyFileInputStream = null;
try {
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
Properties mavenWrapperProperties = new Properties();
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
} catch (IOException e) {
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
} finally {
try {
if(mavenWrapperPropertyFileInputStream != null) {
mavenWrapperPropertyFileInputStream.close();
}
} catch (IOException e) {
// Ignore ...
}
}
}
System.out.println("- Downloading from: " + url);

File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
if(!outputFile.getParentFile().exists()) {
if(!outputFile.getParentFile().mkdirs()) {
System.out.println(
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
}
}
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
try {
downloadFileFromURL(url, outputFile);
System.out.println("Done");
System.exit(0);
} catch (Throwable e) {
System.out.println("- Error downloading");
e.printStackTrace();
System.exit(1);
}
}

private static void downloadFileFromURL(String urlString, File destination) throws Exception {
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
String username = System.getenv("MVNW_USERNAME");
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
Authenticator.setDefault(new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(username, password);
}
});
}
URL website = new URL(urlString);
ReadableByteChannel rbc;
rbc = Channels.newChannel(website.openStream());
FileOutputStream fos = new FileOutputStream(destination);
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
fos.close();
rbc.close();
}

}
2 changes: 2 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.1/apache-maven-3.6.1-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.5/maven-wrapper-0.5.5.jar
133 changes: 113 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,49 @@
language: java

jdk:
- oraclejdk8

# Using bash because Travis CI does not support Java on Windows
sudo: required

services:
- docker

# travis is quite limited for multi-language projects when one needs to share artifacts:
# https://github.com/travis-ci/travis-ci/issues/4090
branches:
except:
- gh-pages
env:
global:
# This is a convenience variable for shortening download commands
- GRAVIS="https://raw.githubusercontent.com/DanySK/Gravis-CI/master/"
- JDK="graalvm@19.2.0"
# DOCKERHUB_USER
- secure: "VfQm2li2nQueRUtyVnV+BDaIjp27ydXltWsoYIZha0MdkItAnhdmQSvICKjD1PCr4kI17o1lPnUPhX1khBUWpQftPFCAcD1bbeAW0AHRVtF2fWL460R+o3C93jqlqKYczo7DWr4nKaMQ0HDZEGa1QcMuyeQA1S4CGdPmrkHk3N5PAflFF1myrCUSCzqV8+lp0w4CxCdScVYGYlQwahdLHrLNZbCo/Nxiex5XrOYrqLTaU98EoxmKlZaR4klg2/pJENgZ6NbZb8JfFaPkEYsmF5z4w2Cf5mp9PPJLnBuKLO/zhKTXpjz2hjhGpncEqFTHrxIpoY/jFrewB5t09a9lykpFHlXpvujZq1S7xNzOBTj9X6TnU4oyK1oteb6CW9A+hpyJVPPMQ2JrrkKzTaEQpel5q45unthStdvAVvl/BjrjVpzffbnaLXKomTzKjuW7VW3Q5mVIRD7UBVAn2izszaN2Lp05JKKxk+aYAsvywCL/bopI/nsugZz9mOhTFq7uf2Cvj6Ku6Hmzh/7fp/0no0tLr251a9nN7yoe2xbwL/524lnyQd2lHcwWfleCbwPFoZUtg+qBUXqf0EiRp6xj7fnl3kK/crXWcsWyrru33EgbRjuRzZVA2ShGVs9Yb8cKalXHouZ2deW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uV/TES2QRj620pKq/z+BovRhKcgOHNprEDcR1eDJtJ27FQXSosZTK4LQuOYq6zntKKztQtfIHa1wa5peIts1EFRiVwRi0KrP0UwewBkb8aYHbkkj2t6jgNJZB4HGBxBKcwgloHoZmVqhL12MULnB3QWx48nPVhhqXqDXX2qMvg/G2nLgdnKkzkbBWOIssG0wMs6+QSVFInWZ5/VflSxlZ3hAuqX+Dbily1qzFzBST7d2WohUlZDp+8pZ7IjeTcSHbVvS7RHj+FMpn1KxF+RwB79R6yit9LcKbB+rytFwvjP9swFrrpRN8DkGrhHpMo="

### This section represents primary build actions
before_install:
- curl -L https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz > oc-cli.tar.gz
- tar -xzf oc-cli.tar.gz
- sudo mv ./openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc /usr/local/bin

# preparations to build frontend
install:
- nvm install 11.12.0
- npm install -g @angular/cli
- cd frontend/datasafe-ui && npm install && cd ../..

script:
- mvn --settings .travis/settings.xml clean verify -B -V -DAWS_BUCKET=${AWS_BUCKET}
# make frontend available for REST-docker
# make frontend available for REST-docker
- cd frontend/datasafe-ui && ng build --deploy-url /static/ --base-href /static/ && mv dist ../../datasafe-rest-impl/target/dist && cd ../..

before_deploy:
- openssl aes-256-cbc -K $encrypted_f1acb3064675_key -iv $encrypted_f1acb3064675_iv -in .travis/sign.gpg.enc -out .travis/sign.gpg -d

deploy:
- provider: script
skip_cleanup: true
Expand All @@ -38,16 +66,81 @@ deploy:
tags: true
condition: "$TRAVIS_TAG =~ ^v([[:digit:]]+\\.)+[[:digit:]]+(-[[:digit:]]+)?(-SNAPSHOT)?$"

before_install:
- curl -L https://github.com/openshift/origin/releases/download/v3.11.0/openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit.tar.gz > oc-cli.tar.gz
- tar -xzf oc-cli.tar.gz
- sudo mv ./openshift-origin-client-tools-v3.11.0-0cbc58b-linux-64bit/oc /usr/local/bin

# preparations to build frontend
install:
- nvm install 11.12.0
- npm install -g @angular/cli
- cd frontend/datasafe-ui && npm install && cd ../..

after_success:
- /bin/bash .travis/codecov_bash.sh

################ Custom build stages:
# Special test-skipping stage to build CLI, using maven-wrapper

build-cli: &build-cli
script:
# re-export JAVA_HOME
- source ~/.jdk_config
# Prepare everything, no settings.xml needed
- ./mvnw clean install -B -V -DskipTests
# Change security providers of JDK
- /bin/bash .travis/enable_bouncycastle_security.sh
# Build native image, no settings.xml needed
- ./mvnw -f datasafe-cli/pom.xml clean package -B -V -Pnative-image -DskipTests
# Perform basic testing
- echo 'Testing built CLI'
- ./datasafe-cli/src/test/bash/basic_functionality_test_fs.sh datasafe-cli/target/datasafe-cli
# Docker not available on MacOS, allow to pass
- ./datasafe-cli/src/test/bash/basic_functionality_test_minio.sh datasafe-cli/target/datasafe-cli

# CLI artifacts publishing:
deploy-cli: &deploy-cli
deploy:
on:
branch: develop
provider: s3
access_key_id: ${AWS_ACCESS_KEY_ID}
secret_access_key: ${AWS_SECRET_ACCESS_KEY}
bucket: ${AWS_BUCKET}
region: ${AWS_REGION}
skip_cleanup: true
local_dir: datasafe-cli/target
upload-dir: datasafe-cli/${TRAVIS_OS_NAME}/${TRAVIS_COMMIT}

################ Build matrix:
# Build configuration definition:
matrix:
include:

#### PRIMARY BUILD ####
# This is original build and deploy script, that runs E2E tests and deploys docker images
- os: linux
language: java
jdk: openjdk8


#### CLI-ORIENTED BUILD ####
# These are CLI-only builds that produce Datasafe cli executable for each OS:

### CLI for Linux:
- os: linux
language: bash
before_install:
- source .travis/drop_deploy_secrets.sh
- /bin/bash .travis/install_custom_jdk_and_add_security_providers.sh
install:
- echo 'Nothing to do' # Override primary build logic
<<: *build-cli
<<: *deploy-cli
after_success:
- echo 'Nothing to do' # Override primary build logic

### CLI for MacOS:
- os: osx
language: bash
before_install:
- source .travis/drop_deploy_secrets.sh
- /bin/bash .travis/install_custom_jdk_and_add_security_providers.sh
install:
- echo 'Nothing to do' # Override primary build logic
<<: *build-cli
<<: *deploy-cli
after_success:
- echo 'Nothing to do' # Override primary build logic

# No WINDOWS here because it is in beta status yet.
1 change: 1 addition & 0 deletions .travis/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env bash

echo "$GPG_SECRET_KEY" | base64 --decode | "$GPG_EXECUTABLE" --import
echo "$GPG_OWNERTRUST" | base64 --decode | "$GPG_EXECUTABLE" --import-ownertrust

Expand Down
11 changes: 11 additions & 0 deletions .travis/drop_deploy_secrets.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

export GPG_OWNERTRUST=''
export GPG_SECRET_KEY=''
export GPG_PASSPHRASE=''
export OPENSHIFT_USER=''
export OPENSHIFT_PASSWORD=''
export DOCKERHUB_USER=''
export DOCKERHUB_PASS=''
export SONATYPE_USERNAME=''
export SONATYPE_PASSWORD=''
22 changes: 22 additions & 0 deletions .travis/enable_bouncycastle_security.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

# SED flavors in-place replacement handling:
SED_I_EXEC="sed -i"
if [[ "$OSTYPE" == "darwin"* ]]; then
# Mac OSX
SED_I_EXEC="sed -i ''"
fi

# 3. Adds BouncyCastle Provider to JDK security providers
# 4. Adds BouncyCastle TLS to JDK security providers
# 5. Removes SunEC security provider to use SSL from BouncyCastle


# 3. Add BouncyCastle Provider to JDK security providers at place 2 (should replace sun.security.rsa.SunRsaSign)
$SED_I_EXEC "s/security\.provider\.2=.*/security.provider.2=org.bouncycastle.jce.provider.BouncyCastleProvider/g" "$JAVA_HOME/jre/lib/security/java.security"

# 4. Add BouncyCastle TLS to JDK security providers at place 3 (should replace sun.security.ec.SunEC and come before com.sun.net.ssl.internal.ssl.Provider)
$SED_I_EXEC "s/security\.provider\.3=.*/security.provider.3=org.bouncycastle.jsse.provider.BouncyCastleJsseProvider/g" "$JAVA_HOME/jre/lib/security/java.security"

# 5. Remove SunEC security provider (if it still exists)
$SED_I_EXEC "s/security\.provider\..*=sun\.security\.ec\.SunEC//g" "$JAVA_HOME/jre/lib/security/java.security"
35 changes: 35 additions & 0 deletions .travis/install_custom_jdk_and_add_security_providers.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# This script:
# 1. Installs custom JDK.
# 2. Downloads BouncyCastle security provider and TLS libs. (to use native java SSL)

REPO_ROOT=`pwd`

# 1. Custom JDK
curl "${GRAVIS}.install-jdk-travis.sh" --output ~/.install-jdk-travis.sh
source ~/.install-jdk-travis.sh

cd "$REPO_ROOT" || exit 1

# 2. BC libs - download
# 2.1 Parse BouncyCastle version
BC_VERSION=`grep "<bouncycastle\.version>.*</bouncycastle\.version>" pom.xml | cut -d">" -f2 | cut -d"<" -f1`

# 2.2 Download BC jars needed
curl "https://repo1.maven.org/maven2/org/bouncycastle/bcprov-jdk15on/${BC_VERSION}/bcprov-jdk15on-${BC_VERSION}.jar" \
--output "$JAVA_HOME/jre/lib/ext/bcprov-jdk15on-${BC_VERSION}.jar"

curl "https://repo1.maven.org/maven2/org/bouncycastle/bctls-jdk15on/${BC_VERSION}/bctls-jdk15on-${BC_VERSION}.jar" \
--output "$JAVA_HOME/jre/lib/ext/bctls-jdk15on-${BC_VERSION}.jar"

# Windows does not have Graal Updater (gu) tool, so we install native-image manually
if [[ "$TRAVIS_OS_NAME" == "windows"* ]]; then
# TODO
echo "Windows, nothing to do"
else
# Install native image builder
gu install native-image
fi


Binary file added .travis/sign.gpg.enc
Binary file not shown.
Loading

0 comments on commit 28f15c8

Please sign in to comment.