Skip to content

Commit 8db30ab

Browse files
authored
WIP: First revision of integrations subprojects (helidon-io#109)
First revision of integrations subprojects
1 parent 8fbafbd commit 8db30ab

116 files changed

Lines changed: 9016 additions & 56 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
*~
12
*.class
23
*.ctxt
34
.mtj.tmp/

etc/scripts/build.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ if [ "${WERCKER}" = "true" ] ; then
4343
apt-get update && apt-get -y install graphviz
4444
fi
4545

46+
inject_credentials
47+
4648
mvn -f ${WS_DIR}/pom.xml \
4749
clean install \
48-
-Pexamples,spotbugs,javadoc,docs,sources,ossrh-releases \
49-
--fail-at-end
50+
-Pexamples,spotbugs,javadoc,docs,sources,ossrh-releases
5051

51-
examples/archetypes/test-archetypes.sh
52+
examples/archetypes/test-archetypes.sh

etc/scripts/release.sh

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -181,55 +181,6 @@ update_version(){
181181
fi
182182
}
183183

184-
inject_credentials(){
185-
# Add private_key from IDENTITY_FILE
186-
if [ -n "${IDENTITY_FILE}" ] && [ ! -e ~/.ssh ]; then
187-
mkdir ~/.ssh/ 2>/dev/null || true
188-
echo -e "${IDENTITY_FILE}" > ~/.ssh/id_rsa
189-
chmod og-rwx ~/.ssh/id_rsa
190-
echo -e "Host *" >> ~/.ssh/config
191-
echo -e "\tStrictHostKeyChecking no" >> ~/.ssh/config
192-
echo -e "\tUserKnownHostsFile /dev/null" >> ~/.ssh/config
193-
fi
194-
195-
# Add GPG key pair
196-
if [ -n "${GPG_PUBLIC_KEY}" ] && [ -n "${GPG_PRIVATE_KEY}" ] ; then
197-
mkdir ~/.gnupg 2>/dev/null || true
198-
chmod 700 ~/.gnupg
199-
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
200-
echo -e "${GPG_PUBLIC_KEY}" > ~/.gnupg/helidon_pub.gpg
201-
gpg --import --no-tty --batch ~/.gnupg/helidon_pub.gpg
202-
echo -e "${GPG_PRIVATE_KEY}" > ~/.gnupg/helidon_sec.gpg
203-
gpg --allow-secret-key-import --import --no-tty --batch ~/.gnupg/helidon_sec.gpg
204-
fi
205-
206-
# Add docker config from DOCKER_CONFIG_FILE
207-
if [ -n "${DOCKER_CONFIG_FILE}" ] && [ ! -e ~/.docker ]; then
208-
mkdir ~/.docker/ 2>/dev/null || true
209-
printf "${DOCKER_CONFIG_FILE}" > ~/.docker/config.json
210-
chmod og-rwx ~/.docker/config.json
211-
fi
212-
213-
# Add maven settings from MAVEN_SETTINGS_FILE
214-
if [ -n "${MAVEN_SETTINGS_FILE}" ] ; then
215-
mkdir ~/.m2/ 2>/dev/null || true
216-
echo -e "${MAVEN_SETTINGS_FILE}" > ~/.m2/settings.xml
217-
fi
218-
219-
# Add maven settings security from MAVEN_SETTINGS_SECURITY_FILE
220-
if [ -n "${MAVEN_SETTINGS_SECURITY_FILE}" ] ; then
221-
mkdir ~/.m2/ 2>/dev/null || true
222-
echo -e "${MAVEN_SETTINGS_SECURITY_FILE}" > ~/.m2/settings-security.xml
223-
fi
224-
225-
# Add maven settings security from MAVEN_SETTINGS_SECURITY_FILE
226-
# Only if none exist on the system
227-
if [ -n "${MAVEN_SETTINGS_SECURITY_FILE}" ] && [ ! -e ~/.m2/settings-security.xml ]; then
228-
mkdir ~/.m2/ 2>/dev/null || true
229-
echo "${MAVEN_SETTINGS_SECURITY_FILE}" > ~/.m2/settings-security.xml
230-
fi
231-
}
232-
233184
release_build(){
234185
# Inject credentials in CI env
235186
inject_credentials

etc/scripts/wercker-env.sh

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,70 @@
1717

1818
# WERCKER=true when running inside a wercker pipeline
1919

20+
inject_credentials(){
21+
# Add private_key from IDENTITY_FILE
22+
if [ -n "${IDENTITY_FILE}" ] && [ ! -e ~/.ssh ]; then
23+
mkdir ~/.ssh/ 2>/dev/null || true
24+
echo -e "${IDENTITY_FILE}" > ~/.ssh/id_rsa
25+
chmod og-rwx ~/.ssh/id_rsa
26+
echo -e "Host *" >> ~/.ssh/config
27+
echo -e "\tStrictHostKeyChecking no" >> ~/.ssh/config
28+
echo -e "\tUserKnownHostsFile /dev/null" >> ~/.ssh/config
29+
fi
30+
31+
# Add GPG key pair
32+
if [ -n "${GPG_PUBLIC_KEY}" ] && [ -n "${GPG_PRIVATE_KEY}" ] ; then
33+
mkdir ~/.gnupg 2>/dev/null || true
34+
chmod 700 ~/.gnupg
35+
echo "pinentry-mode loopback" > ~/.gnupg/gpg.conf
36+
echo -e "${GPG_PUBLIC_KEY}" > ~/.gnupg/helidon_pub.gpg
37+
gpg --import --no-tty --batch ~/.gnupg/helidon_pub.gpg
38+
echo -e "${GPG_PRIVATE_KEY}" > ~/.gnupg/helidon_sec.gpg
39+
gpg --allow-secret-key-import --import --no-tty --batch ~/.gnupg/helidon_sec.gpg
40+
fi
41+
42+
# Add docker config from DOCKER_CONFIG_FILE
43+
if [ -n "${DOCKER_CONFIG_FILE}" ] && [ ! -e ~/.docker ]; then
44+
mkdir ~/.docker/ 2>/dev/null || true
45+
printf "${DOCKER_CONFIG_FILE}" > ~/.docker/config.json
46+
chmod og-rwx ~/.docker/config.json
47+
fi
48+
49+
# Add maven settings from MAVEN_SETTINGS_FILE
50+
if [ -n "${MAVEN_SETTINGS_FILE}" ] ; then
51+
mkdir ~/.m2/ 2>/dev/null || true
52+
echo -e "${MAVEN_SETTINGS_FILE}" > ~/.m2/settings.xml
53+
fi
54+
55+
# Add maven settings security from MAVEN_SETTINGS_SECURITY_FILE
56+
# Only if none exist on the system
57+
if [ -n "${MAVEN_SETTINGS_SECURITY_FILE}" ] && [ ! -e ~/.m2/settings-security.xml ]; then
58+
mkdir ~/.m2/ 2>/dev/null || true
59+
echo "${MAVEN_SETTINGS_SECURITY_FILE}" > ~/.m2/settings-security.xml
60+
fi
61+
}
62+
2063
if [ "${WERCKER}" = "true" ] ; then
21-
export MAVEN_OPTS="-Dmaven.repo.local=${WERCKER_CACHE_DIR}/local_repository"
64+
export MAVEN_OPTS="-Dmaven.repo.local=${WERCKER_CACHE_DIR}/local_repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn"
2265
rm -rf ~/.m2/settings* ~/.gitconfig ~/.ssh ${WERCKER_CACHE_DIR}/local_repository/io/helidon
66+
# Work around https://github.com/oracle/oci-java-sdk/issues/25
67+
TEMP_OCI_SDK_DIR=$(mktemp -d "oci-java-sdk.XXX")
68+
git clone \
69+
--depth 1 \
70+
--branch \
71+
v$(mvn -B -f "${WERCKER_ROOT}/pom.xml" \
72+
-Dexpression=version.lib.oci-java-sdk-objectstorage org.apache.maven.plugins:maven-help-plugin:3.1.0:evaluate | grep '^[0-9]') \
73+
"https://github.com/oracle/oci-java-sdk.git" \
74+
"${TEMP_OCI_SDK_DIR}" && \
75+
mvn -B -U -f "${TEMP_OCI_SDK_DIR}/pom.xml" \
76+
-Dmaven.test.skip=true \
77+
-Dmaven.source.skip=true \
78+
-Dmaven.javadoc.skip=true \
79+
-Dlombok.delombok.skip=true \
80+
-pl bmc-objectstorage \
81+
-am \
82+
install && \
83+
rm -rf "${TEMP_OCI_SDK_DIR}"
2384
fi
85+
86+
Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
4+
Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved.
5+
6+
Licensed under the Apache License, Version 2.0 (the "License");
7+
you may not use this file except in compliance with the License.
8+
You may obtain a copy of the License at
9+
10+
http://www.apache.org/licenses/LICENSE-2.0
11+
12+
Unless required by applicable law or agreed to in writing, software
13+
distributed under the License is distributed on an "AS IS" BASIS,
14+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
See the License for the specific language governing permissions and
16+
limitations under the License.
17+
18+
-->
19+
<project xmlns="http://maven.apache.org/POM/4.0.0"
20+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
22+
http://maven.apache.org/xsd/maven-4.0.0.xsd">
23+
<modelVersion>4.0.0</modelVersion>
24+
25+
<artifactId>helidon-integrations-examples-datasource-hikaricp</artifactId>
26+
27+
<name>Helidon Integrations: DataSource/HikariCP Example</name>
28+
<description>Helidon Integrations DataSource Hikari Connection Pool Example</description>
29+
30+
<parent>
31+
<groupId>io.helidon.integrations.examples</groupId>
32+
<artifactId>helidon-integrations-examples-project</artifactId>
33+
<version>0.10.3-SNAPSHOT</version>
34+
</parent>
35+
36+
<dependencyManagement>
37+
<dependencies>
38+
<dependency>
39+
<groupId>io.helidon.integrations.cdi</groupId>
40+
<artifactId>helidon-integrations-cdi-datasource-hikaricp</artifactId>
41+
<version>${project.version}</version>
42+
</dependency>
43+
</dependencies>
44+
</dependencyManagement>
45+
46+
<dependencies>
47+
48+
<!-- Test-scoped dependencies. -->
49+
50+
<dependency>
51+
<groupId>org.junit.jupiter</groupId>
52+
<artifactId>junit-jupiter-api</artifactId>
53+
<scope>test</scope>
54+
</dependency>
55+
56+
<dependency>
57+
<groupId>org.hamcrest</groupId>
58+
<artifactId>hamcrest-all</artifactId>
59+
<scope>test</scope>
60+
</dependency>
61+
62+
<!-- Runtime-scoped dependencies. -->
63+
64+
<dependency>
65+
<groupId>com.oracle.jdbc</groupId>
66+
<artifactId>ojdbc8</artifactId>
67+
<scope>runtime</scope>
68+
</dependency>
69+
70+
<dependency>
71+
<groupId>org.jboss.weld.se</groupId>
72+
<artifactId>weld-se-core</artifactId>
73+
<scope>runtime</scope>
74+
<exclusions>
75+
<exclusion>
76+
<groupId>org.jboss.spec.javax.el</groupId>
77+
<artifactId>jboss-el-api_3.0_spec</artifactId>
78+
</exclusion>
79+
<exclusion>
80+
<groupId>org.jboss.spec.javax.interceptor</groupId>
81+
<artifactId>jboss-interceptors-api_1.2_spec</artifactId>
82+
</exclusion>
83+
</exclusions>
84+
</dependency>
85+
86+
<dependency>
87+
<groupId>io.helidon.integrations.cdi</groupId>
88+
<artifactId>helidon-integrations-cdi-datasource-hikaricp</artifactId>
89+
<scope>runtime</scope>
90+
</dependency>
91+
92+
<dependency>
93+
<groupId>org.jboss</groupId>
94+
<artifactId>jandex</artifactId>
95+
<scope>runtime</scope>
96+
</dependency>
97+
98+
<dependency>
99+
<groupId>io.helidon.microprofile.server</groupId>
100+
<artifactId>helidon-microprofile-server</artifactId>
101+
<scope>runtime</scope>
102+
<exclusions>
103+
<exclusion>
104+
<groupId>org.glassfish.hk2.external</groupId>
105+
<artifactId>javax.inject</artifactId>
106+
</exclusion>
107+
</exclusions>
108+
</dependency>
109+
110+
<dependency>
111+
<groupId>io.helidon.microprofile.config</groupId>
112+
<artifactId>helidon-microprofile-config-cdi</artifactId>
113+
<scope>runtime</scope>
114+
</dependency>
115+
116+
<dependency>
117+
<groupId>javax.activation</groupId>
118+
<artifactId>javax.activation-api</artifactId>
119+
<scope>runtime</scope>
120+
</dependency>
121+
122+
<!-- Compile-scoped dependencies. -->
123+
124+
<dependency>
125+
<groupId>javax.enterprise</groupId>
126+
<artifactId>cdi-api</artifactId>
127+
<scope>compile</scope>
128+
</dependency>
129+
130+
<dependency>
131+
<groupId>javax.ws.rs</groupId>
132+
<artifactId>javax.ws.rs-api</artifactId>
133+
<scope>compile</scope>
134+
</dependency>
135+
136+
<dependency>
137+
<groupId>redis.clients</groupId>
138+
<artifactId>jedis</artifactId>
139+
<scope>compile</scope>
140+
</dependency>
141+
142+
<dependency>
143+
<groupId>org.eclipse.microprofile.config</groupId>
144+
<artifactId>microprofile-config-api</artifactId>
145+
<scope>compile</scope>
146+
</dependency>
147+
148+
</dependencies>
149+
150+
<build>
151+
<resources>
152+
<resource>
153+
<directory>src/main/resources</directory>
154+
<filtering>true</filtering>
155+
</resource>
156+
</resources>
157+
<plugins>
158+
<plugin>
159+
<artifactId>maven-dependency-plugin</artifactId>
160+
<executions>
161+
<execution>
162+
<id>Copy all project dependencies to ${project.build.directory}/${dependenciesDirectory} for Docker image construction</id>
163+
<phase>prepare-package</phase>
164+
<goals>
165+
<goal>copy-dependencies</goal>
166+
</goals>
167+
<configuration>
168+
<outputDirectory>${project.build.directory}/${dependenciesDirectory}</outputDirectory>
169+
<overWriteReleases>false</overWriteReleases>
170+
<overWriteSnapshots>false</overWriteSnapshots>
171+
<overWriteIfNewer>true</overWriteIfNewer>
172+
<overWriteIfNewer>true</overWriteIfNewer>
173+
<includeScope>runtime</includeScope>
174+
<excludeScope>test</excludeScope>
175+
</configuration>
176+
</execution>
177+
</executions>
178+
</plugin>
179+
<plugin>
180+
<artifactId>maven-jar-plugin</artifactId>
181+
<configuration>
182+
<archive>
183+
<manifest>
184+
<addClasspath>true</addClasspath>
185+
<classpathPrefix>${dependenciesDirectory}</classpathPrefix>
186+
<mainClass>io.helidon.microprofile.server.Main</mainClass>
187+
</manifest>
188+
</archive>
189+
</configuration>
190+
</plugin>
191+
<plugin>
192+
<artifactId>maven-resources-plugin</artifactId>
193+
<executions>
194+
<execution>
195+
<id>Copy Dockerfile and Kubernetes resources</id>
196+
<phase>process-resources</phase>
197+
<goals>
198+
<goal>copy-resources</goal>
199+
</goals>
200+
<configuration>
201+
<outputDirectory>${project.build.directory}</outputDirectory>
202+
<resources>
203+
<resource>
204+
<directory>src/main/docker</directory>
205+
<filtering>true</filtering>
206+
<includes>
207+
<include>Dockerfile</include>
208+
</includes>
209+
</resource>
210+
<resource>
211+
<filtering>true</filtering>
212+
<directory>src/main/k8s</directory>
213+
<includes>
214+
<include>datasource.secrets.template</include>
215+
<include>app.yaml</include>
216+
</includes>
217+
</resource>
218+
</resources>
219+
</configuration>
220+
</execution>
221+
</executions>
222+
</plugin>
223+
<plugin>
224+
<artifactId>maven-surefire-plugin</artifactId>
225+
<configuration>
226+
<systemPropertyVariables>
227+
</systemPropertyVariables>
228+
</configuration>
229+
</plugin>
230+
</plugins>
231+
</build>
232+
233+
<properties>
234+
<dependenciesDirectory>libs</dependenciesDirectory>
235+
<kubernetesSecretName>${project.artifactId}</kubernetesSecretName>
236+
<spotbugs.exclude>${project.basedir}/src/main/spotbugs/exclusions.xml</spotbugs.exclude>
237+
</properties>
238+
239+
</project>

0 commit comments

Comments
 (0)