#!groovy

/**
 *
 * Promote docker image from one artifactory repository (development) to
 * another (production)
 *
 * Expected parameters:
 *   REPO_SRC          Source Artifactory repository (default 'docker-dev-local')
 *   REPO_DST          Destination Artifactory repository (default 'docker-prod-local')
 *   IMAGE_SRC         Source image name (without docker registry!) to promote (required)
 *   IMAGE_DST         Destination image (default same as IMAGE_SRC)
 *
 *   COPY_IMAGE        Copy image instead of moving (default 'true')
 *
 *   ARTIFACTORY_URL   Base URL of Artifactory instance, i.e. without `/api/...` path.
 *                       (default 'https://artifactory.mcp.mirantis.net/artifactory/')
 *   ARTIFACTORY_CREDS Credentials to login into Artifactory (default 'artifactory')
 *
 *   SLAVE_LABEL       Label of the slave to run job (default 'master')
 *
 *   Slave requirements: curl installed
 *
 */

import groovy.json.JsonOutput

String repo_src = env.REPO_SRC ?: 'docker-dev-local'
String repo_dst = env.REPO_DST ?: 'docker-prod-local'
String image_src = env.IMAGE_SRC
String image_dst = env.IMAGE_DST ?: env.IMAGE_SRC

boolean copy_image = env.COPY_IMAGE.asBoolean() ?: true

String artifactory_url = env.ARTIFACTORY_URL ?: 'https://artifactory.mcp.mirantis.net/artifactory/'
String artifactory_creds = env.ARTIFACTORY_CREDS ?: 'artifactory'

String slave_label = env.SLAVE_LABEL ?: 'master'

// Delimiter for splitting docker image name and tag (to avoid codeNarc DRY warning)
String _colon = ':'

String img_src_name, img_src_tag
String img_dst_name, img_dst_tag
timeout(time: 12, unit: 'HOURS') {
    node(slave_label) {
        (img_src_name, img_src_tag) = image_src.tokenize(_colon)
        (img_dst_name, img_dst_tag) = image_dst.tokenize(_colon)

        String api_req = JsonOutput.toJson([
            targetRepo: repo_dst,
            dockerRepository: img_src_name,
            targetDockerRepository: img_dst_name,
            tag: img_src_tag,
            targetTag: img_dst_tag,
            copy: copy_image,
        ])

        withCredentials([usernameColonPassword(credentialsId: artifactory_creds, variable: 'USERPASS')]) {
            sh """
                curl -fLsS \
                    -u \$USERPASS \
                    -X POST -d '${api_req}' -H 'Content-Type: application/json' \
                    '${artifactory_url}api/docker/${repo_src}/v2/promote'
            """
        }
    }
}
