Hi, I’m trying to create a CI/CD using google’s cloud build for my redwoodjs app.
Here is my cloudbuild.yaml
steps:
# build api image
- name: 'gcr.io/cloud-builders/docker'
id: "api-img"
args: ["build", "-f", "Dockerfile.api", "--build-arg=WEB_URL=${_WEB_URL}", "--build-arg=FIREBASE_PROJECT_ID=${_FIREBASE_PROJECT_ID}", "-t", 'gcr.io/${PROJECT_ID}/lma-api', '.' ]
waitFor: ["-"]
# build web image
- name: 'gcr.io/cloud-builders/docker'
id: "web-img"
args: ['build', "-f", "Dockerfile.web", "--build-arg=WEB_URL=${_WEB_URL}", "--build-arg=API_URL=${_API_URL}", "--build-arg=GQL_ENDPOINT=${_GQL_ENDPOINT}", "--build-arg=DATABASE_URL=${_DATABASE_URL}" ,"--build-arg=FIREBASE_API_KEY=${_FIREBASE_API_KEY}","--build-arg=FIREBASE_APP_ID=${_FIREBASE_APP_ID}","--build-arg=FIREBASE_AUTH_DOMAIN=${_FIREBASE_AUTH_DOMAIN}","--build-arg=FIREBASE_MESSAGING_SENDER_ID=${_FIREBASE_MESSAGING_SENDER_ID}","--build-arg=FIREBASE_PROJECT_ID=${_FIREBASE_PROJECT_ID}","--build-arg=FIREBASE_STORAGE_BUCKET=${_FIREBASE_STORAGE_BUCKET}","--build-arg=GOOGLE_MAP_ID=${_GOOGLE_MAP_ID}","--build-arg=GOOGLE_MAPS_API_KEY=${_GOOGLE_MAPS_API_KEY}","--build-arg=SESSION_SECRET=${_SESSION_SECRET}",'-t', 'gcr.io/${PROJECT_ID}/lma-web', '.']
waitFor: ["-"]
# migrate db
- name: 'gcr.io/cloud-builders/yarn'
id: "yarn-install"
args: ["install"]
- name: 'gcr.io/cloud-builders/yarn'
args: [ "rw", "prisma", "migrate", "deploy"]
waitFor: ["api-img", "web-img"]
images: ['gcr.io/${PROJECT_ID}/lma-api',
'gcr.io/${PROJECT_ID}/lma-web'
]
for the migrate step, i am getting this error in the cloud build build log:
Already have image (with digest): gcr.io/cloud-builders/yarn
/workspace/node_modules/@redwoodjs/cli/dist/index.js:62
cwd ??= process.env.RWJS_CWD;
^^^
SyntaxError: Unexpected token '??='
at wrapSafe (internal/modules/cjs/loader.js:1001:16)
at Module._compile (internal/modules/cjs/loader.js:1049:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/workspace/node_modules/@redwoodjs/core/dist/bins/redwood.js:30:1)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
( I commented out the other build steps for testing )
can anyone tell me why this is happening or how to fix this? it would be much appreciated, thanks in advance!