I've been updating one of our projects that is built and deployed using codeship pro. We use codeship/google-cloud-deployment
docker image to deploy google cloud functions. I need features that are only available in a recent version of the gcloud sdk, but codeship always uses an old version the sdk and seems stuck fetching a cached version of the image.
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
deploy/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
Output observed in codeship:
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
Expected output:
I expect to see Google Cloud SDK 218.0.0
, the version noted in the last commit in codeship's google-cloud-deployment github repo.
Steps tried:
- Adding
:latest
to the image incodeship-services.yml
. - Clicking on
Reset Cache
on the project page on codeship.- Even after reseting the cache, I always see
Image exists, using cached image
in the logs for mygooglecloudproductiondeployment
service on codeship.
- Even after reseting the cache, I always see
- Using jet locally, I can fore codeship to pull the latest version by running
docker rmi codeship/google-cloud-deployment
before jet steps. However, I do not have control over the docker cache on codeship.
It seems codehip is stuck using an old version of the codeship/google-cloud-deployment
image. On docker hub this image has no tags other than latest
, so I don't know how to force codeship to get a specific version. Please help!