通过Google Cloud Build步骤创建一个zip存档,将其作为工件发布

亚历克斯·巴拉巴诺夫(Alex Balabanov)

我正在通过GCB构建现代的WP主题,我需要一个最终的工件,即ZIP包。作为GCBб的新手,我没有设法自己解决它,但是听起来很明显

无论如何,这是我的最终构建步骤

- name: 'gcr.io/cloud-builders/yarn'
  args: ['build:production']

我需要创建纱线输出的ZIP存档,以递归方式包括除node_modules以外的所有文件夹,并将ZIP作为工件发布(这一部分很清楚,并且我已经使存储桶工作了)。

感谢帮助!

亚历克斯·巴拉巴诺夫(Alex Balabanov)

因此,希望这个答案可以对某人有所帮助。我创建了一个自定义构建步骤,一个非常简单的步骤:

Docker文件

FROM ubuntu
RUN apt-get -q update && \
apt-get -qqy install zip bzip2 gzip

ENTRYPOINT ["zip"]

cloudbuild.yaml

steps:
- name: gcr.io/cloud-builders/docker
  args: ['build', '-t', 'gcr.io/$PROJECT_ID/zip', '.']

images: ['gcr.io/$PROJECT_ID/zip']

并以此方式使用

- name: gcr.io/$PROJECT_ID/zip
  args: ['-r9T', 'theme-$BUILD_ID.zip', '.', '-x *node_modules*']  

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

Google Cloud Build可以通过工件目录进行递归吗?

通过 Cloud Functions 创建 Google Cloud Platform 预算

通过Google Cloud Deployment Manager创建的Google数据流

通过 cloudbuild.yaml 进行的 Google Cloud Build 随机超时

如何通过Google Cloud Build中的步骤设置环境或替换变量?

如何通过cli / rest api / cloud函数运行Google Cloud Build触发器?

我可以运行Docker容器以在另一个Google Cloud Build步骤中使用吗?

Google BigQuery:通过Python创建视图google-cloud-bigquery版本0.27.0与0.28.0

Google Cloud Build超时

直接访问 Google Cloud SQL 还是通过发布子队列访问?

通过Visual Studio发布到Google Cloud Compute Engine-删除实时文件

通过浏览器进行Google Cloud Pub / Sub发布-Auth如何工作?

如何创建一个从 Cloud Storage 返回对象列表的 Google Cloud Function

Google Cloud Build无法通过我的私有GitHub存储库进行身份验证

需要所有者角色来通过Google Cloud Logging创建数据集吗?

如何通过Terraform使用服务帐户创建Google Cloud pubsub订阅?

是否可以通过SSH从Google Cloud一次下载多个文件?

通过SSL连接到Google Cloud Postgres

通过Firebase在Google Cloud中签名错误

Google Cloud Storage通过App Engine定价

Google Cloud Storage 创建发布订阅通知

有没有一种方法可以通过Google数据存储事件触发Google Cloud Function?

如何在Google Cloud App Engine上使用PubSub创建订阅者,以通过Publisher从Google Cloud App Engine Flex收听消息?

如何通过Cloud Composer设置Google Cloud Dataproc的CPUS配额?

如何通过Python将Google Cloud Storage中的文件从一个存储桶移动到另一个存储桶

Google Cloud VM通过OpenVPN将minecraft流量转发到一个客户端,而不是另一个

Google Cloud Build子版本

定期使用Google Cloud Scheduler触发Google Cloud Build

定期使用Google Cloud Scheduler触发Google Cloud Build