2023-04-18 12:25:55 +08:00
|
|
|
FROM golang:1.18 AS builder
|
2022-06-08 17:32:17 +08:00
|
|
|
|
2023-07-21 18:47:11 +08:00
|
|
|
ARG VERSION
|
2023-07-10 17:03:55 +08:00
|
|
|
ARG GOPROXY
|
2022-06-08 17:32:17 +08:00
|
|
|
WORKDIR /workspace
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY cmd/ cmd/
|
|
|
|
COPY pkg/ pkg/
|
2023-06-08 17:27:40 +08:00
|
|
|
COPY extensions/ extensions/
|
2023-08-10 08:15:53 +08:00
|
|
|
COPY operator/ operator/
|
2023-06-26 08:47:24 +08:00
|
|
|
COPY console/atest-ui atest-ui/
|
2023-07-26 15:17:02 +08:00
|
|
|
COPY .github/testing/*.yaml sample/
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY sample/ sample/
|
2023-07-16 21:10:03 +08:00
|
|
|
COPY docs/ docs/
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY go.mod go.mod
|
|
|
|
COPY go.sum go.sum
|
2023-06-08 17:27:40 +08:00
|
|
|
COPY go.work go.work
|
|
|
|
COPY go.work.sum go.work.sum
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY main.go main.go
|
|
|
|
COPY README.md README.md
|
|
|
|
COPY LICENSE LICENSE
|
|
|
|
|
2023-07-10 17:03:55 +08:00
|
|
|
RUN GOPROXY=${GOPROXY} go mod download
|
2023-07-21 18:47:11 +08:00
|
|
|
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s -X github.com/linuxsuren/api-testing/pkg/version.version=${VERSION}" -o atest .
|
2023-07-10 17:03:55 +08:00
|
|
|
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-collector extensions/collector/main.go
|
|
|
|
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-orm extensions/store-orm/main.go
|
2023-08-01 07:28:53 +08:00
|
|
|
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-s3 extensions/store-s3/main.go
|
2023-08-15 10:18:08 +08:00
|
|
|
RUN GOPROXY=${GOPROXY} CGO_ENABLED=0 go build -ldflags "-w -s" -o atest-store-git extensions/store-git/main.go
|
2022-06-08 17:32:17 +08:00
|
|
|
|
2023-06-26 08:47:24 +08:00
|
|
|
FROM node:20-alpine3.17 AS ui
|
|
|
|
|
|
|
|
WORKDIR /workspace
|
|
|
|
COPY --from=builder /workspace/atest-ui .
|
2023-07-21 18:47:11 +08:00
|
|
|
RUN npm install --ignore-scripts --registry=https://registry.npmmirror.com
|
2023-06-26 08:47:24 +08:00
|
|
|
RUN npm run build-only
|
|
|
|
|
2023-04-04 14:13:16 +08:00
|
|
|
FROM ubuntu:23.04
|
2022-06-08 17:32:17 +08:00
|
|
|
|
|
|
|
LABEL "com.github.actions.name"="API testing"
|
|
|
|
LABEL "com.github.actions.description"="API testing"
|
|
|
|
LABEL "com.github.actions.icon"="home"
|
|
|
|
LABEL "com.github.actions.color"="red"
|
|
|
|
|
|
|
|
LABEL "repository"="https://github.com/linuxsuren/api-testing"
|
|
|
|
LABEL "homepage"="https://github.com/linuxsuren/api-testing"
|
|
|
|
LABEL "maintainer"="Rick <linuxsuren@gmail.com>"
|
|
|
|
|
|
|
|
LABEL "Name"="API testing"
|
|
|
|
|
2023-04-04 14:13:16 +08:00
|
|
|
COPY --from=builder /workspace/atest /usr/local/bin/atest
|
2023-06-08 17:27:40 +08:00
|
|
|
COPY --from=builder /workspace/atest-collector /usr/local/bin/atest-collector
|
2023-07-10 17:03:55 +08:00
|
|
|
COPY --from=builder /workspace/atest-store-orm /usr/local/bin/atest-store-orm
|
2023-08-01 11:02:40 +08:00
|
|
|
COPY --from=builder /workspace/atest-store-s3 /usr/local/bin/atest-store-s3
|
2023-08-15 10:18:08 +08:00
|
|
|
COPY --from=builder /workspace/atest-store-git /usr/local/bin/atest-store-git
|
2023-04-18 12:25:55 +08:00
|
|
|
COPY --from=builder /workspace/LICENSE /LICENSE
|
|
|
|
COPY --from=builder /workspace/README.md /README.md
|
2022-06-08 17:32:17 +08:00
|
|
|
|
2023-07-26 15:17:02 +08:00
|
|
|
RUN mkdir -p /var/www/data
|
2023-06-26 08:47:24 +08:00
|
|
|
COPY --from=builder /workspace/sample /var/www/sample
|
|
|
|
COPY --from=ui /workspace/dist /var/www/html
|
|
|
|
|
2023-08-15 17:00:31 +08:00
|
|
|
RUN apt update -y && \
|
|
|
|
# required for atest-store-git
|
|
|
|
apt install -y --no-install-recommends ssh-client ca-certificates
|
|
|
|
|
2023-07-26 15:17:02 +08:00
|
|
|
CMD ["atest", "server", "--console-path=/var/www/html", "--local-storage=/var/www/sample/*.yaml", "--local-storage=/var/www/data/*.yaml"]
|