要将Jenkins作业复制到Google Cloud Build,请遵循以下步骤:
steps:
- name: 'gcr.io/cloud-builders/docker'
args: ['build', '-t', 'gcr.io/$PROJECT_ID/your-image-name:$SHORT_SHA', '.']
- name: 'gcr.io/cloud-builders/docker'
args: ['push', 'gcr.io/$PROJECT_ID/your-image-name:$SHORT_SHA']
- name: 'gcr.io/cloud-builders/gcloud'
args: ['run', 'deploy', 'your-service-name', '--image', 'gcr.io/$PROJECT_ID/your-image-name:$SHORT_SHA', '--region', 'your-region', '--platform', 'managed']
请根据您的需求修改此示例。
领取专属 10元无门槛券
手把手带您无忧上云