Skip to content

Commit

Permalink
Merge branch 'GoogleCloudPlatform:main' into gl7
Browse files Browse the repository at this point in the history
  • Loading branch information
hkundag authored Aug 8, 2023
2 parents 9efc11a + 1a357ac commit 1e37484
Show file tree
Hide file tree
Showing 608 changed files with 7,250 additions and 1,280 deletions.
5 changes: 5 additions & 0 deletions .ci/containers/bash-plus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine/git

RUN apk update && apk upgrade && \
apk add --no-cache bash jq curl && \
rm -rf /var/cache/apk/*
53 changes: 53 additions & 0 deletions .ci/containers/build-environment/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Stage 1: Building Go dependencies
FROM golang:1.19-bullseye AS builder

# Set working directory
WORKDIR /app

# Download go.mod and go.sum from your repository
ADD "https://raw.githubusercontent.com/GoogleCloudPlatform/magic-modules/main/tpgtools/go.mod" go.mod
ADD "https://raw.githubusercontent.com/GoogleCloudPlatform/magic-modules/main/tpgtools/go.sum" go.sum

# Install the go dependencies
RUN go mod download

# Stage 2: Creating the final imag
FROM ruby:3.1-bullseye

# golang
COPY --from=golang:1.19-bullseye /usr/local/go /usr/local/go
ENV GOPATH /go
ENV PATH /usr/local/go/bin:$PATH
ENV PATH $GOPATH/bin:$PATH
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 1777 "$GOPATH"
WORKDIR $GOPATH

# terraform binary used by tfv/tgc
COPY --from=hashicorp/terraform:1.4.2 /bin/terraform /bin/terraform

SHELL ["/bin/bash", "-c"]

ENV GO111MODULE "on"
ENV LC_ALL=C.UTF-8
ENV LANG=C.UTF-8

RUN apt-get update && apt-get install -y --no-install-recommends git openssh-client apt-transport-https ca-certificates curl netbase wget gcc make jq libjq1

RUN git config --global user.name "Modular Magician"
RUN git config --global user.email "[email protected]"

# Set up Github SSH cloning.
RUN ssh-keyscan github.com >> /known_hosts
RUN echo "UserKnownHostsFile /known_hosts" >> /etc/ssh/ssh_config

RUN go install golang.org/x/tools/cmd/goimports@d088b475e3360caabc032aaee1dc66351d4e729a
RUN go install github.com/github/[email protected]+incompatible

ADD "https://raw.githubusercontent.com/GoogleCloudPlatform/magic-modules/main/mmv1/Gemfile" Gemfile
ADD "https://raw.githubusercontent.com/GoogleCloudPlatform/magic-modules/main/mmv1/Gemfile.lock" Gemfile.lock
RUN bundle install
RUN rm Gemfile Gemfile.lock

# Copy Go dependencies from builder stage
COPY --from=builder /go/pkg /go/pkg

22 changes: 15 additions & 7 deletions .ci/containers/downstream-waiter/wait_for_commit.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ if git merge-base --is-ancestor $SHA origin/$SYNC_BRANCH; then
fi

while true; do
commits="$(git log --pretty=%H origin/$SYNC_BRANCH..origin/$BASE_BRANCH | tail -n 1)"
if [ "$commits" == "$SHA" ]; then
break
else
echo "git log says waiting on: $commits"
echo "command says waiting on $SHA"
git fetch origin $SYNC_BRANCH
if [ "$BASE_BRANCH" != "main" ]; then
SYNC_HEAD="$(git rev-parse --short origin/$SYNC_BRANCH)"
BASE_PARENT="$(git rev-parse --short origin/$BASE_BRANCH~)"
if [ "$SYNC_HEAD" == "$BASE_PARENT" ]; then
break;
fi
else
commits="$(git log --pretty=%H origin/$SYNC_BRANCH..origin/$BASE_BRANCH | tail -n 1)"
if [ "$commits" == "$SHA" ]; then
break
else
echo "git log says waiting on: $commits"
echo "command says waiting on $SHA"
git fetch origin $SYNC_BRANCH
fi
fi
sleep 5
done
10 changes: 0 additions & 10 deletions .ci/containers/github-differ/Dockerfile

This file was deleted.

32 changes: 32 additions & 0 deletions .ci/containers/go-plus/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
from golang:1.19-bullseye as resource
SHELL ["/bin/bash", "-c"]
# Set up Github SSH cloning.
RUN ssh-keyscan github.com >> /known_hosts
RUN echo "UserKnownHostsFile /known_hosts" >> /etc/ssh/ssh_config

RUN apt-get update && \
apt-get install -y git jq unzip parallel curl && \
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update -y && \
apt-get install google-cloud-sdk -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN wget https://releases.hashicorp.com/terraform/1.2.5/terraform_1.2.5_linux_amd64.zip \
&& unzip terraform_1.2.5_linux_amd64.zip \
&& rm terraform_1.2.5_linux_amd64.zip \
&& mv ./terraform /bin/terraform

### the following version of terraform are required for
### terraform-validator-tester-integration
RUN wget https://releases.hashicorp.com/terraform/0.13.7/terraform_0.13.7_linux_amd64.zip \
&& unzip terraform_0.13.7_linux_amd64.zip \
&& rm terraform_0.13.7_linux_amd64.zip \
&& mkdir /terraform \
&& mv terraform /terraform/0.13.7

RUN wget https://releases.hashicorp.com/terraform/0.12.31/terraform_0.12.31_linux_amd64.zip \
&& unzip terraform_0.12.31_linux_amd64.zip \
&& rm terraform_0.12.31_linux_amd64.zip \
&& mv terraform /terraform/0.12.31
2 changes: 1 addition & 1 deletion .ci/containers/membership-checker/membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var (
trustedContributors = []string{}

// This is for reviewers who are "on vacation": will not receive new review assignments but will still receive re-requests for assigned PRs.
onVacationReviewers = []string{"SarahFrench"}
onVacationReviewers = []string{"SarahFrench", "roaks3", "rileykarson"}
)

// Check if a user is team member to not request a random reviewer
Expand Down
8 changes: 0 additions & 8 deletions .ci/containers/pre-build-validator/Dockerfile

This file was deleted.

8 changes: 0 additions & 8 deletions .ci/containers/terraform-tester/Dockerfile

This file was deleted.

150 changes: 0 additions & 150 deletions .ci/containers/terraform-triage-party/config.yaml

This file was deleted.

49 changes: 0 additions & 49 deletions .ci/containers/terraform-triage-party/deploy.sh

This file was deleted.

20 changes: 0 additions & 20 deletions .ci/containers/terraform-validator-tester-integration/Dockerfile

This file was deleted.

11 changes: 0 additions & 11 deletions .ci/containers/terraform-validator-tester/Dockerfile

This file was deleted.

Loading

0 comments on commit 1e37484

Please sign in to comment.