Added first "participating" sub-module (maas)
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..d0f376d
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "components/maas"]
+ path = components/maas
+ url = ../maas
diff --git a/build.gradle b/build.gradle
index e479884..0c2527b 100644
--- a/build.gradle
+++ b/build.gradle
@@ -48,14 +48,25 @@
// Component table
comps = [
- 'nginx': [ 'type': 'image',
- 'upstream': upstreamReg,
- 'name': 'nginx',
- 'digest': 'sha256:b555f8c64ab4e85405e0d8b03f759b73ce88deb802892a3b155ef55e3e832806' ],
- 'swarm': [ 'type': 'image',
- 'upstream': upstreamReg,
- 'name': 'swarm',
- 'digest': 'sha256:6ca9b40980e2fcdcd229900ec8933f3e92c14ead22c9404cb09736cb4f3a9248' ],
+ 'maas': [
+ 'type': 'gitmodule',
+ 'upstream': '../maas',
+ 'branch': 'master',
+ 'tag': null,
+ 'componentDir': './components/maas'
+ ],
+ 'nginx': [
+ 'type': 'image',
+ 'upstream': upstreamReg,
+ 'name': 'nginx',
+ 'digest': 'sha256:b555f8c64ab4e85405e0d8b03f759b73ce88deb802892a3b155ef55e3e832806'
+ ],
+ 'swarm': [
+ 'type': 'image',
+ 'upstream': upstreamReg,
+ 'name': 'swarm',
+ 'digest': 'sha256:6ca9b40980e2fcdcd229900ec8933f3e92c14ead22c9404cb09736cb4f3a9248'
+ ],
]
// Deployment target config file (yaml format); this can be overwritten from the command line
@@ -66,24 +77,30 @@
}
task fetchUpstreamImages {
- comps.each { name, spec -> if (spec.type == 'image') { dependsOn "fetch" + name } }
+ comps.each { name, spec -> if (spec.type == 'image') { dependsOn "fetch" + name } }
+}
+
+task fetchGitSubmodules {
+ comps.each { name, spec -> if (spec.type == 'gitmodule') { dependsOn "gitupdate" + name } }
}
task fetch {
- dependsOn fetchUpstreamImages
+ dependsOn fetchUpstreamImages
+ dependsOn fetchGitSubmodules
}
task publishImages {
- comps.each { name, _ -> dependsOn "publish" + name }
+ comps.each { name, _ -> dependsOn "publish" + name }
}
task publish {
- dependsOn publishImages
+ dependsOn publishImages
}
tasks.addRule(new DockerFetchRule(project))
tasks.addRule(new DockerPublishRule(project))
tasks.addRule(new DockerTagRule(project))
+tasks.addRule(new GitSubmoduleUpdateRule(project))
task deploy {
// TODO this is a place-holder.
diff --git a/buildSrc/src/main/groovy/org/opencord/build/rules/DockerFetchRule.groovy b/buildSrc/src/main/groovy/org/opencord/build/rules/DockerFetchRule.groovy
index 01f9176..4b4ec9f 100644
--- a/buildSrc/src/main/groovy/org/opencord/build/rules/DockerFetchRule.groovy
+++ b/buildSrc/src/main/groovy/org/opencord/build/rules/DockerFetchRule.groovy
@@ -32,7 +32,7 @@
}
String getDescription() {
- 'Rule Usage: fetch<image-name>'
+ 'Rule Usage: fetch<component-name>'
}
void apply(String taskName) {
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 75a5990..2e1a581 100644
--- a/buildSrc/src/main/groovy/org/opencord/build/rules/DockerPublishRule.groovy
+++ b/buildSrc/src/main/groovy/org/opencord/build/rules/DockerPublishRule.groovy
@@ -32,7 +32,7 @@
}
String getDescription() {
- 'Rule Usage: publish<image-name>'
+ 'Rule Usage: publish<component-name>'
}
void apply(String taskName) {
@@ -40,7 +40,8 @@
project.task(taskName, type: DockerPushTask) {
ext.compName = taskName - 'publish'
dependsOn "tag" + compName
- repositoryName = compName + ':' + project.targetTag
+ 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 114bdfc..b48cfb5 100644
--- a/buildSrc/src/main/groovy/org/opencord/build/rules/DockerTagRule.groovy
+++ b/buildSrc/src/main/groovy/org/opencord/build/rules/DockerTagRule.groovy
@@ -32,7 +32,7 @@
}
String getDescription() {
- 'Rule Usage: tag<image-name>'
+ 'Rule Usage: tag<component-name>'
}
void apply(String taskName) {
diff --git a/components/maas b/components/maas
new file mode 160000
index 0000000..39d0c78
--- /dev/null
+++ b/components/maas
@@ -0,0 +1 @@
+Subproject commit 39d0c78bd5273f0ee8da619f93edc81af132db00
diff --git a/settings.gradle b/settings.gradle
index 8a5ffa7..5307f82 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -1,2 +1,2 @@
-//include 'components/nginx'
+include 'components/maas'