Skip to content

Commit

Permalink
feat: add quay.io
Browse files Browse the repository at this point in the history
Signed-off-by: sebastien.heurtematte <[email protected]>
  • Loading branch information
heurtematte authored and fredg02 committed Feb 8, 2024
1 parent a67714f commit fff3524
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions jenkins-create-credentials-token.sh
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ help() {
printf "auto\t\t\tTest which token credentials exist and create them (except for sonarcloud).\n"
printf "default\t\t\tCreate any kind of credentials (secret text/token).\n"
printf "docker\t\t\tCreate docker.com token credentials (secret text/token).\n"
printf "quay\t\t\tCreate quay.io token credentials (secret text/token).\n"
printf "github\t\t\tCreate github.com token credentials (secret text/token) and username/token credentials (username/token).\n"
printf "gitlab\t\t\tCreate gitlab.eclipse.org token credentials (secret text/token).\n"
printf "gitlab_pat\t\tCreate gitlab.eclipse.org PAT credentials (GitLab PAT token).\n"
Expand All @@ -227,6 +228,12 @@ auto() {
else
echo " No API token found."
fi
echo "Checking for quay.io API token..."
if passw cbi "bots/${project_name}/quay.io/api-token" 2&> /dev/null; then
quay "${project_name}"
else
echo " No API token found."
fi
echo "Checking for github.com API token..."
if passw cbi "bots/${project_name}/github.com/api-token" 2&> /dev/null; then
github "${project_name}"
Expand Down Expand Up @@ -274,6 +281,17 @@ docker() {
_create_string_credentials "${project_name}" "docker-bot-token" "Docker Bot token" "${token}" "docker.com"
}

quay() {
local project_name="${1:-}"

_verify_inputs "${project_name}"

local token
token="$(passw cbi "bots/${project_name}/quay.io/api-token")"

_create_string_credentials "${project_name}" "quay-bot-token" "Quay Bot token" "${token}" "quay.io"
}

github() {
local project_name="${1:-}"

Expand Down

0 comments on commit fff3524

Please sign in to comment.