Skip to content

Commit

Permalink
Share the backport script
Browse files Browse the repository at this point in the history
This allows "make backport" to be used in any Shipyard-based repository.

Signed-off-by: Stephen Kitt <[email protected]>
  • Loading branch information
skitt authored and tpantelis committed Oct 26, 2021
1 parent e407fa0 commit 5f3ceac
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.dapper
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ ARG BASE_BRANCH
FROM quay.io/submariner/shipyard-dapper-base:${BASE_BRANCH}

ARG PROJECT
ENV DAPPER_ENV="QUAY_USERNAME QUAY_PASSWORD CLUSTERS_ARGS DEPLOY_ARGS CLEANUP_ARGS E2E_ARGS RELEASE_ARGS MAKEFLAGS FOCUS SKIP PLUGIN E2E_TESTDIR" \
ENV DAPPER_ENV="QUAY_USERNAME QUAY_PASSWORD CLUSTERS_ARGS DEPLOY_ARGS CLEANUP_ARGS E2E_ARGS RELEASE_ARGS MAKEFLAGS FOCUS SKIP PLUGIN E2E_TESTDIR GITHUB_USER GITHUB_TOKEN" \
DAPPER_SOURCE=/go/src/github.com/submariner-io/${PROJECT} DAPPER_DOCKER_SOCKET=true
ENV DAPPER_OUTPUT=${DAPPER_SOURCE}/output

Expand Down
5 changes: 1 addition & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,7 @@ prune-images:
fi \
done

backport:
scripts/shared/backport.sh $(release) $(pr)

NON_DAPPER_GOALS += prune-images backport
NON_DAPPER_GOALS += prune-images
.PHONY: prune-images

include Makefile.dapper
Expand Down
5 changes: 5 additions & 0 deletions Makefile.inc
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ vendor/modules.txt: go.mod
CODEOWNERS: CODEOWNERS.in
$(SCRIPTS_DIR)/gen-codeowners

# [backport] creates a PR to backport the PR identified by pr= to the release identified by release=
# This needs gh, and a GITHUB_TOKEN with repo and read:org
backport:
$(SCRIPTS_DIR)/backport.sh $(release) $(pr)

# [prune-images] removes all Submariner-provided images and all untagged images
# Use this to ensure you use current images
# Copied from Makefile to provide this everywhere (until we can share
Expand Down
7 changes: 6 additions & 1 deletion package/Dockerfile.shipyard-dapper-base
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ ENV HOST_ARCH=${DAPPER_HOST_ARCH} ARCH=${DAPPER_HOST_ARCH} PATH=/go/bin:/usr/loc
# curl | download other tools
# findutils | make unit (find unit test dirs)
# gcc | needed by `go test -race` (https://github.com/golang/go/issues/27089)
# gh | backport, releases
# ginkgo | tests
# git | find the workspace root
# gitlint | Commit message linting
Expand Down Expand Up @@ -53,7 +54,8 @@ RUN dnf -y install --nodocs --setopt=install_weak_deps=False \
ENV LINT_VERSION=v1.42.1 \
HELM_VERSION=v3.4.1 \
KIND_VERSION=v0.11.1 \
BUILDX_VERSION=v0.5.1
BUILDX_VERSION=v0.5.1 \
GH_VERSION=2.2.0

# This layer's versioning is determined by us, and thus could be rebuilt more frequently to test different versions
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin -d ${LINT_VERSION} && \
Expand All @@ -64,6 +66,9 @@ RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/i
mkdir -p ~/.docker/cli-plugins && \
curl -L "https://github.com/docker/buildx/releases/download/${BUILDX_VERSION}/buildx-${BUILDX_VERSION}.linux-${ARCH}" -o ~/.docker/cli-plugins/docker-buildx && \
chmod 755 ~/.docker/cli-plugins/docker-buildx && \
curl -L https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_${ARCH}.tar.gz | tar xzf - && \
mv gh_${GH_VERSION}_linux_${ARCH}/bin/gh /go/bin/ && \
rm -rf gh_${GH_VERSION}_linux_${ARCH} && \
find /go/bin ~/.docker/cli-plugins -type f -executable -newercc /proc -exec strip {} + && \
find /go/bin ~/.docker/cli-plugins -type f -executable -newercc /proc \( -execdir upx ${UPX_LEVEL} {} \; -o -true \)

Expand Down

0 comments on commit 5f3ceac

Please sign in to comment.