Skip to content

Commit 184e939

Browse files
committed
fallback to go proxy for go mod download issues
1 parent 2e422d0 commit 184e939

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ docker-push:
4141
docker push ${IMG_W_TAG}
4242

4343
build-docker-images:
44-
${MAKEFILE_PATH}/scripts/build-docker-images -d -p ${SUPPORTED_PLATFORMS} -r ${IMG} -v ${VERSION}
44+
${MAKEFILE_PATH}/scripts/build-docker-images -p ${SUPPORTED_PLATFORMS} -r ${IMG} -v ${VERSION}
4545

4646
push-docker-images:
4747
@docker login -u ${DOCKERHUB_USERNAME} -p="${DOCKERHUB_TOKEN}"
@@ -74,7 +74,7 @@ readme-codeblock-test:
7474

7575

7676
build-binaries:
77-
${MAKEFILE_PATH}/scripts/build-binaries -d -p ${SUPPORTED_PLATFORMS} -v ${VERSION}
77+
${MAKEFILE_PATH}/scripts/build-binaries -p ${SUPPORTED_PLATFORMS} -v ${VERSION}
7878

7979
## requires a github token
8080
upload-resources-to-github:

scripts/build-binaries

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ mkdir -p "${BIN_DIR}"
1010

1111
VERSION=$(make -s -f ${MAKE_FILE_PATH} version)
1212
PLATFORMS=("linux/amd64")
13-
PASS_THRU_ARGS=""
1413

1514
USAGE=$(cat << 'EOM'
1615
Usage: build-binaries [-p <platform pairs>]
@@ -19,7 +18,6 @@ USAGE=$(cat << 'EOM'
1918
Example: build-binaries -p "linux/amd64,linux/arm"
2019
Optional:
2120
-p Platform pair list (os/architecture) [DEFAULT: linux/amd64]
22-
-d DIRECT: Set GOPROXY=direct to bypass go proxies
2321
-v VERSION: The application version of the docker image [DEFAULT: output of `make version`]
2422
EOM
2523
)
@@ -30,9 +28,6 @@ while getopts "dp:v:" opt; do
3028
p ) # Platform Pairs
3129
IFS=',' read -ra PLATFORMS <<< "$OPTARG"
3230
;;
33-
d ) # sets GOPROXY=direct
34-
PASS_THRU_ARGS="$PASS_THRU_ARGS -d"
35-
;;
3631
v ) # Image Version
3732
VERSION="$OPTARG"
3833
;;
@@ -52,7 +47,7 @@ for os_arch in "${PLATFORMS[@]}"; do
5247
bin_name="${base_bin_name}-${os}-${arch}"
5348

5449
docker container rm $container_name || :
55-
$SCRIPTPATH/build-docker-images -p $os_arch -v $VERSION -r $repo_name $PASS_THRU_ARGS
50+
$SCRIPTPATH/build-docker-images -p $os_arch -v $VERSION -r $repo_name
5651
docker container create --rm --name $container_name "$repo_name:$VERSION-$os-$arch"
5752
docker container cp $container_name:/ec2-instance-selector $BIN_DIR/$bin_name
5853

scripts/build-docker-images

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ MAKE_FILE_PATH=$REPO_ROOT_PATH/Makefile
88

99
VERSION=$(make -s -f $MAKE_FILE_PATH version)
1010
PLATFORMS=("linux/amd64")
11-
GOPROXY="https://proxy.golang.org,direct"
11+
GOPROXY="direct|https://proxy.golang.org"
1212

1313

1414
USAGE=$(cat << 'EOM'
@@ -18,7 +18,6 @@ USAGE=$(cat << 'EOM'
1818
Example: build-docker-images -p "linux/amd64,linux/arm"
1919
Optional:
2020
-p Platform pair list (os/architecture) [DEFAULT: linux/amd64]
21-
-d DIRECT: Set GOPROXY=direct to bypass go proxies
2221
-r IMAGE REPO: set the docker image repo
2322
-v VERSION: The application version of the docker image [DEFAULT: output of `make version`]
2423
EOM
@@ -30,9 +29,6 @@ while getopts "dp:r:v:" opt; do
3029
p ) # Platform Pairs
3130
IFS=',' read -ra PLATFORMS <<< "$OPTARG"
3231
;;
33-
d ) # GOPROXY=direct
34-
GOPROXY="direct"
35-
;;
3632
r ) # Image Repo
3733
IMAGE_REPO="$OPTARG"
3834
;;
@@ -55,6 +51,7 @@ for os_arch in "${PLATFORMS[@]}"; do
5551
docker build \
5652
--build-arg GOOS=${os} \
5753
--build-arg GOARCH=${arch} \
54+
--build-arg GOPROXY=${GOPROXY} \
5855
-t ${img_tag} \
5956
${REPO_ROOT_PATH}
6057
done

test/license-test/run-license-test.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ BUILD_BIN="$BUILD_PATH/bin"
88
BINARY_NAME="ec2-instance-selector-linux-amd64"
99
LICENSE_TEST_TAG="aeis-license-test"
1010
LICENSE_REPORT_FILE="$BUILD_PATH/license-report"
11+
GOPROXY="direct|https://proxy.golang.org"
1112

1213
SUPPORTED_PLATFORMS_LINUX="linux/amd64" make -s -f $SCRIPTPATH/../../Makefile build-binaries
13-
docker buildx build --load -t $LICENSE_TEST_TAG $SCRIPTPATH/
14+
docker buildx build --load --build-arg=GOPROXY=${GOPROXY} -t $LICENSE_TEST_TAG $SCRIPTPATH/
1415
docker run -i -e GITHUB_TOKEN --rm -v $SCRIPTPATH/:/test -v $BUILD_BIN/:/aeis-bin $LICENSE_TEST_TAG golicense /test/license-config.hcl /aeis-bin/$BINARY_NAME | tee $LICENSE_REPORT_FILE
1516
$SCRIPTPATH/check-licenses.sh $LICENSE_REPORT_FILE

0 commit comments

Comments
 (0)