我一直在更新使用Codeship Pro构建和部署的项目之一。我们使用codeship/google-cloud-deployment
docker镜像来部署Google云功能。我需要仅在gcloud sdk的最新版本中可用的功能,但是编码通常使用sdk的旧版本,并且似乎在获取图像的缓存版本时卡住了。
codeship-services.yml
googlecloudproductiondeployment:
image: codeship/google-cloud-deployment
encrypted_env_file: deploy/deploy-production.env.encrypted
cached: false
volumes:
- ./:/deploy
codeship-steps.yml
- name: Deploy CF to prod
tag: ^deploy-production$
service: googlecloudproductiondeployment
command: /deploy/deploy/google-deploy-cf.sh
部署/google-deploy-cf.sh
#!/bin/bash
set -e
PROJECT=my-project
FUNCTION_NAME=my-function
SOURCE_REPO=my-repo
# Authenticate on google SDK
codeship_google authenticate
# Re-deploy the CF
gcloud version
gcloud beta functions deploy $FUNCTION_NAME --region europe-west1 --runtime nodejs8 --env-vars-file /deploy/deploy/cf-env.production.yaml --trigger-http --source https://source.developers.google.com/projects/my-project/repos/${PROJECT}/fixed-aliases/${CI_BRANCH} --memory 128MB --entry-point run --timeout 540s
在代码中观察到的输出:
googlecloudproductiondeployment build/pull started
googlecloudproductiondeployment build/pull finished successfully
googlecloudproductiondeployment Activated service account credentials for: [***@***.iam.gserviceaccount.com]
googlecloudproductiondeployment Google Cloud SDK 204.0.0
googlecloudproductiondeployment alpha 2017.09.15
googlecloudproductiondeployment beta 2017.09.15
googlecloudproductiondeployment bq 2.0.34
googlecloudproductiondeployment core 2018.06.04
googlecloudproductiondeployment gsutil 4.31
googlecloudproductiondeployment kubectl
googlecloudproductiondeployment deployng
googlecloudproductiondeployment ERROR: (gcloud.beta.functions.deploy) unrecognized arguments: 2018-10-08 07:42:29 googlecloudproductiondeployment --runtime (did you mean '--timeout'?)
googlecloudproductiondeployment nodejs8
googlecloudproductiondeployment --env-vars-file
googlecloudproductiondeployment /deploy/deploy/cf-env.production.yaml
预期产量:
我希望看到
Google Cloud SDK 218.0.0
,它是codeship's google-cloud-deployment github repo的最后一次提交中提到的版本。尝试的步骤:
:latest
添加到codeship-services.yml
中的图像。 Reset Cache
。Image exists, using cached image
服务的日志中看到googlecloudproductiondeployment
。 docker rmi codeship/google-cloud-deployment
来使代码制作者拉动最新版本。但是,我无法控制代码船上的Docker缓存。 似乎使用旧版本的
codeship/google-cloud-deployment
图像卡住了代码芯片。在docker hub上,此图像除了latest
之外没有其他标签,所以我不知道如何强制代码船获得特定版本。请帮忙!
最佳答案
抱歉造成麻烦。
我们已经进行了工作,并确保codeship/google-cloud-deployment
的版本保持最新。
通常,我们会在两到三周的时间内跟踪最新的Google Cloud SDK。但这将与最新版本保持更接近的均等。我们现在也可以根据需要加快Google Cloud SDK的更新。
如果您重置项目缓存并重新开始构建,则您将注意到(截至撰写本文时)Google Cloud SDK现在已设置为219.0.1
图像的codeship/google-cloud-deployment
版本。
关于docker - 使用旧的codeship/google-cloud-deployment图像卡住了codeship,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52699106/