about summary refs log tree commit diff
path: root/third_party/apereo-cas/overlay/gradle/dockerjib.gradle
diff options
context:
space:
mode:
authorlukegb <lukegb@tvl.fyi>2020-07-05T19·21+0000
committerlukegb <lukegb@tvl.fyi>2020-07-05T19·21+0000
commit4b9fde0abe01bb09e0c30402ce89ff02bc0afb49 (patch)
treea43500d29b629314fc12f514c6b6714a214fb20b /third_party/apereo-cas/overlay/gradle/dockerjib.gradle
parent8f4dea27a6561a30e4044d532a76e716c6cbf75b (diff)
parentc22796eb2a4c9e9f04dcc098c7705a6ddfce81a5 (diff)
Merge "merge(3p/apereo-cas-overlay): Merge commit '2e185f50c38db1a85f39a6bd5ad4c4e58462f003' as 'third_party/apereo-cas/overlay'" into canon r/1218
Diffstat (limited to 'third_party/apereo-cas/overlay/gradle/dockerjib.gradle')
-rw-r--r--third_party/apereo-cas/overlay/gradle/dockerjib.gradle52
1 files changed, 52 insertions, 0 deletions
diff --git a/third_party/apereo-cas/overlay/gradle/dockerjib.gradle b/third_party/apereo-cas/overlay/gradle/dockerjib.gradle
new file mode 100644
index 000000000000..dbadd5aa19bd
--- /dev/null
+++ b/third_party/apereo-cas/overlay/gradle/dockerjib.gradle
@@ -0,0 +1,52 @@
+apply plugin: "com.google.cloud.tools.jib"
+
+jib {
+    from {
+        image = project.baseDockerImage
+    }
+    to {
+        image = "${project.group}/${project.name}"
+        /**
+         ecr-login: Amazon Elastic Container Registry (ECR)
+         gcr: Google Container Registry (GCR)
+         osxkeychain: Docker Hub
+         */
+        credHelper = "osxkeychain"
+        /**
+        auth {
+            username = "*******"
+            password = "*******"
+        }
+        */
+        tags = ["v" + casServerVersion]
+    }
+    container {
+        creationTime = "USE_CURRENT_TIMESTAMP"
+        entrypoint = ['docker/entrypoint.sh']
+        ports = ['80', '443', '8080', '8443']
+        labels = [version:casServerVersion, name:project.name, group:project.group]
+    }
+    extraDirectories {
+        paths = 'src/main/jib'
+        permissions = [
+            '/docker/entrypoint.sh': '755'
+        ]
+    }
+    allowInsecureRegistries = project.allowInsecureRegistries
+}
+
+task copyWebAppIntoJib(type: Copy, group: "Docker", description: "Copy the web application into Docker image") {
+    dependsOn build
+    from "build/libs/${casWebApplicationBinaryName}"
+    into "src/main/jib/docker/cas/war"
+}
+
+task copyConfigIntoJib(type: Copy, group: "Docker", description: "Copy the CAS configuration into Docker image") {
+    dependsOn build
+    from "etc/cas"
+    into "src/main/jib/docker/cas"
+}
+
+task deleteWebAppFromJib(type: Delete, group: "Docker", description: "Explodes the CAS web application archive") {
+    delete "src/main/jib/docker/cas"
+}
\ No newline at end of file