forked from spacemeshos/go-spacemesh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerFileTests
45 lines (33 loc) · 1.19 KB
/
DockerFileTests
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
FROM python:3.8 AS tests_base
WORKDIR /go-spacemesh/tests
RUN pip install pytest
RUN curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
RUN chmod +x ./kubectl
RUN mv ./kubectl /usr/local/bin
# Downloading gcloud package
RUN curl https://dl.google.com/dl/cloudsdk/release/google-cloud-sdk.tar.gz > /tmp/google-cloud-sdk.tar.gz
# Installing the package
RUN mkdir -p /usr/local/gcloud \
&& tar -C /usr/local/gcloud -xf /tmp/google-cloud-sdk.tar.gz \
&& /usr/local/gcloud/google-cloud-sdk/install.sh -q
FROM tests_base AS with_requirements
RUN pip install pipenv
COPY tests/Pipfile .
COPY tests/Pipfile.lock .
RUN pipenv install --system
RUN pip install google-cloud-tasks
FROM with_requirements AS tests_runner
ARG GCLOUD_KEY
ARG PROJECT_NAME
ARG CLUSTER_NAME
ARG CLUSTER_ZONE
COPY tests .
COPY config.toml ../
# Adding the package path to local
ENV PATH $PATH:/usr/local/gcloud/google-cloud-sdk/bin
ENV GCLOUD_KEY ${GCLOUD_KEY}
ENV PROJECT_NAME ${PROJECT_NAME}
ENV CLUSTER_NAME ${CLUSTER_NAME}
ENV CLUSTER_ZONE ${CLUSTER_ZONE}
RUN chmod +x ./k8s/gcp_connect.sh
RUN sh ./k8s/gcp_connect.sh