forked from goharbor/harbor-helm
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathContainerfile
More file actions
64 lines (53 loc) · 2.11 KB
/
Copy pathContainerfile
File metadata and controls
64 lines (53 loc) · 2.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# renovate: datasource=docker depName=golang
ARG GOLANG_VERSION=1.26.1-bookworm
FROM hub-mirrors.alauda.cn/library/golang:${GOLANG_VERSION} AS builder
WORKDIR /tools
RUN mkdir -p /tools/bin
ARG YQ_VERSION=4.25.2
ARG KUBECTL_VERSION=1.28.2
ARG HELM_VERSION=3.12.3
RUN set -eux; \
if [ "$(arch)" = "arm64" ] || [ "$(arch)" = "aarch64" ]; then \
export ARCH="arm64"; \
export ARCH_ALIAS="arm64"; \
else \
export ARCH="amd64"; \
export ARCH_ALIAS="x86_64"; \
fi; \
mkdir -p tmp; \
curl --retry 6 -sfL https://github.com/mikefarah/yq/releases/download/v${YQ_VERSION}/yq_linux_${ARCH} -o ./bin/yq && \
curl --retry 6 -sfL https://dl.k8s.io/release/v${KUBECTL_VERSION}/bin/linux/${ARCH}/kubectl -o ./bin/kubectl && \
curl --retry 6 -sfL https://get.helm.sh/helm-v${HELM_VERSION}-linux-${ARCH}.tar.gz | tar xzf - -C tmp 2>&1 && mv tmp/linux-${ARCH}/helm ./bin && \
chmod +x ./bin/* && \
rm -rf tmp && \
./bin/yq --version && \
./bin/kubectl version --client && \
./bin/helm version
COPY testing /app
# 安装 playwright
ENV GOPROXY='https://build-nexus.alauda.cn/repository/golang/,direct'
RUN PWGO_VER=$(grep -oE "playwright-go v\S+" /app/go.mod | sed 's/playwright-go //g') \
&& go install github.com/mxschmitt/playwright-go/cmd/playwright@${PWGO_VER}
RUN set -eux; \
cd /app && \
CGO_ENABLED=0 go test -c -o /tools/bin/harbor.test ./
FROM build-harbor.alauda.cn/ops/ubuntu:24.04
RUN mkdir -p /tools/bin
COPY --from=builder /tools/bin /tools/bin
COPY --from=builder /go/bin/playwright /tools/bin/playwright
# install playwright dependencies
RUN apt-get update && apt-get install -y podman ca-certificates tzdata bash locales make git\
&& /tools/bin/playwright install chromium --with-deps \
&& rm -rf /var/lib/apt/lists/* \
&& locale-gen en_US.UTF-8 \
&& locale-gen zh_CN.UTF-8 \
&& update-locale
COPY . /app
WORKDIR /app/testing
ENV PATH=/tools/bin:$PATH
ENV CI=true
ENV LANG=zh_CN.UTF-8
ENV LC_ALL=zh_CN.UTF-8
ENV TEST_COMMAND="harbor.test"
ENTRYPOINT ["harbor.test"]
CMD ["--godog.concurrency=2", "--godog.format=allure", "--godog.tags=@smoke && ~@e2e"]