about summary refs log tree commit diff
path: root/src/ci
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2019-10-30 18:13:18 +0100
committerPietro Albini <pietro@pietroalbini.org>2019-11-12 11:06:11 +0100
commit6104aa77eb97050c3b302a0d13934040de84cda9 (patch)
tree85fd1ba1038019d7cfcf9295861d76a447b9d179 /src/ci
parentaf6b26646b41e1b9614be12ae126f7033a3fa908 (diff)
downloadrust-6104aa77eb97050c3b302a0d13934040de84cda9.tar.gz
rust-6104aa77eb97050c3b302a0d13934040de84cda9.zip
ci: extract validate-toolstate into a script
Diffstat (limited to 'src/ci')
-rw-r--r--src/ci/azure-pipelines/steps/run.yml13
-rwxr-xr-xsrc/ci/scripts/validate-toolstate.sh18
2 files changed, 19 insertions, 12 deletions
diff --git a/src/ci/azure-pipelines/steps/run.yml b/src/ci/azure-pipelines/steps/run.yml
index 4d7c6859322..4df315d5d5c 100644
--- a/src/ci/azure-pipelines/steps/run.yml
+++ b/src/ci/azure-pipelines/steps/run.yml
@@ -144,18 +144,7 @@ steps:
 
 # As a quick smoke check on the otherwise very fast mingw-check linux builder
 # check our own internal scripts.
-- bash: |
-    set -e
-    git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
-    cd rust-toolstate
-    python2.7 "$BUILD_SOURCESDIRECTORY/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
-    # Only check maintainers if this build is supposed to publish toolstate.
-    # Builds that are not supposed to publish don't have the access token.
-    if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then
-      TOOLSTATE_VALIDATE_MAINTAINERS_REPO=rust-lang/rust python2.7 "${BUILD_SOURCESDIRECTORY}/src/tools/publish_toolstate.py"
-    fi
-    cd ..
-    rm -rf rust-toolstate
+- bash: src/ci/scripts/validate-toolstate.sh
   env:
     TOOLSTATE_REPO_ACCESS_TOKEN: $(TOOLSTATE_REPO_ACCESS_TOKEN)
   condition: and(succeeded(), not(variables.SKIP_JOB), eq(variables['IMAGE'], 'mingw-check'))
diff --git a/src/ci/scripts/validate-toolstate.sh b/src/ci/scripts/validate-toolstate.sh
new file mode 100755
index 00000000000..93e645b24a8
--- /dev/null
+++ b/src/ci/scripts/validate-toolstate.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# A quick smoke test to make sure publish_tooolstate.py works.
+
+set -euo pipefail
+IFS=$'\n\t'
+
+source "$(cd "$(dirname "$0")" && pwd)/../shared.sh"
+
+git clone --depth=1 https://github.com/rust-lang-nursery/rust-toolstate.git
+cd rust-toolstate
+python2.7 "${BUILD_SOURCESDIRECTORY}/src/tools/publish_toolstate.py" "$(git rev-parse HEAD)" "$(git log --format=%s -n1 HEAD)" "" ""
+# Only check maintainers if this build is supposed to publish toolstate.
+# Builds that are not supposed to publish don't have the access token.
+if [ -n "${TOOLSTATE_PUBLISH+is_set}" ]; then
+  TOOLSTATE_VALIDATE_MAINTAINERS_REPO=rust-lang/rust python2.7 "${BUILD_SOURCESDIRECTORY}/src/tools/publish_toolstate.py"
+fi
+cd ..
+rm -rf rust-toolstate