-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
{Earthfile, Jenkinsfile}: Earthly ci testing
Change-Id: Idc1292cddab20526afa2e3f783dd4b1f51891efd
- Loading branch information
1 parent
71471d6
commit daba52f
Showing
4 changed files
with
100 additions
and
73 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 |
---|---|---|
|
@@ -3,7 +3,6 @@ FROM golang:1.19 | |
WORKDIR /go/storj-up | ||
|
||
lint: | ||
WORKDIR /go/storj-up | ||
RUN go install github.com/storj/ci/...@5286f52 | ||
RUN go install honnef.co/go/tools/cmd/[email protected] | ||
RUN go install github.com/golangci/golangci-lint/cmd/[email protected] | ||
|
@@ -18,7 +17,19 @@ lint: | |
RUN check-monkit ./... | ||
RUN check-mod-tidy | ||
|
||
deps: | ||
# Download deps before copying code. | ||
COPY go.mod go.sum ./pkg/config/gen/go.mod ./pkg/config/gen/go.sum . | ||
RUN go mod download | ||
# Output these back in case go mod download changes them. | ||
SAVE ARTIFACT go.mod AS LOCAL go.mod | ||
SAVE ARTIFACT go.sum AS LOCAL go.sum | ||
SAVE ARTIFACT ./pkg/config/gen/go.mod AS LOCAL ./pkg/config/gen/go.mod | ||
SAVE ARTIFACT ./pkg/config/gen/go.sum AS LOCAL ./pkg/config/gen/go.sum | ||
|
||
build: | ||
FROM +deps | ||
# Copy and build code. | ||
COPY . . | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg/mod \ | ||
|
@@ -40,56 +51,58 @@ test: | |
./scripts/test.sh | ||
SAVE ARTIFACT build/tests.json AS LOCAL build/tests.json | ||
|
||
step1: | ||
LOCALLY | ||
RUN whoami | ||
RUN cat /proc/1/cgroup | head -n 1 | ||
|
||
step2: | ||
FROM alpine:latest | ||
RUN whoami | ||
RUN cat /proc/1/cgroup | head -n 1 | ||
integration-uplink: | ||
FROM earthly/dind:ubuntu | ||
WORKDIR /go/storj-up | ||
COPY +build/storj-up . | ||
RUN /go/storj-up/storj-up init minimal,db,uplink | ||
COPY ./test/uplink/basic_upload_download.sh basic_upload_download.sh | ||
WITH DOCKER --compose docker-compose.yaml | ||
RUN docker compose exec -T -u 0 uplink bash -c 'storj-up health --host cockroach -d 90' && \ | ||
docker compose exec -T -u 0 uplink bash -c 'storj-up credentials -s satellite-api:7777 -c satellite-api:10000 -e >> ~/.bashrc' && \ | ||
< basic_upload_download.sh docker compose exec -T -u 0 uplink bash -i | ||
END | ||
|
||
both: | ||
BUILD +step1 | ||
BUILD +step2 | ||
integration-edge: | ||
FROM earthly/dind:ubuntu | ||
WORKDIR /go/storj-up | ||
COPY +build/storj-up . | ||
RUN /go/storj-up/storj-up init minimal,edge,db,uplink && \ | ||
/go/storj-up/storj-up image uplink img.dev.storj.io/dlm/storj:1 && \ | ||
/go/storj-up/storj-up env set authservice STORJ_ENDPOINT=http://gateway-mt:9999 | ||
COPY ./test/edge/basic_rclone.sh basic_rclone.sh | ||
WITH DOCKER --compose docker-compose.yaml | ||
RUN docker compose exec -T -u 0 uplink bash -c 'storj-up health --host cockroach -d 90' && \ | ||
docker compose exec -T -u 0 uplink bash -c 'storj-up credentials -s satellite-api:7777 -c satellite-api:10000 -a http://authservice:8888 -e --s3 >> ~/.bashrc' && \ | ||
< basic_rclone.sh docker compose exec -T -u 0 uplink bash -i | ||
END | ||
|
||
ci-integration: | ||
FROM earthly/dind:ubuntu | ||
RUN apt-get update && apt-get install -y golang-go docker-compose-plugin gcc | ||
ENV PATH=$PATH:/root/go/bin | ||
COPY . . | ||
WORKDIR /test | ||
WITH DOCKER --pull img.dev.storj.io/storjup/storj:1.83.2 \ | ||
--pull img.dev.storj.io/dlm/storj:1 \ | ||
--pull img.dev.storj.io/storjup/edge:1.58.1 \ | ||
--pull cockroachdb/cockroach \ | ||
--pull redis:6.0.9 \ | ||
--pull img.dev.storj.io/storjup/storjscan:1.0.3 \ | ||
--pull img.dev.storj.io/dlm/storjscan:1 \ | ||
--pull ethereum/client-go | ||
RUN /test/uplink/storj-up.sh && \ | ||
/test/edge/storj-up.sh && \ | ||
/test/storjscan/storj-up.sh | ||
END | ||
integration-storjscan: | ||
FROM earthly/dind:ubuntu | ||
WORKDIR /go/storj-up | ||
COPY +build/storj-up . | ||
RUN /go/storj-up/storj-up init && \ | ||
/go/storj-up/storj-up init minimal,satellite-core,edge,db,billing && \ | ||
/go/storj-up/storj-up env setenv satellite-core STORJ_PAYMENTS_BILLING_CONFIG_INTERVAL=5s && \ | ||
/go/storj-up/storj-up env setenv satellite-core STORJ_PAYMENTS_STORJSCAN_INTERVAL=5s && \ | ||
/go/storj-up/storj-up env setenv satellite-core STORJ_PAYMENTS_STORJSCAN_CONFIRMATIONS=12 && \ | ||
/go/storj-up/storj-up env setenv storjscan STORJ_TOKEN_PRICE_USE_TEST_PRICES=true && \ | ||
/go/storj-up/storj-up image storjscan img.dev.storj.io/dlm/storjscan:1 | ||
COPY ./test/storjscan/basic_storjscan.sh basic_storjscan.sh | ||
WITH DOCKER --compose docker-compose.yaml | ||
RUN docker compose exec -T -u 0 storjscan bash -c 'storj-up health --host cockroach -d 90' && \ | ||
docker compose exec -T -u 0 storjscan bash -c 'storj-up credentials -s satellite-api:7777 -c satellite-api:10000 -a http://authservice:8888 -e >> ~/.bashrc' && \ | ||
docker compose cp pk.json storjscan:/var/lib/storj/pk.json && \ | ||
docker compose cp pass storjscan:/var/lib/storj/pass && \ | ||
docker compose cp TestToken.abi storjscan:/var/lib/storj/TestToken.abi && \ | ||
docker compose cp TestToken.bin storjscan:/var/lib/storj/TestToken.bin && \ | ||
< basic_storjscan.sh docker compose exec -T -u 0 storjscan bash -i | ||
END | ||
|
||
local-integration: | ||
# FROM earthly/dind:ubuntu | ||
# RUN apt-get update && apt-get install -y golang-go docker-compose-plugin gcc | ||
# ENV PATH=$PATH:/root/go/bin | ||
# COPY . . | ||
# WORKDIR /test | ||
LOCALLY | ||
WITH DOCKER --pull img.dev.storj.io/storjup/storj:1.83.2 \ | ||
--pull img.dev.storj.io/storjup/edge:1.58.1 \ | ||
--pull cockroachdb/cockroach \ | ||
--pull redis:6.0.9 \ | ||
--pull img.dev.storj.io/storjup/storjscan:1.0.3 \ | ||
--pull ethereum/client-go | ||
RUN /test/uplink/storj-up.sh && \ | ||
/test/edge/storj-up.sh && \ | ||
/test/storjscan/storj-up.sh | ||
END | ||
integration-all: | ||
BUILD +integration-uplink | ||
BUILD +integration-edge | ||
BUILD +integration-storjscan | ||
|
||
check-format: | ||
COPY . . | ||
|
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
Oops, something went wrong.