Skip to content

Commit

Permalink
Initial attempt at codeship CI integration
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartwdouglas committed Sep 24, 2018
1 parent 9fc0f9c commit 352a9f9
Show file tree
Hide file tree
Showing 11 changed files with 238 additions and 100 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
target
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM swd847/centos-graal-maven
ENV DATABASE_URL=jdbc:postgresql:hibernate_orm_test
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app
ENTRYPOINT ["mvn", "-Dno-postgres"]


17 changes: 17 additions & 0 deletions codeship-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
shamrock:
build:
image: swd847/shamrock
dockerfile: Dockerfile
depends_on:
- postgres
environment:
- DATABASE_URL=jdbc:postgresql://postgres/hibernate_orm_test
# volumes:
# - /Users/stuart/.m2:/root/.m2
postgres:
image: healthcheck/postgres:alpine
environment:
POSTGRES_USER: hibernate_orm_test
POSTGRES_PASSWORD: hibernate_orm_test
POSTGRES_DB: hibernate_orm_test

3 changes: 3 additions & 0 deletions codeship-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- name: ci
service: shamrock
command: install
13 changes: 13 additions & 0 deletions docker/centos-graal-maven/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM swd847/centos-graal

ARG MAVEN_VERSION=3.3.9
ARG USER_HOME_DIR="/root"
RUN mkdir -p /usr/share/maven && \
curl -fsSL http://apache.osuosl.org/maven/maven-3/$MAVEN_VERSION/binaries/apache-maven-$MAVEN_VERSION-bin.tar.gz | tar -xzC /usr/share/maven --strip-components=1 && \
ln -s /usr/share/maven/bin/mvn /usr/bin/mvn
ENV MAVEN_HOME /usr/share/maven
ENV MAVEN_CONFIG "$USER_HOME_DIR/.m2"
# speed up Maven JVM a bit
ENV MAVEN_OPTS="-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
#ENTRYPOINT ["/usr/bin/mvn"]

21 changes: 21 additions & 0 deletions docker/centos-graal/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM centos:latest

ARG GRAAL_VERSION
ENV GRAAL_VERSION=${GRAAL_VERSION:-1.0.0-rc6}
ENV GRAAL_CE_URL=https://github.com/oracle/graal/releases/download/vm-${GRAAL_VERSION}/graalvm-ce-${GRAAL_VERSION}-linux-amd64.tar.gz

ENV JAVA_HOME=/opt/graalvm
ENV PATH=$PATH:$JAVA_HOME/bin
ENV GRAALVM_HOME=/opt/graalvm


RUN yum update -y && \
yum install -y tar gzip gcc glibc-devel zlib-devel curl && \
mkdir -p /opt/graalvm && \
cd /opt/graalvm && \
curl -fsSL $GRAAL_CE_URL | tar -xzC /opt/graalvm --strip-components=1





117 changes: 68 additions & 49 deletions examples/jpa-strict/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>${project.groupId}</groupId>
Expand All @@ -61,55 +67,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.26.1</version>
<configuration>
<images>
<image>
<name>postgres:10.5</name>
<alias>postgresql</alias>
<run>
<env>
<POSTGRES_USER>hibernate_orm_test</POSTGRES_USER>
<POSTGRES_PASSWORD>hibernate_orm_test</POSTGRES_PASSWORD>
<POSTGRES_DB>hibernate_orm_test</POSTGRES_DB>
</env>
<ports>
<port>5432:5432</port>
</ports>
<wait>
<tcp>
<mode>mapped</mode>
<ports>
<port>5432</port>
</ports>
</tcp>
<time>10000</time>
</wait>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-start</id>
<phase>compile</phase>
<goals>
<goal>stop</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>docker-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -167,6 +124,68 @@
</plugins>
</build>
</profile>

<profile>
<id>postgres</id>
<activation>
<property>
<name>!no-postgres</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.26.1</version>
<configuration>
<images>
<image>
<name>postgres:10.5</name>
<alias>postgresql</alias>
<run>
<env>
<POSTGRES_USER>hibernate_orm_test</POSTGRES_USER>
<POSTGRES_PASSWORD>hibernate_orm_test</POSTGRES_PASSWORD>
<POSTGRES_DB>hibernate_orm_test</POSTGRES_DB>
</env>
<ports>
<port>5432:5432</port>
</ports>
<wait>
<tcp>
<mode>mapped</mode>
<ports>
<port>5432</port>
</ports>
</tcp>
<time>10000</time>
</wait>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-start</id>
<phase>compile</phase>
<goals>
<goal>stop</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>docker-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

<!-- Connection specific -->
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL95Dialect"/>
<property name="hibernate.connection.url" value="jdbc:postgresql:hibernate_orm_test"/>
<property name="hibernate.connection.url" value="${postgres.url}"/>
<property name="hibernate.connection.username" value="hibernate_orm_test"/>
<property name="hibernate.connection.password" value="hibernate_orm_test"/>

Expand Down
116 changes: 67 additions & 49 deletions examples/strict/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,12 @@
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<filtering>true</filtering>
</resource>
</resources>
<plugins>
<plugin>
<groupId>${project.groupId}</groupId>
Expand All @@ -149,55 +155,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.26.1</version>
<configuration>
<images>
<image>
<name>postgres:10.5</name>
<alias>postgresql</alias>
<run>
<env>
<POSTGRES_USER>hibernate_orm_test</POSTGRES_USER>
<POSTGRES_PASSWORD>hibernate_orm_test</POSTGRES_PASSWORD>
<POSTGRES_DB>hibernate_orm_test</POSTGRES_DB>
</env>
<ports>
<port>5432:5432</port>
</ports>
<wait>
<tcp>
<mode>mapped</mode>
<ports>
<port>5432</port>
</ports>
</tcp>
<time>10000</time>
</wait>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-start</id>
<phase>compile</phase>
<goals>
<goal>stop</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>docker-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

Expand Down Expand Up @@ -254,6 +211,67 @@
</plugins>
</build>
</profile>
<profile>
<id>postgres</id>
<activation>
<property>
<name>!no-postgres</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.26.1</version>
<configuration>
<images>
<image>
<name>postgres:10.5</name>
<alias>postgresql</alias>
<run>
<env>
<POSTGRES_USER>hibernate_orm_test</POSTGRES_USER>
<POSTGRES_PASSWORD>hibernate_orm_test</POSTGRES_PASSWORD>
<POSTGRES_DB>hibernate_orm_test</POSTGRES_DB>
</env>
<ports>
<port>5432:5432</port>
</ports>
<wait>
<tcp>
<mode>mapped</mode>
<ports>
<port>5432</port>
</ports>
</tcp>
<time>10000</time>
</wait>
</run>
</image>
</images>
</configuration>
<executions>
<execution>
<id>docker-start</id>
<phase>compile</phase>
<goals>
<goal>stop</goal>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>docker-stop</id>
<phase>post-integration-test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<!-- Connection specific -->
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQL95Dialect"/>
<property name="hibernate.connection.url" value="jdbc:postgresql:hibernate_orm_test"/>
<property name="hibernate.connection.url" value="${postgres.url}"/>
<property name="hibernate.connection.username" value="hibernate_orm_test"/>
<property name="hibernate.connection.password" value="hibernate_orm_test"/>

Expand Down
Loading

0 comments on commit 352a9f9

Please sign in to comment.