diff --git a/pants/Dockerfile b/pants/Dockerfile new file mode 100644 index 000000000..bf759010b --- /dev/null +++ b/pants/Dockerfile @@ -0,0 +1,13 @@ +ARG PY_VERSION=3.11 +FROM python:${PY_VERSION}-bookworm + +RUN export DEBIAN_FRONTEND=noninteractive \ + && apt-get update \ + && apt-get -y upgrade \ + && apt-get -y install --no-install-recommends \ + curl ca-certificates + +ENV PATH="/root/.local/bin:$PATH" +RUN curl --proto '=https' --tlsv1.2 -fsSL https://static.pantsbuild.org/setup/get-pants.sh | bash + +ENTRYPOINT [ "pants" ] diff --git a/pants/README.md b/pants/README.md new file mode 100644 index 000000000..11862c091 --- /dev/null +++ b/pants/README.md @@ -0,0 +1,21 @@ +# Pants + +The [pants](https://pantsbuild.org) build system is an open-source mutilingual build tool. + + +## Building this builder + +gcloud builds submit . --config=cloudbuild.yaml --substitutions=_PY_VERSION="3.11" + +## Using Pants + +Assuming you built and pushed the pants builder for python 3.11, an example usage might +look like: + +``` +steps: + - name: gcr.io/$PROJECT_ID/pants:3.11 + args: + - package + - path/to/my:package +``` diff --git a/pants/cloudbuild.yaml b/pants/cloudbuild.yaml new file mode 100644 index 000000000..a7df52208 --- /dev/null +++ b/pants/cloudbuild.yaml @@ -0,0 +1,11 @@ +# yaml-language-server: $schema=https://json.schemastore.org/cloudbuild +steps: + - name: gcr.io/cloud-builders/docker + args: ['build', '.', '--tag=gcr.io/$PROJECT_ID/pants:${_PY_VERSION}', '--build-arg', 'PY_VERSION=${_PY_VERSION}'] + - name: gcr.io/$PROJECT_ID/pants:${_PY_VERSION} + env: + - PANTS_BOOTSTRAP_VERSION=report +substitutions: + _PY_VERSION: "3.11" +images: ['gcr.io/$PROJECT_ID/pants:${_PY_VERSION}'] +tags: ['cloud-builders-community']