From 8ba6e7d4695135c7f326e2ff0b05a331529d18f5 Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Thu, 25 Apr 2024 22:37:42 -0400 Subject: [PATCH] fix --- README.md | 4 +-- bot/s/build | 15 ---------- s/stop_ci_if_no_changes | 65 ----------------------------------------- web_api/s/build | 15 ---------- web_ui/s/build | 15 ---------- 5 files changed, 2 insertions(+), 112 deletions(-) delete mode 100755 bot/s/build delete mode 100755 s/stop_ci_if_no_changes delete mode 100755 web_api/s/build delete mode 100755 web_ui/s/build diff --git a/README.md b/README.md index ff4500a38..4cca1db09 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@

-# kodiak [![CircleCI](https://circleci.com/gh/chdsbd/kodiak.svg?style=svg&circle-token=4879604a0cca6fa815c4d22936350f5bdf455905)](https://circleci.com/gh/chdsbd/kodiak) +# kodiak > A GitHub bot to automatically update and merge GitHub PRs @@ -24,8 +24,8 @@ _If you'd rather run Kodiak yourself, check out the [self hosting page](https:// View activity via the dashboard at . - ## Example + [![kodiak pull request flow](https://3c7446e0-cd7f-4e98-a123-1875fcbf3182.s3.amazonaws.com/marketplace+listing+image.svg)](https://github.com/marketplace/kodiakhq) Kodiak automatically updates branches, merges PRs and more! diff --git a/bot/s/build b/bot/s/build deleted file mode 100755 index 5ada66946..000000000 --- a/bot/s/build +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env sh -set -e -DOCKER_HUB_REPO='cdignam/kodiak' -docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" - -set -x - -# https://circleci.com/docs/2.0/env-vars/#circleci-built-in-environment-variables -LABEL="$CIRCLE_SHA1" -if [ -n "$CIRCLE_TAG" ]; then - LABEL="$CIRCLE_TAG" -fi - -docker build --tag "$DOCKER_HUB_REPO:$LABEL" . -docker push "$DOCKER_HUB_REPO:$LABEL" diff --git a/s/stop_ci_if_no_changes b/s/stop_ci_if_no_changes deleted file mode 100755 index 1f75780ee..000000000 --- a/s/stop_ci_if_no_changes +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python3 - -""" -If there have been no changes in the specified path, exit circleci job early. - - -We use the `circleci` CLI to stop the job early. -""" - -import os -import subprocess -import sys - -MAIN_BRANCH = "master" - - -def main(path: str) -> int: - # CircleCI's built in git checkout code clobbers the `master` ref so we do the - # following to make it not point to the current ref. - # https://discuss.circleci.com/t/git-checkout-of-a-branch-destroys-local-reference-to-master/23781/7 - if os.getenv("CIRCLECI") and os.getenv("CIRCLE_BRANCH") != MAIN_BRANCH: - subprocess.run( - [ - "git", - "branch", - "-f", - MAIN_BRANCH, - "origin/{branch}".format(branch=MAIN_BRANCH), - ], - check=True, - ) - - res = subprocess.run( - [ - "git", - "--no-pager", - "diff", - "--name-only", - "--exit-code", - "{branch}...".format(branch=MAIN_BRANCH), - path, - # we want to run our build whenever the CircleCI config changes - # because build environment changes could affect our tests - ".circleci/config.yml", - ], - stdout=subprocess.PIPE, - ) - file_names = res.stdout.decode().strip().splitlines() - # no changes on zero return code. - if res.returncode == 0: - print("no changes found. Skipping build.") - subprocess.run(["circleci", "step", "halt"], check=True) - elif res.returncode == 1: - print( - "changes found in files: {file_names!r}\nContinuing build.".format( - file_names=file_names - ) - ) - else: - raise ValueError("Unexpected return code {}".format(res.returncode)) - - -if __name__ == "__main__": - path = sys.argv[1] - sys.exit(main(path)) diff --git a/web_api/s/build b/web_api/s/build deleted file mode 100755 index 0ffb3e7d8..000000000 --- a/web_api/s/build +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env sh -set -e -DOCKER_HUB_REPO='cdignam/kodiak-web-api' -docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" - -set -x - -# https://circleci.com/docs/2.0/env-vars/#circleci-built-in-environment-variables -LABEL="$CIRCLE_SHA1" -if [ -n "$CIRCLE_TAG" ]; then - LABEL="$CIRCLE_TAG" -fi - -docker build --tag "$DOCKER_HUB_REPO:$LABEL" . -docker push "$DOCKER_HUB_REPO:$LABEL" diff --git a/web_ui/s/build b/web_ui/s/build deleted file mode 100755 index 2b7d88cc5..000000000 --- a/web_ui/s/build +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env sh -set -e -DOCKER_HUB_REPO='cdignam/kodiak-web-ui' -docker login -u "$DOCKER_USER" -p "$DOCKER_PASS" - -set -x - -# https://circleci.com/docs/2.0/env-vars/#circleci-built-in-environment-variables -LABEL="$CIRCLE_SHA1" -if [ -n "$CIRCLE_TAG" ]; then - LABEL="$CIRCLE_TAG" -fi - -docker build --tag "$DOCKER_HUB_REPO:$LABEL" . -docker push "$DOCKER_HUB_REPO:$LABEL"