From 0c7f57f93947d293b060b545068f18c3503beb39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miko=C5=82aj=20Baranowski?= Date: Wed, 20 Sep 2023 16:48:20 +0200 Subject: [PATCH] ci: Add docker credentials (#110) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ci: Add docker credentials Signed-off-by: Mikołaj Baranowski * chore: Use nexus credentials Signed-off-by: Mikołaj Baranowski * ci: GITHUB_REPOSITORY is a variable provided by GHAs Signed-off-by: Mikołaj Baranowski --------- Signed-off-by: Mikołaj Baranowski --- .github/workflows/release-airgap-artifacts.yaml | 7 +++++++ Makefile | 3 +-- make/ci.mk | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release-airgap-artifacts.yaml b/.github/workflows/release-airgap-artifacts.yaml index aa52dc72..5f7d116c 100644 --- a/.github/workflows/release-airgap-artifacts.yaml +++ b/.github/workflows/release-airgap-artifacts.yaml @@ -13,6 +13,7 @@ jobs: runs-on: - self-hosted - medium + steps: - name: Checkout code uses: actions/checkout@v3 @@ -30,6 +31,12 @@ jobs: role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/dkp-catalog-applications aws-region: us-west-2 + - name: Login to Docker Hub and Nexus + uses: mesosphere/workflow-db/actions/docker/login@main + with: + username: ${{ secrets.NEXUS_USERNAME }} + password: ${{ secrets.NEXUS_PASSWORD }} + - name: make release.chart-bundle run: make ci.docker.run GOOS=linux GOARCH=amd64 RUN_WHAT="make release.chart-bundle" diff --git a/Makefile b/Makefile index 37aa95b2..3579cafb 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,7 @@ REPO_ROOT := $(CURDIR) INTERACTIVE := $(shell [ -t 0 ] && echo 1) export GOPRIVATE ?= github.com/mesosphere -export GITHUB_ORG ?= mesosphere -export GITHUB_REPOSITORY ?= dkp-catalog-applications +export GITHUB_REPOSITORY ?= mesosphere/dkp-catalog-applications export GOBIN := $(REPO_ROOT)/bin/$(GOOS)/$(GOARCH) export PATH := $(GOBIN):$(PATH) GOARCH ?= $(shell go env GOARCH) diff --git a/make/ci.mk b/make/ci.mk index 0a1bd890..7bf5f1f2 100644 --- a/make/ci.mk +++ b/make/ci.mk @@ -2,9 +2,9 @@ CI_DOCKERFILE ?= $(REPO_ROOT)/Dockerfile.ci ifneq ($(wildcard $(CI_DOCKERFILE)),) CI_DOCKER_TAG ?= $(shell (cat $(CI_DOCKERFILE) $(CI_DOCKER_EXTRA_FILES) \ - $(if $(CI_DOCKER_BUILD_ARGS),&& echo $(CI_DOCKER_BUILD_ARGS))) \ - | shasum | awk '{ print $$1 }') -CI_DOCKER_IMG ?= $(GITHUB_ORG)/$(GITHUB_REPOSITORY)-ci:$(CI_DOCKER_TAG) + $(if $(CI_DOCKER_BUILD_ARGS),&& echo $(CI_DOCKER_BUILD_ARGS))) \ + | shasum | awk '{ print $$1 }') +CI_DOCKER_IMG ?= $(GITHUB_REPOSITORY)-ci:$(CI_DOCKER_TAG) export GOLANG_VERSION ?= 1.19.1 DOCKER_VERSION ?= 20.10.7 @@ -46,7 +46,7 @@ ci.docker.run: RUN_WHAT ?= ci.docker.run: ci.docker.ensure ; $(info $(M) Runs the build in the CI Docker image) docker run --rm -i$(if $(RUN_WHAT),,$(if $(INTERACTIVE),t)) \ -v $(REPO_ROOT):$(REPO_ROOT) \ - -w $(REPO_ROOT) \ + -w $(REPO_ROOT) \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /etc/docker/certs.d:/etc/docker/certs.d \ $(if $(AWS_REGION),-e AWS_REGION=$(AWS_REGION)) \