Skip to content

Commit

Permalink
Sync build scripts with other projects
Browse files Browse the repository at this point in the history
Mostly trivia like making the build goals more similar to our other
projects. Now we also create a GH release and upload the manifest to
it.

Signed-off-by: Toby Cabot <toby@acnodal.io>
  • Loading branch information
caboteria committed Sep 13, 2023
1 parent 2c10859 commit 8d895bf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
13 changes: 10 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jobs:

steps:
- uses: actions/checkout@v3
with: {submodules: recursive}

- uses: actions/setup-go@v4
with: {go-version: '=1.19.8'}
Expand All @@ -26,10 +25,18 @@ jobs:
- name: Make
run: |
make SUFFIX=${TAG_SPECIFIC} test docker-build
make SUFFIX=${TAG_SPECIFIC} test manifest image-build
- name: Push
if: startsWith(github.ref, 'refs/tags/')
run: |
docker login -u epic-gateway+github_actions -p ${{ secrets.QUAY_EPIC_GATEWAY }} quay.io
make SUFFIX=${TAG_SPECIFIC} docker-push
make SUFFIX=${TAG_SPECIFIC} image-push
- name: Create a new pre-release
if: startsWith(github.ref, 'refs/tags/')
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
files: |
deploy/web-service.yaml
2 changes: 1 addition & 1 deletion .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ docker:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY

script:
- make SUFFIX=${TAG_SPECIFIC} GITLAB_USER=gitlab-ci-token GITLAB_PASSWORD=${CI_JOB_TOKEN} manifest install
- make SUFFIX=${TAG_SPECIFIC} GITLAB_USER=gitlab-ci-token GITLAB_PASSWORD=${CI_JOB_TOKEN} manifest image-build image-push
- 'curl --silent --show-error --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file deploy/web-service.yaml "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/manifest/${TAG_SPECIFIC}/web-service.yaml"'

artifacts:
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ TAG ?= ${REPO}/${PREFIX}:${SUFFIX}
help: ## Display this help
@echo "Usage:"
@echo " make <goal> [VAR=value ...]"
@echo ""
@echo
@echo "Variables"
@echo " REPO The registry part of the Docker tag"
@echo " PREFIX Docker tag prefix (after the registry, before the suffix)"
Expand All @@ -28,10 +28,12 @@ test: ## Run some code quality checks
run: ## Run the service using "go run" (KUBECONFIG needs to be set)
go run ./main.go

docker-build: ## Build the Docker image
.PHONY: image-build
image-build: ## Build the Docker image
docker build --tag=${TAG} ${DOCKER_BUILD_OPTIONS} .

docker-push: docker-build ## Push the image to the registry
.PHONY: image-push
image-push: ## Push the image to the registry
docker push ${TAG}

.PHONY: manifest
Expand Down

0 comments on commit 8d895bf

Please sign in to comment.