Skip to content

Commit

Permalink
Optional pushImage tag is added.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxulusoy authored and markusthoemmes committed Mar 9, 2016
1 parent 16e26c0 commit 68b65a5
Show file tree
Hide file tree
Showing 11 changed files with 207 additions and 3 deletions.
25 changes: 25 additions & 0 deletions core/controller/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@ def imagename = project.name
task distDocker(dependsOn:[distTar, ':common:scala:distDocker'], type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + imagename, '.'
}
task tagImage(type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'tag', '-f', 'whisk/' + imagename, dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Tagging the image is skipped because of missing docker registry in the build command."
}
}
task pushImage(dependsOn: tagImage, type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'push', dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Pushing the image is skipped because of missing docker registry in the build command."
}
}
distDocker.finalizedBy pushImage
task deleteImage(type:Exec) {
ignoreExitValue = true
commandLine 'docker', 'rmi', 'whisk/' + imagename
Expand Down
25 changes: 25 additions & 0 deletions core/dispatcher/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@ def imagename = project.name
task distDocker(dependsOn:[distTar, ':common:scala:distDocker'], type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + imagename, '.'
}
task tagImage(type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'tag', '-f', 'whisk/' + imagename, dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Tagging the image is skipped because of missing docker registry in the build command."
}
}
task pushImage(dependsOn: tagImage, type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'push', dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Pushing the image is skipped because of missing docker registry in the build command."
}
}
distDocker.finalizedBy pushImage
task deleteImage(type:Exec) {
ignoreExitValue = true
commandLine 'docker', 'rmi', 'whisk/' + imagename
Expand Down
25 changes: 25 additions & 0 deletions core/loadBalancer/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,31 @@ def imagename = 'loadbalancer'
task distDocker(dependsOn:[distTar, ':common:scala:distDocker'], type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + imagename, '.'
}
task tagImage(type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'tag', '-f', 'whisk/' + imagename, dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Tagging the image is skipped because of missing docker registry in the build command."
}
}
task pushImage(dependsOn: tagImage, type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'push', dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Pushing the image is skipped because of missing docker registry in the build command."
}
}
distDocker.finalizedBy pushImage
task deleteImage(type:Exec) {
ignoreExitValue = true
commandLine 'docker', 'rmi', 'whisk/' + imagename
Expand Down
25 changes: 25 additions & 0 deletions core/nodejsAction/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@ def imagename = 'nodejsaction'
task distDocker(type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + imagename, '.'
}
task tagImage(type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'tag', '-f', 'whisk/' + imagename, dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Tagging the image is skipped because of missing docker registry in the build command."
}
}
task pushImage(dependsOn: tagImage, type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'push', dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Pushing the image is skipped because of missing docker registry in the build command."
}
}
distDocker.finalizedBy pushImage
task deleteImage(type:Exec) {
ignoreExitValue = true
commandLine 'docker', 'rmi', 'whisk/' + imagename
Expand Down
25 changes: 25 additions & 0 deletions core/swiftAction/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@ def imagename = 'swiftaction'
task distDocker(type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + imagename, '.'
}
task tagImage(type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'tag', '-f', 'whisk/' + imagename, dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Tagging the image is skipped because of missing docker registry in the build command."
}
}
task pushImage(dependsOn: tagImage, type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'push', dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Pushing the image is skipped because of missing docker registry in the build command."
}
}
distDocker.finalizedBy pushImage
task deleteImage(type:Exec) {
ignoreExitValue = true
commandLine 'docker', 'rmi', 'whisk/' + imagename
Expand Down
25 changes: 25 additions & 0 deletions services/consul/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@ def imagename = project.name
task distDocker(dependsOn:':common:scala:distDocker', type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + imagename, '.'
}
task tagImage(type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'tag', '-f', 'whisk/' + imagename, dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Tagging the image is skipped because of missing docker registry in the build command."
}
}
task pushImage(dependsOn: tagImage, type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'push', dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Pushing the image is skipped because of missing docker registry in the build command."
}
}
distDocker.finalizedBy pushImage
task deleteImage(type:Exec) {
ignoreExitValue = true
commandLine 'docker', 'rmi', 'whisk/' + imagename
Expand Down
25 changes: 25 additions & 0 deletions services/kafka/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@ def imagename = project.name
task distDocker(dependsOn:':common:scala:distDocker', type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + imagename, '.'
}
task tagImage(type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'tag', '-f', 'whisk/' + imagename, dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Tagging the image is skipped because of missing docker registry in the build command."
}
}
task pushImage(dependsOn: tagImage, type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'push', dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Pushing the image is skipped because of missing docker registry in the build command."
}
}
distDocker.finalizedBy pushImage
task deleteImage(type:Exec) {
ignoreExitValue = true
commandLine 'docker', 'rmi', 'whisk/' + imagename
Expand Down
25 changes: 25 additions & 0 deletions services/zookeeper/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,31 @@ def imagename = project.name
task distDocker(dependsOn:':common:scala:distDocker', type:Exec) {
commandLine 'docker', 'build', '-t', 'whisk/' + imagename, '.'
}
task tagImage(type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'tag', '-f', 'whisk/' + imagename, dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Tagging the image is skipped because of missing docker registry in the build command."
}
}
task pushImage(dependsOn: tagImage, type:Exec) {
if (project.hasProperty('dockerRegistry')) {
def dockerImageTag = 'latest'
if (project.hasProperty('dockerTag')) {
dockerImageTag = dockerTag
}
commandLine 'docker', 'push', dockerRegistry + '/whisk/' + imagename + ':' + dockerImageTag
} else {
executable "sh"
args "-c", "echo Pushing the image is skipped because of missing docker registry in the build command."
}
}
distDocker.finalizedBy pushImage
task deleteImage(type:Exec) {
ignoreExitValue = true
commandLine 'docker', 'rmi', 'whisk/' + imagename
Expand Down
3 changes: 2 additions & 1 deletion tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ sourceSets {

test {
systemProperty 'javax.net.ssl.trustStore', 'build/keystore'
jvmArgs = [ "-Dtestthreads=1" ]
}

dependencies {
Expand Down Expand Up @@ -48,4 +49,4 @@ task deleteKeystore(type:Delete) {
task createKeystore(dependsOn:deleteKeystore, type:Exec) {
commandLine 'keytool', '-import', '-alias', 'Whisk', '-noprompt', '-trustcacerts', '-file', '../config/keys/openwhisk-self-cert.pem', '-keystore', 'build/keystore', '-storepass', 'openwhisk'
}
test.dependsOn createKeystore
build.finalizedBy createKeystore
3 changes: 3 additions & 0 deletions tools/ubuntu-setup/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ source ./scala.sh

echo "*** installing docker"
source ./docker.sh

echo "*** installing gradle"
source ./gradle.sh
4 changes: 2 additions & 2 deletions tools/ubuntu-setup/gradle.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sudo apt-get install -y software-properties-common
sudo apt-get install -y python-software-properties
sudo add-apt-repository -y ppa:cwchien/gradle
sudo apt-get update
sudo apt-get update -y
sudo apt-cache search gradle
sudo apt-get install -y gradle-2.3
sudo apt-get install -y gradle-2.7
gradle -version

0 comments on commit 68b65a5

Please sign in to comment.