diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3aaa132 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.iml +.idea/* \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..66b918a --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,5 @@ +node('node') { + stage('Release drafter configuration validation') { + sh './scripts/validateReleaseDrafterConfiguration.sh' + } +} \ No newline at end of file diff --git a/scripts/validateReleaseDrafterConfiguration.sh b/scripts/validateReleaseDrafterConfiguration.sh new file mode 100755 index 0000000..d14a3d6 --- /dev/null +++ b/scripts/validateReleaseDrafterConfiguration.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -euo pipefail + +HERE="$( cd -P "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +RELEASE_DRAFTER_CONFIG="$HERE/../.github/release-drafter.yml" + +AJV_VERSION='3.2.0' + +pushd $TMPDIR || exit +echo "Installing AJV" +npm install -s -g "ajv-cli@${AJV_VERSION}" + +echo "Downloading the release drafter validation schema" +curl -Lso schema.json 'https://raw.githubusercontent.com/release-drafter/release-drafter/master/schema.json' + +echo "Validating release drafter configuration" +ajv validate -s schema.json -d "${RELEASE_DRAFTER_CONFIG}" + +popd || exit