From e860c29a475a2f0a0c60956ddc7fabb653e50df5 Mon Sep 17 00:00:00 2001 From: Mikhail Goncharov Date: Fri, 24 Apr 2020 12:49:07 +0200 Subject: [PATCH] Checkout scripts and define pipeline in python --- .../buildkite-premerge-debian/Dockerfile | 1 + .../bootstrap_build.sh | 6 ++-- scripts/buildkite/create_pipeline.py | 32 +++++++++++++++++++ 3 files changed, 37 insertions(+), 2 deletions(-) create mode 100755 scripts/buildkite/create_pipeline.py diff --git a/containers/buildkite-premerge-debian/Dockerfile b/containers/buildkite-premerge-debian/Dockerfile index cbb4ecf..f735d84 100644 --- a/containers/buildkite-premerge-debian/Dockerfile +++ b/containers/buildkite-premerge-debian/Dockerfile @@ -9,4 +9,5 @@ RUN echo 'install buildkite' ;\ apt-get clean; COPY *.sh /usr/local/bin/ +RUN chmod og+rx /usr/local/bin/*.sh CMD ["start_agent.sh"] \ No newline at end of file diff --git a/containers/buildkite-premerge-debian/bootstrap_build.sh b/containers/buildkite-premerge-debian/bootstrap_build.sh index be330f0..1173b39 100755 --- a/containers/buildkite-premerge-debian/bootstrap_build.sh +++ b/containers/buildkite-premerge-debian/bootstrap_build.sh @@ -15,8 +15,10 @@ cat << EOF steps: - - label: ":sparkles: success" - command: echo "bootstrap success" + - label: "bootstrap" + commands: + - "git clone --depth 1 --branch \"${PREMERGE_SCRIPTS_BRANCH}\" https://github.com/google/llvm-premerge-checks.git" + - "llvm-premerge-checks/scripts/buildkite/create_pipeline.py | buildkite-agent pipeline upload" agents: queue: "${BUILDKITE_AGENT_META_DATA_QUEUE}" os: "linux" diff --git a/scripts/buildkite/create_pipeline.py b/scripts/buildkite/create_pipeline.py new file mode 100755 index 0000000..fc02422 --- /dev/null +++ b/scripts/buildkite/create_pipeline.py @@ -0,0 +1,32 @@ +#!/usr/bin/env python3 +# Copyright 2020 Google LLC +# +# Licensed under the the Apache License v2.0 with LLVM Exceptions (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://llvm.org/LICENSE.txt +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +if __name__ == '__main__': + print(""" +steps: + - label: "build" + commands: + - "git clone --depth 1 --branch master https://github.com/google/llvm-premerge-checks.git" + - "llvm-premerge-checks/scripts/run_buildkite.sh" + agents: + queue: "local" + os: "linux" + - label: "parallel step" + commands: + - "echo do nothing" + agents: + queue: "local" + os: "linux" + """)