gitlab-ci: make merge requests trigger issuebot

This commit is contained in:
Hans-Christoph Steiner 2020-05-20 17:03:59 +02:00
parent 00a26736f8
commit ce0969d18b
No known key found for this signature in database
GPG Key ID: 3E177817BA1B9BFA
3 changed files with 22 additions and 0 deletions

View File

@ -1,7 +1,10 @@
image: registry.gitlab.com/fdroid/ci-images-server:latest
lint:
except:
- triggers
before_script:
- ./tools/trigger-issuebot
- printf "Package\x3a androguard fdroidserver python3-asn1crypto python3-ruamel.yaml\nPin\x3a release a=stretch-backports\nPin-Priority\x3a 500\n" > /etc/apt/preferences.d/debian-stretch-backports.pref
- echo "deb http://deb.debian.org/debian/ stretch-backports main" > /etc/apt/sources.list.d/backports.list
- apt-get update

1
.issuebot Normal file
View File

@ -0,0 +1 @@
a9ade34503d15449a79310c3e1661580390a11babe59003e25c2ca9ade3450328911d636398fdcef560588a4e5375e632ca9ade34503d15449a795539fce3561a90f31d36cc4cd9d9798b7a6534503d15449a72bbda26e3891e9630e34ef3fd2fcda8ba9ade34503868f5f5c5a50bb31addf606fc65ccd67a9ade34503d15030e95d43eefec5edbeae42d77b5eba79ade3494a41cd659c1f10f097c2fae1023f170e34503d15449a795539be9c0739bc9f9b23488c97b8930e5db8c0ade34503d15449a795539aeb2a25e299b236530b6a2ef68e0fe49632ca9ade34503d15449a795539bece34503d1544e1eaf628fa0d2b758365599bf8ddccd732ca9ade34517d1b9496845407dfd3e0e36b7f124d9de30e73c2abed1bb6b9a679a28f85f8747332ca9adf70400c3fe0117e15dca6d6dffd18c7869c77fdbad1d20654c2ac841f5fb62047a9ade34503d154493c73114a87bc7851bdeac968d2ab52dd63412cc198eab40dc54c10614da572db65

18
tools/trigger-issuebot Executable file
View File

@ -0,0 +1,18 @@
#!/bin/bash -e
# insecure "captcha"
s=$((4`printf "$CI_COMMIT_SHA" | wc -c`-10))
e=$((s+`echo "$CI_SERVER_HOST" | wc -c`+18))
issuebot=`cat .issuebot | cut -b${s}-${e}`
curl --silent --request POST \
--form token=$issuebot \
--form ref=master \
--form "variables[FROM_CI_COMMIT_REF_NAME]=$CI_COMMIT_REF_NAME" \
--form "variables[FROM_CI_COMMIT_REF_SLUG]=$CI_COMMIT_REF_SLUG" \
--form "variables[FROM_CI_COMMIT_SHA]=$CI_COMMIT_SHA" \
--form "variables[FROM_CI_JOB_ID]=$CI_JOB_ID" \
--form "variables[FROM_CI_PIPELINE_ID]=$CI_PIPELINE_ID" \
--form "variables[FROM_CI_PROJECT_PATH]=$CI_PROJECT_PATH" \
--form "variables[FROM_CI_PROJECT_URL]=$CI_PROJECT_URL" \
${CI_API_V4_URL}/projects/36528/trigger/pipeline > /dev/null \
|| echo "$0 failed to post to a merge request"