11SHELL := /bin/bash # Default 'sh' doesn't support 'source'
22BUILD_BRANCH=main
33CONTAINER_NAME =jdbc
4+ PROXY_CONTAINER_NAME =$(CONTAINER_NAME ) -proxy
45PACKAGE_DESTINATION =$(PWD ) /drivers
56SRC ="$(PWD ) "
67skipSurefire ?= true
8+ skipShade ?= true
79JDBC_DRIVER_VERSION = $(shell mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
810JDBC_JAR = $(PACKAGE_DESTINATION ) /google-cloud-bigquery-jdbc-$(JDBC_DRIVER_VERSION ) -all.jar
911
@@ -33,13 +35,14 @@ unittest: |
3335 -Dtest=$(test ) \
3436 test
3537
36- # Important: By default, this command will skip unittests.
38+ # Important: By default, this command will skip unittests & uberjar build .
3739# To include unit tests, run: make integration-test skipSurefire=false
3840integration-test :
3941 mvn -B -ntp \
4042 -Penable-integration-tests \
4143 -DtrimStackTrace=false \
4244 -DskipSurefire=$(skipSurefire ) \
45+ -DskipShade=$(skipShade ) \
4346 -Dclirr.skip=true \
4447 -Denforcer.skip=true \
4548 -Dit.failIfNoSpecifiedTests=true \
@@ -76,21 +79,30 @@ run-it-standalone:
7679# Commands for dockerized environments
7780.docker-run : |
7881 docker run -it \
82+ --cap-add=NET_ADMIN \
7983 -v $(GOOGLE_APPLICATION_CREDENTIALS ) :/auth/application_creds.json \
8084 -v " $( GOOGLE_APPLICATION_CREDENTIALS) .p12" :/auth/application_creds.p12 \
8185 -e " GOOGLE_APPLICATION_CREDENTIALS=/auth/application_creds.json" \
8286 -v $(SRC ) :/src \
8387 -e " SA_EMAIL=test_email" \
8488 -e " SA_SECRET=/auth/application_creds.json" \
8589 -e " SA_SECRET_P12=/auth/application_creds.p12" \
90+ -e " BIGQUERY_BASE_URL=$( BIGQUERY_BASE_URL) " \
91+ -e " BIGQUERY_URL_FLAGS=$( BIGQUERY_URL_FLAGS) " \
8692 $(CONTAINER_NAME ) $(args )
8793
8894docker-build :
89- docker build -t $(CONTAINER_NAME ) -f Dockerfile --build-arg BRANCH=${BUILD_BRANCH} $(SRC )
95+ docker build --target regular -t $(CONTAINER_NAME ) -f Dockerfile --build-arg BRANCH=${BUILD_BRANCH} $(SRC )
96+
97+ docker-proxy-build :
98+ docker build --target proxy -t $(PROXY_CONTAINER_NAME ) -f Dockerfile --build-arg BRANCH=${BUILD_BRANCH} $(SRC )
9099
91100docker-session :
92101 $(MAKE ) .docker-run args=" bash"
93102
103+ docker-proxy-session :
104+ $(MAKE ) .docker-run-proxy args=" bash"
105+
94106docker-package-all-dependencies : docker-build
95107 mkdir -p $(PACKAGE_DESTINATION )
96108 docker run \
@@ -134,6 +146,9 @@ docker-unittest: |
134146docker-integration-test : .check-env
135147 $(MAKE ) .docker-run args=" make integration-test test=$( test) skipSurefire=$( skipSurefire) "
136148
149+ docker-proxy-integration-test : .check-env docker-proxy-build
150+ $(MAKE ) docker-integration-test CONTAINER_NAME=$(PROXY_CONTAINER_NAME ) BIGQUERY_URL_FLAGS=" ProxyHost=127.0.0.1;ProxyPort=3128;"
151+
137152docker-coverage :
138153 $(MAKE ) .docker-run args=" make unit-test-coverage"
139154 $(MAKE ) .docker-run args=" make full-coverage"
0 commit comments