File: auth.sh

package info (click to toggle)
bpfcc 0.35.0%2Bds-1.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 30,696 kB
  • sloc: ansic: 900,938; python: 41,379; cpp: 25,608; sh: 776; makefile: 281
file content (19 lines) | stat: -rwxr-xr-x 726 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
set -e

# For now only quay.io is supported, but this could be portable to dockerhub
# and other image repositories.

# Forks can push using this approach if they create a quay.io bot user
# with name matching of ORGNAME+bcc_buildbot, or by setting QUAY_BOT_NAME

git_repo=$1 # github.repository format: ORGNAME/REPONAME

# Set this value as QUAY_TOKEN in the github repository settings "Secrets" tab
[[ -z "${QUAY_TOKEN}" ]] && echo "QUAY_TOKEN not set" && exit 0

# Set this to match the name of the bot user on quay.io
[[ -z "${QUAY_BOT_NAME}" ]] && QUAY_BOT_NAME="bcc_buildbot"

quay_user="$(dirname ${git_repo})+${QUAY_BOT_NAME}"
echo "${QUAY_TOKEN}" | docker login -u="${quay_user}" --password-stdin quay.io