Skip to content

Commit

Permalink
Add ARG MODE to plugins/chainlink.Dockerfile to enable Beholder in de…
Browse files Browse the repository at this point in the history
…v/test (#14560)

* Add ARG MODE to plugins/chainlink.Dockerfile to enable Beholder in dev/test

* Adjusting make scripts to accept build tags with TAG var

* Testing out new build args

---------

Co-authored-by: Sergei Drugalev <[email protected]>
Co-authored-by: Damjan Smickovski <[email protected]>
  • Loading branch information
3 people committed Oct 23, 2024
1 parent 35dbee9 commit 407c01e
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 5 additions & 1 deletion .github/actions/build-chainlink-image/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ inputs:
description: "Check if the image exists in ECR before building"
required: false
default: 'false'
build_args:
required: false
description: Additional build arguments for the image

runs:
using: composite
Expand All @@ -37,7 +40,7 @@ runs:
AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }}
- name: Build Image
if: steps.check-image.outputs.exists != 'true'
uses: smartcontractkit/.github/actions/ctf-build-image@1a26fe378d7ebdc34ab1fe31ec4a6d1c376199f8 # [email protected]
uses: smartcontractkit/.github/actions/ctf-build-image@f1078918a926c0a75eeebbad8ffc3f98b8502ba9 # [email protected]
with:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ inputs.git_commit_sha }}
Expand All @@ -47,6 +50,7 @@ runs:
QA_AWS_ROLE_TO_ASSUME: ${{ inputs.AWS_ROLE_TO_ASSUME }}
GO_COVER_FLAG: true
dep_evm_sha: ${{ inputs.dep_evm_sha }}
build_args: ${{ inputs.build_args }}
- name: Print Chainlink Image Built
shell: sh
run: |
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ jobs:
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
dep_evm_sha: ${{ inputs.evm-ref }}
build_args: |
TAGS=dev
run-core-e2e-tests-for-pr:
name: Run Core E2E Tests For PR
Expand Down
12 changes: 8 additions & 4 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,27 @@ docs: ## Install and run pkgsite to view Go docs

.PHONY: install-chainlink
install-chainlink: operator-ui ## Install the chainlink binary.
go install $(GOFLAGS) .
go install $(GOFLAGS) $(if $(TAGS),-tags $(TAGS)) .

.PHONY: install-chainlink-dev
install-chainlink-dev: operator-ui ## Install a dev build of the chainlink binary.
$(MAKE) install-chainlink TAGS="dev $(TAGS)"

.PHONY: install-chainlink-cover
install-chainlink-cover: operator-ui ## Install the chainlink binary with cover flag.
go install -cover $(GOFLAGS) .

.PHONY: chainlink
chainlink: ## Build the chainlink binary.
go build $(GOFLAGS) .
go build $(GOFLAGS) $(if $(TAGS),-tags $(TAGS)) .

.PHONY: chainlink-dev
chainlink-dev: ## Build a dev build of chainlink binary.
go build -tags dev $(GOFLAGS) .
$(MAKE) chainlink TAGS="dev $(TAGS)"

.PHONY: chainlink-test
chainlink-test: ## Build a test build of chainlink binary.
go build $(GOFLAGS) .
$(MAKE) chainlink

.PHONY: install-medianpoc
install-medianpoc: ## Build & install the chainlink-medianpoc binary.
Expand Down
7 changes: 4 additions & 3 deletions plugins/chainlink.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@ COPY tools/bin/ldflags ./tools/bin/
ADD go.mod go.sum ./
RUN go mod download

# Env vars needed for chainlink build
# Chainlink build args
ARG COMMIT_SHA
ARG TAGS

COPY . .

RUN apt-get update && apt-get install -y jq

# Build the golang binaries
RUN make install-chainlink
# Build the golang binaries (use dev mode if specified)
RUN bash -c "make install-chainlink TAGS=\"$TAGS\""

# Install medianpoc binary
RUN make install-medianpoc
Expand Down

0 comments on commit 407c01e

Please sign in to comment.