-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP: Automatic docker builds for cluster mode and basic tests layout,…
… local/remote configuration (#60) * bump go to 1.21.3, update flake.lock * remove vendor, update CI * temp disable bench, move lint/test/e2e to nix * automate docker build, wip * wrap all in one go test * update README.md for tests layout
- Loading branch information
Showing
25 changed files
with
415 additions
and
474 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
.git/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
# Example Dockerfile for k8s run | ||
FROM golang:1.20 as build | ||
ARG BUILD_ROOT | ||
# Builds all the tests in some directory that must have go.mod | ||
# All tests are built as separate binaries with name "module.test" | ||
FROM golang:1.21 as build | ||
ARG TESTS_ROOT | ||
|
||
WORKDIR /go/src | ||
COPY . . | ||
COPY . /tests | ||
|
||
RUN CGO_ENABLED=0 cd ${BUILD_ROOT} && go test -c -o wasp_test | ||
RUN CGO_ENABLED=0 cd /tests && go test -c ./... | ||
|
||
FROM debian | ||
ARG BUILD_ROOT | ||
ARG TESTS_ROOT | ||
|
||
COPY --from=build ${BUILD_ROOT} / | ||
COPY --from=build /tests . | ||
RUN apt-get update && apt-get install -y ca-certificates | ||
ENTRYPOINT /bin/bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#!/bin/bash | ||
|
||
set -o pipefail | ||
set +e | ||
|
||
# Check if required parameters are provided | ||
if [ "$#" -ne 5 ]; then | ||
echo "Usage: $0 DOCKERFILE_PATH TESTS_ROOT_PATH IMAGE_TAG ECR_REGISTRY_NAME ECR_REGISTRY_REPO_NAME" | ||
exit 1 | ||
fi | ||
|
||
DOCKERFILE_PATH="$1" | ||
TESTS_ROOT_PATH="$2" | ||
IMAGE_TAG="$3" | ||
ECR_REGISTRY_NAME="$4" | ||
ECR_REGISTRY_REPO_NAME="$5" | ||
|
||
# Build Docker image | ||
docker build --platform linux/amd64 -t "$IMAGE_TAG" -f "$DOCKERFILE_PATH" --build-arg TESTS_ROOT="$TESTS_ROOT_PATH" "$TESTS_ROOT_PATH" | ||
|
||
# Authenticate Docker with ECR | ||
aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin "$ECR_REGISTRY_NAME" | ||
|
||
# Tag the Docker image with ECR registry name | ||
docker tag "$IMAGE_TAG" "$ECR_REGISTRY_NAME/$ECR_REGISTRY_REPO_NAME:$IMAGE_TAG" | ||
|
||
# Push Docker image to ECR | ||
docker push "$ECR_REGISTRY_NAME/$ECR_REGISTRY_REPO_NAME:$IMAGE_TAG" | ||
|
||
# Verify push success | ||
if [ $? -eq 0 ]; then | ||
echo "Image successfully pushed to ECR." | ||
else | ||
echo "Failed to push image to ECR." | ||
exit 1 | ||
fi |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Oops, something went wrong.