-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: nicholas-codecov <nicholas.deschenes@sentry.io>
- Loading branch information
1 parent
7fcb70b
commit 0160343
Showing
4 changed files
with
76 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Test API Image CI | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- integration-tests/test-api/** | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
build: | ||
name: Build API Test | ||
uses: codecov/gha-workflows/.github/workflows/build-and-push-dockerhub.yml@v1.2.14 | ||
secrets: inherit | ||
with: | ||
push: false | ||
image_name: codecov-javascript-bundler-plugins-test-api | ||
docker_path: integration-tests/test-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Test API Image Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- integration-tests/test-api/** | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
|
||
jobs: | ||
push: | ||
name: Push API Test | ||
if: github.repository_owner == 'codecov' | ||
uses: codecov/gha-workflows/.github/workflows/build-and-push-dockerhub.yml@v1.2.14 | ||
secrets: inherit | ||
with: | ||
push: true | ||
image_name: codecov-javascript-bundler-plugins-test-api | ||
docker_path: integration-tests/test-api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
DOCKERHUB_REPO ?= codecov | ||
IMAGE_NAME ?= codecov-javascript-bundler-plugins-test-api | ||
DOCKER_PATH ?= integration-tests/test-api | ||
OS_NAME := $(shell uname -s | tr A-Z a-z) | ||
build_date := $(shell git show -s --date=iso8601-strict --pretty=format:%cd $$sha) | ||
BUILD_PLATFORM := $(shell docker system info --format '{{.OSType}}/{{.Architecture}}') | ||
sha := $(shell git rev-parse --short=7 HEAD) | ||
dockerhub_image := ${DOCKERHUB_REPO}/${IMAGE_NAME} | ||
export DOCKER_BUILDKIT := 1 | ||
|
||
build.${IMAGE_NAME}: | ||
docker build -f ${DOCKER_PATH}/Dockerfile ${DOCKER_PATH} -t ${dockerhub_image}:latest \ | ||
-t ${dockerhub_image}:${sha} \ | ||
--label "org.label-schema.build-date"="$(build_date)" \ | ||
--label "org.label-schema.name"="${IMAGE_NAME}" \ | ||
--label "org.label-schema.vendor"="Codecov" \ | ||
--label "org.label-schema.version"="${sha}" \ | ||
--build-arg BUILDPLATFORM=${BUILD_PLATFORM} | ||
|
||
tag.${IMAGE_NAME}: | ||
docker tag ${dockerhub_image}:${sha} ${dockerhub_image}:latest | ||
|
||
push.${IMAGE_NAME}: | ||
docker push ${dockerhub_image}:latest | ||
docker push ${dockerhub_image}:${sha} | ||
|
||
save.${IMAGE_NAME}: | ||
docker save -o ${IMAGE_NAME}.tar ${dockerhub_image}:${sha} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters