Added the files for this package.
This commit is contained in:
parent
4424b06532
commit
d56374a8f7
32 changed files with 2179 additions and 0 deletions
test/infras
34
test/infras/Dockerfile
Normal file
34
test/infras/Dockerfile
Normal file
|
@ -0,0 +1,34 @@
|
|||
FROM debian:10.13
|
||||
|
||||
RUN apt-get update && apt-get install -y \
|
||||
gcc \
|
||||
curl \
|
||||
git \
|
||||
unzip \
|
||||
wget \
|
||||
make \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Gobrew
|
||||
ENV PATH="/root/.gobrew/current/bin:/root/.gobrew/bin:$PATH"
|
||||
RUN curl -sL https://raw.githubusercontent.com/kevincobain2000/gobrew/v1.10.11/git.io.sh | bash
|
||||
|
||||
# Set Working Directory
|
||||
WORKDIR /go/src/toastielab.dev/toastie-stuff/otelchi
|
||||
|
||||
# Install Multiple Go Versions
|
||||
ARG GO_VERSIONS
|
||||
COPY ./test/infras/install_go.sh ./test/infras/
|
||||
RUN chmod +x ./test/infras/install_go.sh && sh ./test/infras/install_go.sh
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download -x
|
||||
|
||||
COPY ./test/infras/entrypoint.sh ./test/infras/
|
||||
RUN chmod +x ./test/infras/entrypoint.sh
|
||||
|
||||
ENV GO_VERSIONS=$GO_VERSIONS
|
||||
|
||||
COPY . .
|
||||
|
||||
ENTRYPOINT [ "./test/infras/entrypoint.sh" ]
|
18
test/infras/entrypoint.sh
Normal file
18
test/infras/entrypoint.sh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Terminate script immediately on any errors
|
||||
set -e
|
||||
|
||||
# Define Go versions
|
||||
go_versions=${GO_VERSIONS}
|
||||
|
||||
echo ${GO_VERSIONS}
|
||||
|
||||
# Iterate over each version
|
||||
for version in $go_versions; do
|
||||
# Set Go version using gobrew
|
||||
gobrew use "$version"
|
||||
|
||||
# Execute Test as defined in the Makefile
|
||||
make go-test
|
||||
done
|
9
test/infras/install_go.sh
Normal file
9
test/infras/install_go.sh
Normal file
|
@ -0,0 +1,9 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Define Go versions
|
||||
go_versions=${GO_VERSIONS}
|
||||
|
||||
# Install each Go version using gobrew
|
||||
for version in $go_versions; do
|
||||
gobrew install "$version"
|
||||
done
|
Loading…
Add table
Add a link
Reference in a new issue