Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
dockerizing build verification, adding back ignored integration tests
- Loading branch information
Showing
4 changed files
with
63 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,12 @@ | ||
language: java | ||
script: "./lib/gradlew -b lib/build.gradle test" | ||
sudo: required | ||
|
||
language: ruby | ||
|
||
services: | ||
- docker | ||
|
||
before_install: | ||
- docker build -t java/koans . | ||
|
||
script: | ||
- docker run java/koans /bin/bash -c "git clone https://github.com/matyb/java-koans && gradle -p java-koans/lib buildApp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM centos:7 | ||
MAINTAINER Mat Bentley <mathewkbentley@gmail.com> | ||
|
||
ENV JAVA_VERSION 1.8.0 | ||
ENV GRADLE_VERSION 3.4.1 | ||
|
||
# install wget, git, curl, jdk, which | ||
RUN yum remove -y java &&\ | ||
yum install -y wget git curl unzip java-$JAVA_VERSION-openjdk-devel which | ||
|
||
# install gradle | ||
RUN wget https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip &&\ | ||
mkdir -p /etc/alternatives/gradle &&\ | ||
unzip -d /etc/alternatives/gradle gradle-$GRADLE_VERSION-bin.zip &&\ | ||
ln -s /etc/alternatives/gradle/gradle-$GRADLE_VERSION /opt/gradle | ||
|
||
ENV PATH $PATH:/opt/gradle/bin | ||
RUN JAVA_HOME=$(readlink $(readlink `which java`) | gawk '$0=gensub(/\/jre\/bin\/java/,"",1)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#! /usr/bin/ruby | ||
|
||
require "serverspec" | ||
require "docker" | ||
|
||
describe "Dockerfile" do | ||
before(:all) do | ||
image = Docker::Image.build_from_dir('.') | ||
|
||
set :os, family: :redhat | ||
set :backend, :docker | ||
set :docker_image, image.id | ||
end | ||
|
||
it "has jdk8 installed" do | ||
expect(command("javac -version").stderr).to include(" 1.8.") | ||
end | ||
|
||
it "has gradle installed" do | ||
expect(command("gradle -version").stdout).to include("Build time") | ||
end | ||
|
||
it "can build app" do | ||
output = command("git clone https://github.com/matyb/java-koans && gradle -p java-koans/lib buildApp").stdout | ||
expect(output).to include(":test\n") | ||
expect(output).to include("BUILD SUCCESSFUL") | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters