Skip to content

Instantly share code, notes, and snippets.

@oliverisaac
Created October 8, 2025 20:43
Show Gist options
  • Select an option

  • Save oliverisaac/67d460d92044d2efba720882d5f51b80 to your computer and use it in GitHub Desktop.

Select an option

Save oliverisaac/67d460d92044d2efba720882d5f51b80 to your computer and use it in GitHub Desktop.
// jenkinsLibraries/vars/dockerReleasePipelineHardToTest.groovy
def call(Map config = [:]) {
def target = (config.remove('target') ?: 'release') as String
def owner = config.remove('owner') as String
if (owner == null || owner.isEmpty()) {
throw new Exception('owner must be defined')
}
pipeline {
agent {
label 'dockerce'
}
stages {
stage('Build') {
steps {
sh """
aws ecr create-repository --region=us-west-2 --repository-name=example --tags 'Key=owner,Value=${owner}'"
docker buildx build --target='${target}' --tag example:latest .
docker push example:latest
"""
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment