From 1dc5ec76c8a6a5145c7a02d8500beec014504e94 Mon Sep 17 00:00:00 2001 From: Ben Hale Date: Tue, 13 Oct 2020 10:19:51 -0700 Subject: [PATCH] Initial Pipelines This change adds all the existing Octo pipelines for this project, including the buildpack's dependencies. Signed-off-by: Ben Hale --- .github/CODEOWNERS | 1 + .github/dependabot.yml | 19 ++- .github/labels.yml | 27 ++++ .github/release-drafter.yml | 32 ++++ .github/workflows/ci.yml | 37 ----- .github/workflows/create-package.yml | 148 ++++++++++++++++++ .github/workflows/minimal-labels.yml | 29 ++++ .github/workflows/synchronize-labels.yml | 17 +++ .github/workflows/tests.yml | 147 ++++++++++++++++++ .github/workflows/update-draft-release.yml | 169 +++++++++++++++++++++ .github/workflows/update-invoker.yml | 91 +++++++++++ buildpack.toml | 6 +- go.mod | 2 - go.sum | 6 +- scripts/build.sh | 9 +- scripts/update-buildpack-dependency.sh | 7 - 16 files changed, 684 insertions(+), 63 deletions(-) create mode 100644 .github/CODEOWNERS create mode 100644 .github/labels.yml create mode 100644 .github/release-drafter.yml delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/create-package.yml create mode 100644 .github/workflows/minimal-labels.yml create mode 100644 .github/workflows/synchronize-labels.yml create mode 100644 .github/workflows/tests.yml create mode 100644 .github/workflows/update-draft-release.yml create mode 100644 .github/workflows/update-invoker.yml delete mode 100755 scripts/update-buildpack-dependency.sh diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..3b0ce70 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @projectriff/riff-dev \ No newline at end of file diff --git a/.github/dependabot.yml b/.github/dependabot.yml index afb98ae..1d28333 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,16 @@ version: 2 updates: -- package-ecosystem: github-actions - directory: "/" - schedule: - interval: daily - open-pull-requests-limit: 10 + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + labels: + - semver:patch + - type:dependency-upgrade + - package-ecosystem: gomod + directory: / + schedule: + interval: daily + labels: + - semver:patch + - type:dependency-upgrade diff --git a/.github/labels.yml b/.github/labels.yml new file mode 100644 index 0000000..270dd19 --- /dev/null +++ b/.github/labels.yml @@ -0,0 +1,27 @@ +- name: semver:major + description: A change requiring a major version bump + color: f9d0c4 +- name: semver:minor + description: A change requiring a minor version bump + color: f9d0c4 +- name: semver:patch + description: A change requiring a patch version bump + color: f9d0c4 +- name: type:bug + description: A general bug + color: e3d9fc +- name: type:dependency-upgrade + description: A dependency upgrade + color: e3d9fc +- name: type:documentation + description: A documentation update + color: e3d9fc +- name: type:enhancement + description: A general enhancement + color: e3d9fc +- name: type:question + description: A user question + color: e3d9fc +- name: type:task + description: A general task + color: e3d9fc diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..b5c1d5b --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,32 @@ +template: $CHANGES +name-template: $RESOLVED_VERSION +tag-template: v$RESOLVED_VERSION +categories: + - title: ⭐️ Enhancements + labels: + - type:enhancement + - title: "\U0001F41E Bug Fixes" + labels: + - type:bug + - title: "\U0001F4D4 Documentation" + labels: + - type:documentation + - title: ⛏ Dependency Upgrades + labels: + - type:dependency-upgrade + - title: "\U0001F6A7 Tasks" + labels: + - type:task +exclude-labels: + - type:question +version-resolver: + major: + labels: + - semver:major + minor: + labels: + - semver:minor + patch: + labels: + - semver:patch + default: patch diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e32959b..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,37 +0,0 @@ -name: CI - -on: - push: - branches: - - '**' - - '!dependabot/**' - pull_request: {} - -jobs: - - test: - name: Test - runs-on: ubuntu-latest - steps: - - name: Checkout Build Common - uses: actions/checkout@v2.3.3 - with: - path: build-common - repository: paketo-buildpacks/build-common - - name: Checkout Source - uses: actions/checkout@v2.3.3 - with: - path: source - - name: Setup Go environment - uses: actions/setup-go@v2 - with: - go-version: '1.14' - - name: Restore Cache - uses: actions/cache@v2 - with: - path: go-cache - key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} - restore-keys: | - ${{ runner.os }}-go- - - name: Test - run: build-common/test.sh diff --git a/.github/workflows/create-package.yml b/.github/workflows/create-package.yml new file mode 100644 index 0000000..0d56489 --- /dev/null +++ b/.github/workflows/create-package.yml @@ -0,0 +1,148 @@ +name: Create Package +"on": + release: + types: + - published +jobs: + create-package: + name: Create Package + runs-on: + - ubuntu-latest + steps: + - name: Docker login gcr.io + uses: docker/login-action@v1 + with: + password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }} + registry: gcr.io + username: _json_key + - uses: actions/checkout@v2 + - if: ${{ false }} + uses: actions/cache@v2 + with: + key: ${{ runner.os }}-go-${{ hashFiles('**/buildpack.toml', '**/package.toml') }} + path: |- + ${{ env.HOME }}/.pack + ${{ env.HOME }}/carton-cache + restore-keys: ${{ runner.os }}-go- + - uses: actions/setup-go@v2 + with: + go-version: "1.15" + - name: Install crane + run: | + #!/usr/bin/env bash + + set -euo pipefail + + GO111MODULE=on go get -u -ldflags="-s -w" github.com/google/go-containerregistry/cmd/crane + - name: Install create-package + run: | + #!/usr/bin/env bash + + set -euo pipefail + + GO111MODULE=on go get -u -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package + - name: Install pack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + mkdir -p "${HOME}"/bin + echo "${HOME}/bin" >> "${GITHUB_PATH}" + + curl \ + --location \ + --show-error \ + --silent \ + "https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" \ + | tar -C "${HOME}"/bin/ -xzv pack + env: + PACK_VERSION: 0.14.1 + - id: version + name: Compute Version + run: | + #!/usr/bin/env bash + + set -euo pipefail + + if [[ ${GITHUB_REF} =~ refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then + VERSION=${BASH_REMATCH[1]} + elif [[ ${GITHUB_REF} =~ refs/heads/(.+) ]]; then + VERSION=${BASH_REMATCH[1]} + else + VERSION=$(git rev-parse --short HEAD) + fi + + echo "::set-output name=version::${VERSION}" + echo "Selected ${VERSION} from + * ref: ${GITHUB_REF} + * sha: ${GITHUB_SHA} + " + - name: Create Package + run: | + #!/usr/bin/env bash + + set -euo pipefail + + if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then + create-package \ + --cache-location "${HOME}"/carton-cache \ + --destination "${HOME}"/buildpack \ + --include-dependencies \ + --version "${VERSION}" + else + create-package \ + --destination "${HOME}"/buildpack \ + --version "${VERSION}" + fi + + [[ -e package.toml ]] && cp package.toml "${HOME}"/package.toml + printf '[buildpack]\nuri = "%s"' "${HOME}"/buildpack >> "${HOME}"/package.toml + env: + INCLUDE_DEPENDENCIES: "false" + VERSION: ${{ steps.version.outputs.version }} + - id: package + name: Package Buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + if [[ -n "${PUBLISH+x}" ]]; then + pack package-buildpack \ + "${PACKAGE}:${VERSION}" \ + --config "${HOME}"/package.toml \ + --publish + + echo "::set-output name=digest::$(crane digest "${PACKAGE}:${VERSION}")" + else + pack package-buildpack \ + "${PACKAGE}:${VERSION}" \ + --config "${HOME}"/package.toml + fi + env: + PACKAGE: gcr.io/projectriff/java-function + PUBLISH: "true" + VERSION: ${{ steps.version.outputs.version }} + - name: Update release with digest + run: | + #!/usr/bin/env bash + + set -euo pipefail + + PAYLOAD=$(cat "${GITHUB_EVENT_PATH}") + + RELEASE_ID=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.id') + RELEASE_TAG_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.tag_name') + RELEASE_NAME=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.name') + RELEASE_BODY=$(jq -n -r --argjson PAYLOAD "${PAYLOAD}" '$PAYLOAD.release.body') + + gh api \ + --method PATCH \ + "/repos/:owner/:repo/releases/${RELEASE_ID}" \ + --field "tag_name=${RELEASE_TAG_NAME}" \ + --field "name=${RELEASE_NAME}" \ + --field "body=${RELEASE_BODY///\`${DIGEST}\`}" + env: + DIGEST: ${{ steps.package.outputs.digest }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/minimal-labels.yml b/.github/workflows/minimal-labels.yml new file mode 100644 index 0000000..1bb1fd6 --- /dev/null +++ b/.github/workflows/minimal-labels.yml @@ -0,0 +1,29 @@ +name: Minimal Labels +"on": + pull_request: + types: + - synchronize + - reopened + - labeled + - unlabeled +jobs: + semver: + name: Minimal Semver Labels + runs-on: + - ubuntu-latest + steps: + - uses: mheap/github-action-required-labels@v1 + with: + count: 1 + labels: semver:major, semver:minor, semver:patch + mode: exactly + type: + name: Minimal Type Labels + runs-on: + - ubuntu-latest + steps: + - uses: mheap/github-action-required-labels@v1 + with: + count: 1 + labels: type:bug, type:dependency-upgrade, type:documentation, type:enhancement, type:question, type:task + mode: exactly diff --git a/.github/workflows/synchronize-labels.yml b/.github/workflows/synchronize-labels.yml new file mode 100644 index 0000000..598e7ad --- /dev/null +++ b/.github/workflows/synchronize-labels.yml @@ -0,0 +1,17 @@ +name: Synchronize Labels +"on": + push: + branches: + - main + paths: + - .github/labels.yml +jobs: + synchronize: + name: Synchronize Labels + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: micnncim/action-label-syncer@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..6b34490 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,147 @@ +name: Tests +"on": + pull_request: {} + push: + branches: + - main +jobs: + create-package: + name: Create Package Test + runs-on: + - ubuntu-latest + steps: + - name: Docker login gcr.io + uses: docker/login-action@v1 + with: + password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }} + registry: gcr.io + username: _json_key + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + key: ${{ runner.os }}-go-${{ hashFiles('**/buildpack.toml', '**/package.toml') }} + path: |- + ${{ env.HOME }}/.pack + ${{ env.HOME }}/carton-cache + restore-keys: ${{ runner.os }}-go- + - uses: actions/setup-go@v2 + with: + go-version: "1.15" + - name: Install create-package + run: | + #!/usr/bin/env bash + + set -euo pipefail + + GO111MODULE=on go get -u -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/create-package + - name: Install pack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + mkdir -p "${HOME}"/bin + echo "${HOME}/bin" >> "${GITHUB_PATH}" + + curl \ + --location \ + --show-error \ + --silent \ + "https://github.com/buildpacks/pack/releases/download/v${PACK_VERSION}/pack-v${PACK_VERSION}-linux.tgz" \ + | tar -C "${HOME}"/bin/ -xzv pack + env: + PACK_VERSION: 0.14.1 + - id: version + name: Compute Version + run: | + #!/usr/bin/env bash + + set -euo pipefail + + if [[ ${GITHUB_REF} =~ refs/tags/v([0-9]+\.[0-9]+\.[0-9]+) ]]; then + VERSION=${BASH_REMATCH[1]} + elif [[ ${GITHUB_REF} =~ refs/heads/(.+) ]]; then + VERSION=${BASH_REMATCH[1]} + else + VERSION=$(git rev-parse --short HEAD) + fi + + echo "::set-output name=version::${VERSION}" + echo "Selected ${VERSION} from + * ref: ${GITHUB_REF} + * sha: ${GITHUB_SHA} + " + - name: Create Package + run: | + #!/usr/bin/env bash + + set -euo pipefail + + if [[ "${INCLUDE_DEPENDENCIES}" == "true" ]]; then + create-package \ + --cache-location "${HOME}"/carton-cache \ + --destination "${HOME}"/buildpack \ + --include-dependencies \ + --version "${VERSION}" + else + create-package \ + --destination "${HOME}"/buildpack \ + --version "${VERSION}" + fi + + [[ -e package.toml ]] && cp package.toml "${HOME}"/package.toml + printf '[buildpack]\nuri = "%s"' "${HOME}"/buildpack >> "${HOME}"/package.toml + env: + INCLUDE_DEPENDENCIES: "true" + VERSION: ${{ steps.version.outputs.version }} + - name: Package Buildpack + run: | + #!/usr/bin/env bash + + set -euo pipefail + + if [[ -n "${PUBLISH+x}" ]]; then + pack package-buildpack \ + "${PACKAGE}:${VERSION}" \ + --config "${HOME}"/package.toml \ + --publish + + echo "::set-output name=digest::$(crane digest "${PACKAGE}:${VERSION}")" + else + pack package-buildpack \ + "${PACKAGE}:${VERSION}" \ + --config "${HOME}"/package.toml + fi + env: + PACKAGE: test + VERSION: ${{ steps.version.outputs.version }} + unit: + name: Unit Test + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/cache@v2 + with: + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + path: ${{ env.HOME }}/go/pkg/mod + restore-keys: ${{ runner.os }}-go- + - uses: actions/setup-go@v2 + with: + go-version: "1.15" + - name: Install richgo + run: | + #!/usr/bin/env bash + + set -euo pipefail + + GO111MODULE=on go get -u -ldflags="-s -w" github.com/kyoh86/richgo + - name: Run Tests + run: | + #!/usr/bin/env bash + + set -euo pipefail + + richgo test ./... + env: + RICHGO_FORCE_COLOR: "1" diff --git a/.github/workflows/update-draft-release.yml b/.github/workflows/update-draft-release.yml new file mode 100644 index 0000000..0002b4a --- /dev/null +++ b/.github/workflows/update-draft-release.yml @@ -0,0 +1,169 @@ +name: Update Draft Release +"on": + push: + branches: + - main +jobs: + update: + name: Update Draft Release + runs-on: + - ubuntu-latest + steps: + - id: release-drafter + uses: release-drafter/release-drafter@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Docker login gcr.io + uses: docker/login-action@v1 + with: + password: ${{ secrets.RIFF_GCLOUD_SERVICE_ACCOUNT_KEY }} + registry: gcr.io + username: _json_key + - uses: actions/checkout@v2 + - name: Install yj + run: | + #!/usr/bin/env bash + + set -euo pipefail + + mkdir -p "${HOME}"/bin + echo "${HOME}/bin" >> "${GITHUB_PATH}" + + curl \ + --location \ + --show-error \ + --silent \ + --output "${HOME}"/bin/yj \ + "https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux" + + chmod +x "${HOME}"/bin/yj + env: + YJ_VERSION: 5.0.0 + - name: Update draft release with buildpack information + run: | + #!/usr/bin/env bash + + set -euo pipefail + + PAYLOAD=$(yj -tj < buildpack.toml | jq '{ primary: . }') + + if [[ -e package.toml ]]; then + for PACKAGE in $(yj -t < package.toml | jq -r '.dependencies[].image'); do + PAYLOAD=$(jq -n -r \ + --argjson PAYLOAD "${PAYLOAD}" \ + --argjson BUILDPACK "$(crane export "${PACKAGE}" - \ + | tar xOf - --absolute-names --wildcards "/cnb/buildpacks/*/*/buildpack.toml" \ + | yj -tj)" \ + '$PAYLOAD | .buildpacks += [ $BUILDPACK ]') + done + fi + + jq -n -r \ + --argjson PAYLOAD "${PAYLOAD}" \ + --arg RELEASE_NAME "${RELEASE_NAME}" \ + '"\($PAYLOAD.primary.buildpack.name) \($RELEASE_NAME)"' \ + > "${HOME}"/name + + jq -n -r \ + --argjson PAYLOAD "${PAYLOAD}" \ + --arg RELEASE_BODY "${RELEASE_BODY}" \ + ' + def id(b): + "**ID**: `\(b.buildpack.id)`" + ; + + def included_buildpackages(b): [ + "#### Included Buildpackages:", + "Name | ID | Version", + ":--- | :- | :------", + ( b | sort_by(.buildpack.name | ascii_downcase) | map("\(.buildpack.name) | `\(.buildpack.id)` | `\(.buildpack.version)`") ), + "" + ]; + + def stacks(s): [ + "#### Supported Stacks:", + ( s | sort_by(.id | ascii_downcase) | map("- `\(.id)`") ), + "" + ]; + + def default_dependency_versions(d): [ + "#### Default Dependency Versions:", + "ID | Version", + ":- | :------", + ( d | to_entries | sort_by(.key | ascii_downcase) | map("`\(.key)` | `\(.value)`") ), + "" + ]; + + def dependencies(d): [ + "#### Dependencies:", + "Name | Version | SHA256", + ":--- | :------ | :-----", + ( d | sort_by(.name | ascii_downcase) | map("\(.name) | `\(.version)` | `\(.sha256)`")), + "" + ]; + + def order_groupings(o): [ + "
", + "Order Groupings", + "", + ( o | map([ + "ID | Version | Optional", + ":- | :------ | :-------", + ( .group | map([ "`\(.id)` | `\(.version)`", ( select(.optional) | "| `\(.optional)`" ) ] | join(" ")) ), + "" + ])), + "
", + "" + ]; + + def primary_buildpack(p): [ + id(p.primary), + "**Digest**: ", + "", + ( select(p.buildpacks) | included_buildpackages(p.buildpacks) ), + ( select(p.primary.stacks) | stacks(p.primary.stacks) ), + ( select(p.primary.metadata."default-versions") | default_dependency_versions(p.primary.metadata."default-versions") ), + ( select(p.primary.metadata.dependencies) | dependencies(p.primary.metadata.dependencies) ), + ( select(p.primary.order) | order_groupings(p.primary.order) ), + ( select(p.buildpacks) | "---" ), + "" + ]; + + def nested_buildpack(b): [ + "
", + "\(b.buildpack.name) \(b.buildpack.version)", + "", + id(b), + "", + ( select(b.stacks) | stacks(b.stacks) ), + ( select(b.metadata."default-versions") | default_dependency_versions(b.metadata."default-versions") ), + ( select(b.metadata.dependencies) | dependencies(b.metadata.dependencies) ), + ( select(b.order) | order_groupings(b.order) ), + "---", + "", + "
", + "" + ]; + + $PAYLOAD | [ + primary_buildpack(.), + ( select(.buildpacks) | [ .buildpacks | sort_by(.buildpack.name | ascii_downcase) | map(nested_buildpack(.)) ] ), + "", + "---", + "", + $RELEASE_BODY + ] | flatten | join("\n") + ' > "${HOME}"/body + + gh api \ + --method PATCH \ + "/repos/:owner/:repo/releases/${RELEASE_ID}" \ + --field "tag_name=${RELEASE_TAG_NAME}" \ + --field "name=@${HOME}/name" \ + --field "body=@${HOME}/body" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + RELEASE_BODY: ${{ steps.release-drafter.outputs.body }} + RELEASE_ID: ${{ steps.release-drafter.outputs.id }} + RELEASE_NAME: ${{ steps.release-drafter.outputs.name }} + RELEASE_TAG_NAME: ${{ steps.release-drafter.outputs.tag_name }} diff --git a/.github/workflows/update-invoker.yml b/.github/workflows/update-invoker.yml new file mode 100644 index 0000000..0338c8f --- /dev/null +++ b/.github/workflows/update-invoker.yml @@ -0,0 +1,91 @@ +name: Update invoker +"on": + schedule: + - cron: 30 * * * * + workflow_dispatch: {} +jobs: + update: + name: Update Buildpack Dependency + runs-on: + - ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-go@v2 + with: + go-version: "1.15" + - name: Install update-buildpack-dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + GO111MODULE=on go get -u -ldflags="-s -w" github.com/paketo-buildpacks/libpak/cmd/update-buildpack-dependency + - name: Install yj + run: | + #!/usr/bin/env bash + + set -euo pipefail + + mkdir -p "${HOME}"/bin + echo "${HOME}/bin" >> "${GITHUB_PATH}" + + curl \ + --location \ + --show-error \ + --silent \ + --output "${HOME}"/bin/yj \ + "https://github.com/sclevine/yj/releases/download/v${YJ_VERSION}/yj-linux" + + chmod +x "${HOME}"/bin/yj + env: + YJ_VERSION: 5.0.0 + - id: dependency + uses: docker://ghcr.io/paketo-buildpacks/actions/gcs-dependency:main + with: + bucket: projectriff + glob: java-function-invoker/releases/v([\d\.]+)/java-function-invoker-(?:[\d\.]+).jar + - id: buildpack + name: Update Buildpack Dependency + run: | + #!/usr/bin/env bash + + set -euo pipefail + + OLD_VERSION=$(yj -tj < buildpack.toml | jq -r " + .metadata.dependencies[] | + select( .id == env.ID ) | + select( .version | test( env.VERSION_PATTERN ) ) | + .version") + + update-buildpack-dependency \ + --buildpack-toml buildpack.toml \ + --id "${ID}" \ + --version-pattern "${VERSION_PATTERN}" \ + --version "${VERSION}" \ + --uri "${URI}" \ + --sha256 "${SHA256}" + + git add buildpack.toml + git checkout -- . + + echo "::set-output name=old-version::${OLD_VERSION}" + echo "::set-output name=new-version::${VERSION}" + env: + ID: invoker + SHA256: ${{ steps.dependency.outputs.sha256 }} + URI: ${{ steps.dependency.outputs.uri }} + VERSION: ${{ steps.dependency.outputs.version }} + VERSION_PATTERN: '[\d]+\.[\d]+\.[\d]+' + - uses: peter-evans/create-pull-request@v3 + with: + body: Bumps `invoker` from `${{ steps.buildpack.outputs.old-version }}` to `${{ steps.buildpack.outputs.new-version }}`. + branch: update/buildpack/invoker + commit-message: |- + Bump invoker from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + + Bumps invoker from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }}. + delete-branch: true + labels: semver:minor, type:dependency-upgrade + signoff: true + title: Bump invoker from ${{ steps.buildpack.outputs.old-version }} to ${{ steps.buildpack.outputs.new-version }} + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/buildpack.toml b/buildpack.toml index b8f4e65..c125f4a 100644 --- a/buildpack.toml +++ b/buildpack.toml @@ -42,9 +42,9 @@ build = true [[metadata.dependencies]] id = "invoker" name = "riff Java Invoker" -version = "0.2.0" -uri = "https://storage.googleapis.com/projectriff/java-function-invoker/releases/v0.2.0/java-function-invoker-0.2.0.jar" -sha256 = "7ed717ba5c18e8bfab19d4db817112b8c5d3bb7ac1e81764589724ccc644bdcd" +version = "0.0.0" +uri = "placeholder" +sha256 = "placholder" stacks = [ "heroku-18", "io.buildpacks.stacks.bionic", "org.cloudfoundry.stacks.cflinuxfs3" ] [[metadata.dependencies.licenses]] diff --git a/go.mod b/go.mod index 8f1d2b9..70df00b 100644 --- a/go.mod +++ b/go.mod @@ -4,10 +4,8 @@ go 1.15 require ( github.com/buildpacks/libcnb v1.18.0 - github.com/mattn/go-colorable v0.1.8 // indirect github.com/onsi/gomega v1.10.3 github.com/paketo-buildpacks/libpak v1.46.0 github.com/projectriff/libfnbuildpack v0.9.2 github.com/sclevine/spec v1.4.0 - golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 // indirect ) diff --git a/go.sum b/go.sum index 9c7f5a8..e764844 100644 --- a/go.sum +++ b/go.sum @@ -34,9 +34,8 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.7 h1:bQGKb3vps/j0E9GfJQ03JyhRuxsvdAanXlT9BTw3mdw= github.com/mattn/go-colorable v0.1.7/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= -github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= -github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= @@ -90,9 +89,8 @@ golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200909081042-eff7692f9009/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f h1:+Nyd8tzPX9R7BWHguqsrbFdRx3WQ/1ib8I44HXV5yTA= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634 h1:bNEHhJCnrwMKNMmOx3yAynp5vs5/gRy+XWFtZFu7NBM= -golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3 h1:cokOdA+Jmi5PJGXLlLllQSgYigAEfHXJAERHVMaCc2k= diff --git a/scripts/build.sh b/scripts/build.sh index 2213a13..e6852d2 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -2,12 +2,11 @@ set -euo pipefail -if [[ -d ../go-cache ]]; then - GOPATH=$(realpath ../go-cache) - export GOPATH -fi - GOOS="linux" go build -ldflags='-s -w' -o bin/main github.com/projectriff/java-function-buildpack/cmd/main + +strip bin/main +upx -q -9 bin/main + ln -fs main bin/build ln -fs main bin/detect diff --git a/scripts/update-buildpack-dependency.sh b/scripts/update-buildpack-dependency.sh deleted file mode 100755 index ee81748..0000000 --- a/scripts/update-buildpack-dependency.sh +++ /dev/null @@ -1,7 +0,0 @@ -uri() { - sed 's|gs://|https://storage.googleapis.com/|' "${ROOT}"/dependency/url -} - -sha256() { - shasum -a 256 "${ROOT}"/dependency/java-function-invoker-*.jar | cut -f 1 -d ' ' -}