diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..6f9a125 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,21 @@ +name: pull request snapshot build +on: + pull_request: + branches: + - master + +jobs: + build: + name: Build Docker Image + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - name: Build Snapshot & Publish to Registry + uses: jen20/action-docker-build@v1 + with: + repository: docker.pkg.github.com/pulumi/pulumi-build-container/pulumi-build-container + buildkit: true + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + tag-snapshot: true + registry: https://docker.pkg.github.com diff --git a/Dockerfile b/Dockerfile index bc21f72..66242eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,25 +12,25 @@ RUN --mount=target=/build-scripts,type=bind,source=scripts \ # Install Go compiler and linter RUN --mount=target=/build-scripts,type=bind,source=scripts \ - GOLANG_VERSION=1.14 \ - GOLANG_SHA256=08df79b46b0adf498ea9f320a0f23d6ec59e9003660b4c9c1ce8e5e2c6f823ca \ - GOLANGCI_LINT_VERSION=1.18.0 \ + GOLANG_VERSION=1.13.10 \ + GOLANG_SHA256=8a4cbc9f2b95d114c38f6cbe94a45372d48c604b707db2057c787398dfbf8e7f \ + GOLANGCI_LINT_VERSION=1.23.8 \ /build-scripts/install-go.sh # Install Node.js and Yarn RUN --mount=target=/build-scripts,type=bind,source=scripts \ --mount=target=/var/lib/apt/lists,type=cache \ --mount=target=/var/cache/apt,type=cache \ - NODE_VERSION=10.x \ + NODE_VERSION=12.x \ NODE_DISTRO=bionic \ - YARN_VERSION=1.21.1 \ + YARN_VERSION=1.22.4 \ /build-scripts/install-node.sh # Install Python and accoutrements RUN --mount=target=/build-scripts,type=bind,source=scripts \ --mount=target=/var/lib/apt/lists,type=cache \ --mount=target=/var/cache/apt,type=cache \ - PYTHON_VERSION=3.7 \ + PYTHON_VERSION=3.8 \ PIPENV_VERSION=2018.11.26 \ AWSCLI_VERSION=1.17.9 \ WHEEL_VERSION=0.34.2 \ @@ -57,8 +57,8 @@ RUN --mount=target=/build-scripts,type=bind,source=scripts \ # Install Pulumi build tools RUN --mount=target=/build-scripts,type=bind,source=scripts \ - TF2PULUMI_VERSION=0.6.0 \ - TF2PULUMI_SHA256=9a8fdfc590f8813a5ccaf1bfb1abba3064f109cce34f47fc66a34adaaa44c50f \ + TF2PULUMI_VERSION=0.8.0 \ + TF2PULUMI_SHA256=0019dfc4b32d63c1392aa264aed2253c1e0c2fb09216f8e2cc269bbfb8bb49b5 \ /build-scripts/install-pulumi-tools.sh # Set various required environment variables diff --git a/scripts/install-dotnet.sh b/scripts/install-dotnet.sh index 8fac539..86ddbb5 100755 --- a/scripts/install-dotnet.sh +++ b/scripts/install-dotnet.sh @@ -19,6 +19,6 @@ rm packages-microsoft-prod.deb apt-get update -apt-get install -y \ +apt-get install --no-install-recommends -y \ "dotnet-sdk-${DOTNET_SDK_VERSION}" \ "aspnetcore-runtime-${DOTNET_SDK_VERSION}" diff --git a/scripts/install-node.sh b/scripts/install-node.sh index f7a4321..55319c3 100755 --- a/scripts/install-node.sh +++ b/scripts/install-node.sh @@ -21,6 +21,6 @@ echo "deb https://deb.nodesource.com/${NODE_REPO} ${NODE_DISTRO} main" > /etc/ap echo "deb-src https://deb.nodesource.com/${NODE_REPO} ${NODE_DISTRO} main" >> /etc/apt/sources.list.d/nodesource.list apt-get update -apt-get install -y nodejs +apt-get install -y nodejs --no-install-recommends curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version "${YARN_VERSION}" diff --git a/scripts/install-packages.sh b/scripts/install-packages.sh index f08f810..8846d02 100755 --- a/scripts/install-packages.sh +++ b/scripts/install-packages.sh @@ -4,6 +4,10 @@ set -o errexit set -o pipefail set -o xtrace +# Reduce apt deps +echo 'APT::Install-Recommends "0";' >> /etc/apt/apt.conf +echo 'APT::Install-Suggests "0";' >> /etc/apt/apt.conf + SCRIPT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" > /dev/null 2>&1 && pwd)" #shellcheck source=utils.sh source "${SCRIPT_ROOT}/utils.sh" diff --git a/scripts/install-protobuf-tools.sh b/scripts/install-protobuf-tools.sh index 4760e84..b252d3b 100755 --- a/scripts/install-protobuf-tools.sh +++ b/scripts/install-protobuf-tools.sh @@ -37,6 +37,8 @@ GOBIN=/usr/local/bin /usr/local/go/bin/go install github.com/golang/protobuf/pro popd rm -rf /tmp/protobuf +# See https://github.com/grpc/grpc-node/issues/922#issuecomment-610972948 for why +npm install --unsafe-perm -g request@2.88.2 # Install Node gRPC Tools npm install --unsafe-perm -g "grpc@${NODEJS_GRPC_VERSION}" "grpc-tools@${NODEJS_GRPC_TOOLS_VERSION}" diff --git a/scripts/install-python.sh b/scripts/install-python.sh index 0ae7ee4..3410bb7 100755 --- a/scripts/install-python.sh +++ b/scripts/install-python.sh @@ -17,10 +17,10 @@ ensureSet "${TWINE_VERSION}" "TWINE_VERSION" || exit 1 export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get install -y "python${PYTHON_VERSION}" python3-pip +apt-get install -y "python${PYTHON_VERSION}" python3-pip python3-setuptools --no-install-recommends update-alternatives --install /usr/bin/python3 python3 "/usr/bin/python${PYTHON_VERSION}" 1 python3 --version -pip3 install --user "pipenv==${PIPENV_VERSION}" -pip3 install --user "awscli==${AWSCLI_VERSION}" -pip3 install --user "wheel==${WHEEL_VERSION}" "twine==${TWINE_VERSION}" +pip3 install --no-cache --user "pipenv==${PIPENV_VERSION}" +pip3 install --no-cache --user "awscli==${AWSCLI_VERSION}" +pip3 install --no-cache --user "wheel==${WHEEL_VERSION}" "twine==${TWINE_VERSION}"