Splitting out moderator check from syntax check
- Attempt to clarify CI runs from contributors
This commit is contained in:
parent
38797e9792
commit
4b25083c03
3 changed files with 14 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
||||||
stages:
|
stages:
|
||||||
|
- moderator
|
||||||
- unit-tests
|
- unit-tests
|
||||||
- deploy-gce-part1
|
- deploy-gce-part1
|
||||||
- deploy-gce-part2
|
- deploy-gce-part2
|
||||||
|
@ -506,15 +507,21 @@ ubuntu-rkt-sep:
|
||||||
only: ['master', /^pr-.*$/]
|
only: ['master', /^pr-.*$/]
|
||||||
|
|
||||||
# Premoderated with manual actions
|
# Premoderated with manual actions
|
||||||
syntax-check:
|
ci-authorized:
|
||||||
<<: *job
|
<<: *job
|
||||||
stage: unit-tests
|
stage: moderator
|
||||||
before_script:
|
before_script:
|
||||||
- apt-get -y install jq
|
- apt-get -y install jq
|
||||||
script:
|
script:
|
||||||
- ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root cluster.yml -vvv --syntax-check
|
|
||||||
- /bin/sh scripts/premoderator.sh
|
- /bin/sh scripts/premoderator.sh
|
||||||
except: ['triggers', 'master']
|
except: ['triggers', 'master']
|
||||||
|
|
||||||
|
syntax-check:
|
||||||
|
<<: *job
|
||||||
|
stage: unit-tests
|
||||||
|
script:
|
||||||
|
- ansible-playbook -i inventory/local-tests.cfg -u root -e ansible_ssh_user=root -b --become-user=root cluster.yml -vvv --syntax-check
|
||||||
|
except: ['triggers', 'master']
|
||||||
|
|
||||||
tox-inventory-builder:
|
tox-inventory-builder:
|
||||||
stage: unit-tests
|
stage: unit-tests
|
||||||
|
|
BIN
scripts/.premoderator.sh.swp
Normal file
BIN
scripts/.premoderator.sh.swp
Normal file
Binary file not shown.
|
@ -11,5 +11,8 @@ issue=$(echo ${CI_BUILD_REF_NAME} | perl -ne '/^pr-(\d+)-\S+$/ && print $1')
|
||||||
user=$(curl ${CURL_ARGS} "https://api.github.com/repos/kubernetes-incubator/kargo/issues/${issue}/comments" \
|
user=$(curl ${CURL_ARGS} "https://api.github.com/repos/kubernetes-incubator/kargo/issues/${issue}/comments" \
|
||||||
| jq -M "map(select(.body | contains (\"$MAGIC\"))) | .[0] .user.login" | tr -d '"')
|
| jq -M "map(select(.body | contains (\"$MAGIC\"))) | .[0] .user.login" | tr -d '"')
|
||||||
# Check for the required user group membership to allow (exit 0) or decline (exit >0) the pipeline
|
# Check for the required user group membership to allow (exit 0) or decline (exit >0) the pipeline
|
||||||
[ "$user" != "null" ] || exit 1
|
if [ "$user" = "null" ]; then
|
||||||
|
echo "User does not have permissions to start CI run"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
curl ${CURL_ARGS} "https://api.github.com/orgs/kubernetes-incubator/members/${user}"
|
curl ${CURL_ARGS} "https://api.github.com/orgs/kubernetes-incubator/members/${user}"
|
||||||
|
|
Loading…
Reference in a new issue