mirror of
https://github.com/linuxserver/docker-jenkins-builder.git
synced 2026-01-09 07:00:48 +08:00
Add step for marking quay.io repos as public
This commit is contained in:
parent
6cf1f9a41d
commit
bb0ce2c1ef
15
Jenkinsfile
vendored
15
Jenkinsfile
vendored
@ -17,6 +17,7 @@ pipeline {
|
||||
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
|
||||
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
|
||||
DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat')
|
||||
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
|
||||
BUILD_VERSION_ARG='BUILDER_VERSION'
|
||||
LS_USER='linuxserver'
|
||||
LS_REPO='docker-jenkins-builder'
|
||||
@ -39,6 +40,7 @@ pipeline {
|
||||
// Setup all the basic environment variables needed for the build
|
||||
stage("Set ENV Variables base"){
|
||||
steps{
|
||||
echo "Running on node: ${NODE_NAME}"
|
||||
sh '''#! /bin/bash
|
||||
containers=$(docker ps -aq)
|
||||
if [[ -n "${containers}" ]]; then
|
||||
@ -480,6 +482,19 @@ pipeline {
|
||||
-d "mirror=true&import_url=https://github.com/linuxserver/${LS_REPO}.git" '''
|
||||
}
|
||||
}
|
||||
/* #######################
|
||||
Quay.io Repo Visibility
|
||||
####################### */
|
||||
// Mark this repo on Quay.io as public
|
||||
stage("Quay.io Repo Visibility"){
|
||||
when {
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
steps{
|
||||
sh '''curl -H "Content-Type: application/json" -H "Authorization: Bearer ${QUAYIO_API_TOKEN}" -X POST "https://quay.io/api/v1/repository${QUAYIMAGE/quay.io/}/changevisibility" \
|
||||
-d '{"visibility":"public"}' ||: '''
|
||||
}
|
||||
}
|
||||
/* ###############
|
||||
Build Container
|
||||
############### */
|
||||
|
||||
@ -17,6 +17,7 @@ pipeline {
|
||||
GITLAB_TOKEN=credentials('b6f0f1dd-6952-4cf6-95d1-9c06380283f0')
|
||||
GITLAB_NAMESPACE=credentials('gitlab-namespace-id')
|
||||
DOCKERHUB_TOKEN=credentials('docker-hub-ci-pat')
|
||||
QUAYIO_API_TOKEN=credentials('quayio-repo-api-token')
|
||||
{% for repo_var in repo_vars %}
|
||||
{{ repo_var }}
|
||||
{% endfor %}
|
||||
@ -710,6 +711,19 @@ pipeline {
|
||||
-d "mirror=true&import_url=https://github.com/linuxserver/${LS_REPO}.git" '''
|
||||
}{{ ' ' }}
|
||||
}
|
||||
/* #######################
|
||||
Quay.io Repo Visibility
|
||||
####################### */
|
||||
// Mark this repo on Quay.io as public
|
||||
stage("Quay.io Repo Visibility"){
|
||||
when {
|
||||
environment name: 'EXIT_STATUS', value: ''
|
||||
}
|
||||
steps{
|
||||
sh '''curl -H "Content-Type: application/json" -H "Authorization: Bearer ${QUAYIO_API_TOKEN}" -X POST "https://quay.io/api/v1/repository${QUAYIMAGE/quay.io/}/changevisibility" \
|
||||
-d '{"visibility":"public"}' ||: '''
|
||||
}{{ ' ' }}
|
||||
}
|
||||
/* ###############
|
||||
Build Container
|
||||
############### */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user