Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Quay utility class #59

Open
chrira opened this issue Feb 10, 2024 · 0 comments
Open

Test Quay utility class #59

chrira opened this issue Feb 10, 2024 · 0 comments

Comments

@chrira
Copy link
Member

chrira commented Feb 10, 2024

Write tests in the GitHub repo as soon as the test framework is decided.

import com.puzzleitc.jenkins.Quay

pipeline {
    agent any
    environment {
        CRED = 'quay-token'
        REGISTRY_URL = 'https://registry.ch'
        ORG = 'org'
        REPOSITORY = 'backend'
        TAG='2.6.6'
        NEW_TAG='3.0.0'
    }
    stages {
        stage('tags') {
            steps {
                script {
                    Quay quay = new Quay(this, env.CRED, env.REGISTRY_URL)

                    // get sha of image referenced by the tag
                    def sha = quay.getTagManifest(env.ORG, env.REPOSITORY, env.TAG)
                    println "SHA: " + sha

                    // add new tag to image
                    quay.addTag(env.ORG, env.REPOSITORY, sha, env.NEW_TAG)
                }
            }
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant