Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ jobs:
name: Run CI
runs-on: ubuntu-latest
steps:
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.22'
id: go

- name: Check out the code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'

- name: Make CI
run: make ci
Expand Down
42 changes: 6 additions & 36 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,13 @@ jobs:
runs-on: ubuntu-latest
steps:

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: '1.22'
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v3
uses: actions/checkout@v4

- id: 'auth'
uses: 'google-github-actions/auth@v2'
- name: Set up Go
uses: actions/setup-go@v5
with:
credentials_json: '${{ secrets.GCS_SA_KEY }}'
- name: 'Setup Cloud SDK'
uses: google-github-actions/setup-gcloud@v2
- name: 'Use gcloud CLI'
run: gcloud info
go-version-file: 'go.mod'

- name: Set up QEMU
id: qemu
Expand All @@ -58,30 +48,10 @@ jobs:
files: coverage.out
verbose: true

# Use the JSON key in secret to login gcr.io
- uses: 'docker/login-action@v2'
with:
registry: 'gcr.io' # or REGION.docker.pkg.dev
username: '_json_key'
password: '${{ secrets.GCR_SA_KEY }}'

# Only try to publish the container image from the root repo; forks don't have permission to do so and will always get failures.
- name: Publish container image
if: github.repository == 'vmware-tanzu/velero-plugin-for-aws'
run: |
docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
# Call `docker-push.sh` to push the velero-plugin-for-aws image to docker hub and gcr.io.
VERSION=$(./hack/docker-push.sh | grep 'VERSION:' | awk -F: '{print $2}' | xargs)

# Upload velero-plugin-for-aws image package to GCS
source hack/ci/build_util.sh
BIN=velero-plugin-for-aws
GCS_BUCKET=velero-builds
VELERO_PLUGIN_IMAGE=${BIN}-${VERSION}
VELERO_PLUGIN_IMAGE_FILE=${VELERO_PLUGIN_IMAGE}.tar.gz
VELERO_PLUGIN_IMAGE_BACKUP_FILE=${VELERO_PLUGIN_IMAGE}-'build.'${GITHUB_RUN_NUMBER}.tar.gz

cp ${VELERO_PLUGIN_IMAGE_FILE} ${VELERO_PLUGIN_IMAGE_BACKUP_FILE}

uploader ${VELERO_PLUGIN_IMAGE_FILE} ${GCS_BUCKET}
uploader ${VELERO_PLUGIN_IMAGE_BACKUP_FILE} ${GCS_BUCKET}
# Call `docker-push.sh` to push the velero-plugin-for-aws image to docker hub.
./hack/docker-push.sh
5 changes: 0 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ PKG := github.com/vmware-tanzu/velero-plugin-for-aws

# Where to push the docker image.
REGISTRY ?= velero
GCR_REGISTRY ?= gcr.io/velero-gcp

# Image name
IMAGE ?= $(REGISTRY)/$(BIN)
GCR_IMAGE ?= $(GCR_REGISTRY)/$(BIN)

# We allow the Dockerfile to be configurable to enable the use of custom Dockerfiles
# that pull base images from different registries.
Expand All @@ -42,10 +40,8 @@ TAG_LATEST ?= false

ifeq ($(TAG_LATEST), true)
IMAGE_TAGS ?= $(IMAGE):$(VERSION) $(IMAGE):latest
GCR_IMAGE_TAGS ?= $(GCR_IMAGE):$(VERSION) $(GCR_IMAGE):latest
else
IMAGE_TAGS ?= $(IMAGE):$(VERSION)
GCR_IMAGE_TAGS ?= $(GCR_IMAGE):$(VERSION)
endif

ifeq ($(shell docker buildx inspect 2>/dev/null | awk '/Status/ { print $$2 }'), running)
Expand Down Expand Up @@ -107,7 +103,6 @@ endif
--output=type=$(BUILDX_OUTPUT_TYPE) \
--platform $(BUILDX_PLATFORMS) \
$(addprefix -t , $(IMAGE_TAGS)) \
$(addprefix -t , $(GCR_IMAGE_TAGS)) \
--build-arg=GOPROXY=$(GOPROXY) \
--build-arg=PKG=$(PKG) \
--build-arg=BIN=$(BIN) \
Expand Down