about summary refs log tree commit diff
path: root/third_party/apereo-cas/overlay/gradle/dockerjib.gradle
blob: dbadd5aa19bdfd54c5b8c64c07792099e90cc651 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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"
}