From 2333ec4d1f013845994103ee9faf31df88404d8f Mon Sep 17 00:00:00 2001 From: Brad Beam Date: Tue, 24 Jan 2017 22:44:06 -0600 Subject: [PATCH] Splitting out moderator check from syntax check - Attempt to clarify CI runs from contributors --- .gitlab-ci.yml | 13 ++++++++++--- scripts/.premoderator.sh.swp | Bin 0 -> 12288 bytes scripts/premoderator.sh | 5 ++++- 3 files changed, 14 insertions(+), 4 deletions(-) create mode 100644 scripts/.premoderator.sh.swp diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 80ba6816f..d65be3b7c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,5 @@ stages: + - moderator - unit-tests - deploy-gce-part1 - deploy-gce-part2 @@ -506,15 +507,21 @@ ubuntu-rkt-sep: only: ['master', /^pr-.*$/] # Premoderated with manual actions -syntax-check: +ci-authorized: <<: *job - stage: unit-tests + stage: moderator before_script: - apt-get -y install jq 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 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: stage: unit-tests diff --git a/scripts/.premoderator.sh.swp b/scripts/.premoderator.sh.swp new file mode 100644 index 0000000000000000000000000000000000000000..064764e5b3412a3d438b4daee208264693879c00 GIT binary patch literal 12288 zcmeI2&u<$=6vroA5P||KH%_k;tFcwq>-2{}Ek;VxG_q8q$dwUNUDDazv3Hu?neEIh zNtC8N_K1*>xb#oxKhRVE2reAqz=<0-ZoC~kZ6QH$ZS^cY&(8PF%)a@&cd`7E-dBSm zeA>Ol@be*KKkCO{zy17A_WL!)5-G~0(f{MKZbjyzp-9(_*^RcX=@upx#fe=H!+~*S z%{`fV7dxBAGv)I->87TPck4u2ExmM+(rKLtZ*06P?99Y2wW`7$m6fH*q-|VXm!Eh8 z2}FPhoJyef)9AA^?9#>6UgKZp=isBW<5QQCNCb!g5g-CYfCvx)B0vO)z?(_HS4->> zUhS>L_0BHFrGJczDGfw`2oM1xKm>>Y5g-CYfCvx)B0vO)z-vfAWQ_g%E@Pj+hr#3j z|Hr@ofBS&3@6ZI=U9=^%U*Bi!7qn++1=`1GPtPzmM*9Qz|Ah7g?FY2)(ZZRpArlIj z2oM1xKm>>Y5g-CYfCvzQzY$1lTR`|~9d3+AH+R-XTepsY=iXQDY8;D7bzf=iHFoAs z@9!;TiCw=gZXMQ6+9S@UioGNEm4{Uv)7$_bqXRM{9cber7vD;#q%DIxQ7 z<*I6q7e!(ApdF&>bpZEeGA)#r3+)ROo0BS4$wp=X58&Q?h=#yRQMH{cu;01eO-y!x zp44bB6h_{j@YZl`Yp^llolXZm-P^r8&~4(t4(gfG95rtt%3y`BbXeo)x7z<7yOovs z7w+@EYGhc;27Y)rim?s5l-fHE6XdideYjTuqeUrUYE2oW?GavMz83bdg*%9QLVM&` zikV6QTexv5Jmv^e;n2atOYj0AtynjMo%QkH=JlP?=8c^%*M^%%cwNkF0TH5IiNC3A z)ShG)I??3Tg;osb&qHOE_Rv~I81wKj4qZ1DG!N~>k&Fevecn0@4_Bj9K^pS!bLFt! zUQ}b-Y0<7`D(3zaxgO{YwB!faP=B!p_&qZ(dyn1oHxL~EXFP63z0M>e_V8cs|2`8 hrfQ1#w?}T}I7MvvT%0H!yBs1}??Yt5uBlK3`wPW5f#v`J literal 0 HcmV?d00001 diff --git a/scripts/premoderator.sh b/scripts/premoderator.sh index 2e730df7b..4b35af8d2 100644 --- a/scripts/premoderator.sh +++ b/scripts/premoderator.sh @@ -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" \ | 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 -[ "$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}"