From d4c0ded84dd79ddfac9173f62c41f9dfd6eacb02 Mon Sep 17 00:00:00 2001 From: Cesar Ramirez <73665818+cesar-augusto-ramirez@users.noreply.github.com> Date: Thu, 8 Aug 2024 20:37:34 -0500 Subject: [PATCH] add pnpm cloud builder --- pnpm/Dockerfile | 3 +++ pnpm/README.md | 23 +++++++++++++++++++++++ pnpm/cloudbuild.yaml | 6 ++++++ 3 files changed, 32 insertions(+) create mode 100644 pnpm/Dockerfile create mode 100644 pnpm/README.md create mode 100644 pnpm/cloudbuild.yaml diff --git a/pnpm/Dockerfile b/pnpm/Dockerfile new file mode 100644 index 000000000..3f7fb0cb4 --- /dev/null +++ b/pnpm/Dockerfile @@ -0,0 +1,3 @@ +FROM node:18-alpine + +RUN corepack enable && corepack prepare pnpm@latest --activate \ No newline at end of file diff --git a/pnpm/README.md b/pnpm/README.md new file mode 100644 index 000000000..2b96f51e9 --- /dev/null +++ b/pnpm/README.md @@ -0,0 +1,23 @@ +# pnpm builder for Google Cloud Build + +This image can be used in Google Cloud Run to have access to `pnpm`. + +## Submit the image to your project + +```bash +gcloud builds submit --tag gcr.io//pnpm-builder +``` + +## Example usage on a `cloudbuild.yaml` + +```yaml +steps: + - id: install + name: gcr.io/$PROJECT_ID/pnpm-builder + entrypoint: pnpm + args: ['install', '--frozen-lockfile'] + - id: test + name: gcr.io/$PROJECT_ID/pnpm-builder + entrypoint: pnpm + args: ['run', 'test'] +``` diff --git a/pnpm/cloudbuild.yaml b/pnpm/cloudbuild.yaml new file mode 100644 index 000000000..e073dd35a --- /dev/null +++ b/pnpm/cloudbuild.yaml @@ -0,0 +1,6 @@ +steps: + - name: 'gcr.io/cloud-builders/docker' + args: ['build', '-t','gcr.io/$PROJECT_ID/pnpm-builder','.'] + +images: + - gcr.io/$PROJECT_ID/pnpm-builder