From 3333ca4943fab69ee3109e3fce4287de504b406e Mon Sep 17 00:00:00 2001 From: paketo-bot Date: Tue, 16 Jun 2020 22:35:19 +0000 Subject: [PATCH] Update shared github-config --- .github/dependabot.yml | 8 ++++++++ .github/util/tag.sh | 14 -------------- .mergify/config.yml | 12 ++++++++++++ scripts/.util/tools.sh | 4 +--- scripts/build.sh | 22 ++++++++++++++++++++++ scripts/integration.sh | 2 +- scripts/package.sh | 4 ++-- 7 files changed, 46 insertions(+), 20 deletions(-) create mode 100644 .github/dependabot.yml delete mode 100755 .github/util/tag.sh create mode 100644 .mergify/config.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..dd4beec --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,8 @@ +--- +version: 2 +updates: +- package-ecosystem: gomod + directory: "/" + schedule: + interval: daily + open-pull-requests-limit: 10 diff --git a/.github/util/tag.sh b/.github/util/tag.sh deleted file mode 100755 index 90fd891..0000000 --- a/.github/util/tag.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash - -set -eu -set -o pipefail - -function main() { - local previous tag - previous="$(git describe --tags "$(git rev-list --tags --max-count=1)")" - tag="$(printf "%s" "$previous" | awk -F. '{$NF = $NF + 1;} 1' | sed 's/ /./g')" - - printf "v%s" "${tag#v}" -} - -main "${@:-}" diff --git a/.mergify/config.yml b/.mergify/config.yml new file mode 100644 index 0000000..2d47423 --- /dev/null +++ b/.mergify/config.yml @@ -0,0 +1,12 @@ +pull_request_rules: + - name: Auto merge pull requests from github-actions bot + conditions: + - author=github-actions[bot] + # TODO: Fill in these conditions when they are finalized + # - status-success=Unit Tests + # - status-success=Integration Tests + actions: + merge: + strict: true + method: rebase + delete_head_branch: {} diff --git a/scripts/.util/tools.sh b/scripts/.util/tools.sh index 154b23f..6cdd073 100644 --- a/scripts/.util/tools.sh +++ b/scripts/.util/tools.sh @@ -20,8 +20,6 @@ function util::tools::path::export() { } function util::tools::jam::install () { - echo "-> Installing v0.0.10 jam..." - local dir while [[ "${#}" != 0 ]]; do case "${1}" in @@ -55,7 +53,7 @@ function util::tools::jam::install () { if [[ ! -f "${dir}/jam" ]]; then local version - version="v0.0.10" + version="v0.0.14" util::print::title "Installing jam ${version}" curl "https://github.com/paketo-buildpacks/packit/releases/download/${version}/jam-${os}" \ diff --git a/scripts/build.sh b/scripts/build.sh index e73e790..4cdf1b1 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -30,6 +30,28 @@ function main() { popd > /dev/null || return fi + if [[ -f "${BUILDPACKDIR}/main.go" ]]; then + pushd "${BUILDPACKDIR}/bin" > /dev/null || return + printf "%s" "Building run..." + + GOOS=linux \ + go build \ + -ldflags="-s -w" \ + -o "run" \ + "${BUILDPACKDIR}" + + echo "Success!" + + for name in detect build; do + printf "%s" "Linking ${name}..." + + ln -sf "run" "${name}" + + echo "Success!" + done + popd > /dev/null || return + fi + if [[ -d "${BUILDPACKDIR}/cmd" ]]; then local name for src in "${BUILDPACKDIR}"/cmd/*; do diff --git a/scripts/integration.sh b/scripts/integration.sh index c09acba..b739749 100755 --- a/scripts/integration.sh +++ b/scripts/integration.sh @@ -65,7 +65,7 @@ function token::fetch() { function tests::run() { util::print::title "Run Buildpack Runtime Integration Tests" pushd "${BUILDPACKDIR}" > /dev/null - if GOMAXPROCS=4 go test -timeout 0 ./integration/... -v -run Integration; then + if GOMAXPROCS="${GOMAXPROCS:-4}" go test -count=1 -timeout 0 ./integration/... -v -run Integration; then util::print::success "** GO Test Succeeded **" else util::print::error "** GO Test Failed **" diff --git a/scripts/package.sh b/scripts/package.sh index 1b57cd6..aaa47bb 100755 --- a/scripts/package.sh +++ b/scripts/package.sh @@ -55,8 +55,8 @@ function main() { #use jam util::tools::jam::install --directory "${BUILDPACKDIR}/.bin" if [[ -z "${version:-}" ]]; then #version not provided, use latest git tag - git_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)" || echo "v0.0.0") - version=${git_tag:1} + git_tag=$(git describe --tags "$(git rev-list --tags --max-count=1)" || echo "v0.0.0") + version=${git_tag:1} fi extra_args=""