Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ include ':test:smoke'
include ':test:smoke:appServers'
include ':test:smoke:appServers:Tomcat.7'
include ':test:smoke:appServers:Tomcat.8'
include ':test:smoke:appServers:JBossEAP.7'
include ':test:smoke:testApps'

include ':test:smoke:framework:testCore'
Expand Down
6 changes: 6 additions & 0 deletions test/smoke/appServers/JBossEAP.7/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ext.jbossEapVersion = 7
apply from: '../JBossEAP.gradle'
if (jbossZipFile) {
ext.additionalReplaceTokenMap << [ZIP_FILENAME: ext.jbossZipFile.name]
ext.additionalReplaceTokenMap << [JBOSS_HOME_DIR: "jboss-eap-7.1"] // TODO find a way to set this automatically
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM @JRE@

USER root
WORKDIR /root/docker-compile

# update packages and install dependencies: wget
RUN apt-get update \
&& apt-get install -y wget \
&& apt-get install -y procps \
&& apt-get install -y unzip

# add jboss zip
ADD ./@ZIP_FILENAME@ ./

RUN unzip ./@ZIP_FILENAME@ -d /opt
# FIXME can this env var be set automatically?
ENV JBOSS_HOME=/opt/@JBOSS_HOME_DIR@

RUN mkdir /root/docker-stage
WORKDIR /root/docker-stage

# add scripts
ADD ./*.sh ./

EXPOSE 8080
CMD ./startServer.sh
2 changes: 2 additions & 0 deletions test/smoke/appServers/JBossEAP.7/jre.excludes.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
openjdk:7-jre
azul/zulu-openjdk:7
21 changes: 21 additions & 0 deletions test/smoke/appServers/JBossEAP.7/resources/linux/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

if [ -z "$JBOSS_HOME" ]; then
echo "\$JBOSS_HOME not set" >&2
exit 1
fi

if [ -z "$1" ]; then
echo "Nothing given to deploy"
exit 2
fi

if [ ! -e $1 ]; then
echo "File '$1' does not exist" >&2
exit 3
fi

WARFILE=`readlink -f $1`
BASEPATH=`basename $WARFILE .war`

cp $WARFILE $JBOSS_HOME/standalone/deployments/
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if [ -z "$JBOSS_HOME" ]; then
echo "\$JBOSS_HOME not set" >&2
exit 1
fi

$JBOSS_HOME/bin/standalone.sh -b 0.0.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash

if [ -z "$JBOSS_HOME" ]; then
echo "\$JBOSS_HOME not set" >&2
exit 1
fi

$JBOSS_HOME/bin/jboss-cli.sh --connect --command=shutdown
13 changes: 13 additions & 0 deletions test/smoke/appServers/JBossEAP.7/resources/linux/tailLastLog.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

if [ -z "$JBOSS_HOME" ]; then
echo "\$JBOSS_HOME not set" >&2
exit 1
fi

NUM_LINES=25
if [ ! -z "$1" ]; then
NUM_LINES=$1
fi

tail -v -n$NUM_LINES $JBOSS_HOME/standalone/log/server.log
21 changes: 21 additions & 0 deletions test/smoke/appServers/JBossEAP.7/resources/linux/undeploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

if [ -z "$JBOSS_HOME" ]; then
echo "\$JBOSS_HOME not set" >&2
exit 1
fi

if [ -z "$1" ]; then
echo "Nothing given to undeploy"
exit 2
fi

WARFILE=`readlink -f $1`
DEPLOYED_WAR=$JBOSS_HOME/standalone/deployments/$WARFILE

if [ ! -e $1 ]; then
echo "File '$DEPLOYED_WAR' does not exist" >&2
exit 3
fi

rm $DEPLOYED_WAR
41 changes: 41 additions & 0 deletions test/smoke/appServers/JBossEAP.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
if (!project.hasProperty('jbossEapVersion')) {
throw new GradleException("JBoss buildfile in $projectDir misconfigured. Missing definition 'jbossEapVersion'.")
}

ext.jbossEapZipfileVar = "JBOSSEAP${jbossEapVersion}_ZIPFILE"
ext.appServerShortName = "jbosseap${jbossEapVersion}"
ext.jbossZipFile = null

if (!System.env."${jbossEapZipfileVar}") {
logger.warn "Skipping generation of JBoss EAP ${jbossEapVersion} containers. To run these, you must sign up for the Red Hat Developer Program and download the zip file manually. Then set '${jbossEapZipfileVar}' environment variable to the location of the installer jar."
if (!isBuildServer) {
project.tasks.all { task -> task.enabled = false }
}
} else {
jbossZipFile = file(System.env."${jbossEapZipfileVar}")
if (!jbossZipFile.exists()) {
throw new GradleException("${jbossZipFile} does not exist.")
}
if (!jbossZipFile.isFile()) {
throw new GradleException("${jbossZipFile} is not a valid file.")
}
logger.info "Found ${jbossEapZipfileVar}=${jbossZipFile.absolutePath}"
}

if (jbossZipFile) {
task stageJBossInstaller(type: Copy) {
from jbossZipFile.parent
into stagingDir // provided by parent project
include jbossZipFile.name
}
buildDockerImage.dependsOn stageJBossInstaller
} else {
task missingJBossEAPZip {
doFirst {
if (isBuildServer) {
throw new GradleException("Missing JBoss EAP ${jbossEapVersion} zipfile!")
}
}
}
buildDockerImage.dependsOn missingJBossEAPZip
}
11 changes: 7 additions & 4 deletions test/smoke/appServers/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ subprojects {
dockerfileOutputDir = "$outputRoot/dockerfiles"
resourcesOutputDir = "$outputRoot/resources"
stagingDir = "$outputRoot/tmp"
additionalReplaceTokenMap = [:]
}

task generateDockerfiles {
Expand Down Expand Up @@ -53,13 +54,15 @@ subprojects {
def jresFile = file("$resourcesOutputDir/${appServerShortName}.jre.txt")
jresFile.getParentFile().mkdirs()
jresFile.createNewFile()

def tokenMap = [:] << additionalReplaceTokenMap
jresToUse.each { jreVersion ->
tokenMap << [JRE: jreVersion]
logger.debug "tokenMap = ${tokenMap}"
copy {
from projectDir
into dockerfileOutputDir
include "*$partialDockerfileExt"
filter(ReplaceTokens, tokens: [JRE: jreVersion])
filter(ReplaceTokens, tokens: tokenMap)
def sanitizedJreVersion = jreVersion.replace(':','_').replace('/','_')
rename(/(.+\.)(partial)(\.dockerfile)/, "\$1$sanitizedJreVersion\$3")
}
Expand Down Expand Up @@ -157,13 +160,13 @@ def getConfigSet(File universeFile, File includesFile, File excludesFile) {
// if the excludes file contains entries which do not exist in the master list, warn the user; this is likely a typo
def uniqueExcludes = excludeSet.minus(universalSet)
if (uniqueExcludes.size() > 0) {
logger.warn("$excludesFile.name entries are not a subset of ${universeFile.name}: ${uniqueExcludes}. These entries are nops and can be removed.")
logger.info("$excludesFile.name entries are not a subset of ${universeFile.name}: ${uniqueExcludes}. These entries are nops and can be removed.")
}

// if the includes file contains entires which do not exist in the master list, warn the user; be aware that these will be included
def uniqueIncludes = includeSet.minus(universalSet)
if (uniqueIncludes.size() > 1) {
logger.warn("FYI: $includesFile.name has ${includeSubset.size()} entries not found in $universeFile.name: $includeSubset")
logger.info("FYI: $includesFile.name has ${includeSubset.size()} entries not found in $universeFile.name: $includeSubset")
}

def resultantSet = includeSet.intersect(universalSet.minus(excludeSet)).plus(uniqueIncludes)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
tomcat8
jbosseap7
tomcat7
tomcat8