Escalating and building/publishing in maas
diff --git a/.gitignore b/.gitignore
index 8e389c9..e797189 100644
--- a/.gitignore
+++ b/.gitignore
@@ -26,7 +26,7 @@
/registry
# Build
-build
+/build
# Gradle
.gradle
diff --git a/build.gradle b/build.gradle
index 0c2527b..8224404 100644
--- a/build.gradle
+++ b/build.gradle
@@ -38,13 +38,13 @@
ext {
// Upstream registry to simplify filling out the comps table below
- upstreamReg = 'docker.io'
+ upstreamReg = project.hasProperty('upstreamReg') ? project.getProperty('upstreamReg') : 'docker.io'
// Target registry to be used to publish docker images needed for deployment
- targetReg = 'localhost:5000'
+ targetReg = project.hasProperty('targetReg') ? project.getProperty('targetReg') : 'localhost:5000'
// The tag used to tag the docker images push to the target registry
- targetTag = 'candidate'
+ targetTag = project.hasProperty('targetTag') ? project.getProperty('targetTag') : 'candidate'
// Component table
comps = [
@@ -71,8 +71,7 @@
// Deployment target config file (yaml format); this can be overwritten from the command line
// using the -PdeployConfig=<file-path> syntax.
- deployConfig = project.hasProperty('deployConfig') ?
- project.getProperty('deployConfig') : './config/default.yml'
+ deployConfig = project.hasProperty('deployConfig') ? project.getProperty('deployConfig') : './config/default.yml'
}
@@ -90,7 +89,7 @@
}
task publishImages {
- comps.each { name, _ -> dependsOn "publish" + name }
+ comps.each { name, spec -> if (spec.type == 'image') { dependsOn "publish" + name } }
}
task publish {
diff --git a/buildSrc/src/main/groovy/org/opencord/build/rules/DockerPublishRule.groovy b/buildSrc/src/main/groovy/org/opencord/build/rules/DockerPublishRule.groovy
index 2e1a581..6508123 100644
--- a/buildSrc/src/main/groovy/org/opencord/build/rules/DockerPublishRule.groovy
+++ b/buildSrc/src/main/groovy/org/opencord/build/rules/DockerPublishRule.groovy
@@ -39,7 +39,10 @@
if (taskName.startsWith('publish')) {
project.task(taskName, type: DockerPushTask) {
ext.compName = taskName - 'publish'
- dependsOn "tag" + compName
+ println "Publish rule: $taskName + $compName"
+ def tagTask = "tag$compName"
+ println "Tagtask: $tagTask"
+ dependsOn tagTask
def spec = project.comps[ext.compName]
repositoryName = spec.name + ':' + project.targetTag
registry = project.targetReg
diff --git a/buildSrc/src/main/groovy/org/opencord/build/rules/DockerTagRule.groovy b/buildSrc/src/main/groovy/org/opencord/build/rules/DockerTagRule.groovy
index b48cfb5..70fd03e 100644
--- a/buildSrc/src/main/groovy/org/opencord/build/rules/DockerTagRule.groovy
+++ b/buildSrc/src/main/groovy/org/opencord/build/rules/DockerTagRule.groovy
@@ -36,11 +36,10 @@
}
void apply(String taskName) {
- if (taskName.startsWith('tag')) {
+ if (taskName.startsWith('tag') && !taskName.equals('tag')) {
project.task(taskName, type: DockerTagTask) {
ext.compName = taskName - 'tag'
- dependsOn "fetch" + compName
- def spec = project.comps[ext.compName]
+ def spec = project.comps[compName]
imageId = spec.name + '@' + spec.digest
tag = compName + ':' + project.targetTag
}
diff --git a/docs/quickstart.md b/docs/quickstart.md
index 494bf23..56ff154 100644
--- a/docs/quickstart.md
+++ b/docs/quickstart.md
@@ -72,7 +72,7 @@
Time to build artifacts needed for deployment:
```
- ./gradlew build
+ ./gradlew buildImages
```
Lets publish all artifacts to the staging registry (Docker registry).
@@ -114,4 +114,4 @@
### Further Steps
-[TODO]
\ No newline at end of file
+[TODO]
diff --git a/settings.gradle b/settings.gradle
index 5307f82..bdc9890 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1 @@
include 'components/maas'
-