Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using gcr in ci #674

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
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
6 changes: 3 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ orbs:
executors:
golang-executor:
docker:
- image: gcr.io/gcr-for-testing/golang:1.22.12
- image: golang:1.22.12
machine-executor:
machine:
image: ubuntu-2204:current
Expand All @@ -19,13 +19,13 @@ aliases:
parameters:
goImage:
type: string
default: "gcr.io/gcr-for-testing/golang:1.22.6"
default: "gcr.io/gcr-for-testing/golang:1.22.12"
arangodbImage:
type: string
default: "gcr.io/gcr-for-testing/arangodb/enterprise-preview:devel-nightly"
alpineImage:
type: string
default: "gcr.io/gcr-for-testing/alpine:3.17"
default: "gcr.io/gcr-for-testing/alpine:3.21"
starterImage:
type: string
default: "arangodb/arangodb-starter:latest"
Expand Down
35 changes: 29 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ROOTDIR:=$(CURR)
GOVERSION ?= 1.22.12
GOIMAGE ?= golang:$(GOVERSION)
GOV2IMAGE ?= $(GOIMAGE)
ALPINE_IMAGE ?= alpine:3.17
ALPINE_IMAGE ?= alpine:3.21
TMPDIR := ${SCRIPTDIR}/.tmp

DOCKER_CMD:=docker run
Expand All @@ -18,6 +18,9 @@ GOBUILDTAGSOPT=-tags "$(GOBUILDTAGS)"
ARANGODB ?= arangodb/arangodb:latest
STARTER ?= arangodb/arangodb-starter:latest

BASH_NOP = /bin/true
BUILD_GO_BINARY_DEPENDENCIES := $(BASH_NOP)

ifndef TESTOPTIONS
TESTOPTIONS :=
endif
Expand Down Expand Up @@ -149,13 +152,33 @@ else
endif

ifeq ("$(ADD_TIMESTAMP)", "true")
ADD_TIMESTAMP :=| go run ./test/timestamp_output/timestamp_output.go
ADD_TIMESTAMP_CMD :=| bash ./test/timestamp_output/timestamp_output_binary
BUILD_GO_BINARY_DEPENDENCIES := $(BUILD_GO_BINARY_DEPENDENCIES) && go build -o ./test/timestamp_output/timestamp_output_binary ./test/timestamp_output/timestamp_output.go
endif

ifdef $(DUMP_AGENCY_ON_FAILURE)
BUILD_GO_BINARY_DEPENDENCIES := $(BUILD_GO_BINARY_DEPENDENCIES) && go build -o ./test/json_agency_config_parse_leader_id/json_agency_config_parse_leader_id_binary ./test/json_agency_config_parse_leader_id/json_agency_config_parse_leader_id.go
endif

.PHONY: all build clean linter run-tests vulncheck

all: build

build_go_binary_dependencies:
if [ "$(BUILD_GO_BINARY_DEPENDENCIES)" != "$(BASH_NOP)" ]; then\
echo "Building Go Dependencies Binaries";\
echo "$(BUILD_GO_BINARY_DEPENDENCIES)";\
echo "$(ADD_TIMESTAMP_CMD)";\
$(DOCKER_CMD) --rm \
-v "${ROOTDIR}":/usr/code \
-e CGO_ENABLED=$(CGO_ENABLED) \
-w /usr/code/ \
$(GOIMAGE) \
$(BUILD_GO_BINARY_DEPENDENCIES) && ls -al ./test/timestamp_output; \
fi \



build: __dir_setup $(SOURCES)
go build -v $(REPOPATH) $(REPOPATH)/http $(REPOPATH)/vst $(REPOPATH)/agency $(REPOPATH)/jwt

Expand Down Expand Up @@ -438,8 +461,8 @@ DOCKER_V1_CMD_PARAMS=\
-v "${ROOTDIR}":/usr/code ${TEST_RESOURCES_VOLUME} \
-w /usr/code/

__test_go_test:
($(DOCKER_CMD) $(DOCKER_V1_CMD_PARAMS) $(DOCKER_RUN_CMD) $(ADD_TIMESTAMP)) && echo "success!" \
__test_go_test: build_go_binary_dependencies
($(DOCKER_CMD) $(DOCKER_V1_CMD_PARAMS) $(DOCKER_RUN_CMD) $(ADD_TIMESTAMP_CMD)) && echo "success!" \
|| ( $(ON_FAILURE_PARAMS) MAJOR_VERSION=1 . ./test/on_failure.sh)


Expand All @@ -451,8 +474,8 @@ DOCKER_CMD_V2_PARAMS=\
-v "${ROOTDIR}":/usr/code:ro ${TEST_RESOURCES_VOLUME} \
-w /usr/code/v2/

__test_v2_go_test:
($(DOCKER_CMD) $(DOCKER_CMD_V2_PARAMS) $(DOCKER_V2_RUN_CMD) $(ADD_TIMESTAMP)) && echo "success!" \
__test_v2_go_test: build_go_binary_dependencies
($(DOCKER_CMD) $(DOCKER_CMD_V2_PARAMS) $(DOCKER_V2_RUN_CMD) $(ADD_TIMESTAMP_CMD)) && echo "success!" \
|| ($(ON_FAILURE_PARAMS) MAJOR_VERSION=2 . ./test/on_failure.sh)

__test_debug__:
Expand Down