{"id":238267,"date":"2022-07-29T02:26:00","date_gmt":"2022-07-29T06:26:00","guid":{"rendered":"https:\/\/wordpress-756359-3782526.cloudwaysapps.com\/?p=238267"},"modified":"2025-05-30T07:23:12","modified_gmt":"2025-05-30T07:23:12","slug":"22-07-29-quickgsdk","status":"publish","type":"post","link":"https:\/\/www.travis-ci.com\/blog\/22-07-29-quickgsdk\/","title":{"rendered":"Get started with Google Cloud SDK and Travis fast"},"content":{"rendered":"\n<p>In the spirit of being fast, this tutorial will be as fast as the implementation and usage itself. Let\u2019s get to it, running Google Cloud SDK, Docker and Kubectl. Let\u2019s get started.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"the-travisyml\">The&nbsp;<code>.travis.yml<\/code><\/h2>\n\n\n\n<p>Here\u2019s a template&nbsp;<code>.travis.yml<\/code>&nbsp;I\u2019ve made, you can make this into a bash script to make this process more streamlined:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>dist: jammy \ncache:\n  directories:\n  - $HOME\/google-cloud-sdk\nservices:\n- docker\nenv:\n  global:\n  - CLOUDSDK_CORE_DISABLE_PROMPTS=1 \nbefore_install:\n- if &#91; ! -d $HOME\/google-cloud-sdk\/bin ]; then\n    rm -rf $HOME\/google-cloud-sdk;\n    curl https:\/\/sdk.cloud.google.com | bash &gt; \/dev\/null;\n  fi\n- source $HOME\/google-cloud-sdk\/path.bash.inc\n- gcloud components update kubectl\n- gcloud version\ninstall: true\nscript: true<\/code><\/pre>\n\n\n\n<p>You\u2019ll notice&nbsp;<code>curl<\/code>&nbsp;will pull all the things you need from Google, then we run&nbsp;<code>gcloud components update kubectl<\/code>, and we make sure we Docker listed as a service. Your build should look similar to this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"205\" src=\"https:\/\/www.travis-ci.com\/wp-content\/uploads\/2022\/07\/181833484-d5193c31-1298-4983-b83f-50ac924e2e65-1-1024x205-1.png\" alt=\"\" class=\"wp-image-242773\" srcset=\"https:\/\/www.travis-ci.com\/wp-content\/uploads\/2022\/07\/181833484-d5193c31-1298-4983-b83f-50ac924e2e65-1-1024x205-1.png 1024w, https:\/\/www.travis-ci.com\/wp-content\/uploads\/2022\/07\/181833484-d5193c31-1298-4983-b83f-50ac924e2e65-1-1024x205-1-300x60.png 300w, https:\/\/www.travis-ci.com\/wp-content\/uploads\/2022\/07\/181833484-d5193c31-1298-4983-b83f-50ac924e2e65-1-1024x205-1-768x154.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>All done!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\">Conclusion<\/h2>\n\n\n\n<p>You now have a great template to get&nbsp;<code>gcloud<\/code>&nbsp;setup quickly with Docker and Kubectl.<\/p>\n\n\n\n<p>As always, if you have any questions about this tutorial, please email me at&nbsp;<a href=\"mailto:montana@travis-ci.org\">montana@travis-ci.org<\/a>&nbsp;and I will assist you.<\/p>\n\n\n\n<p>Happy building!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the spirit of being fast, this tutorial will be as fast as the implementation and usage itself. Let\u2019s get to it, running Google Cloud SDK, Docker and Kubectl. Let\u2019s get started. The&nbsp;.travis.yml Here\u2019s a template&nbsp;.travis.yml&nbsp;I\u2019ve made, you can make this into a bash script to make this process more streamlined: You\u2019ll notice&nbsp;curl&nbsp;will pull all [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_breakdance_hide_in_design_set":false,"_breakdance_tags":"","footnotes":""},"categories":[16],"tags":[7,19,20,5],"class_list":["post-238267","post","type-post","status-publish","format-standard","hentry","category-news","tag-community","tag-feature","tag-infrastructure","tag-news"],"_links":{"self":[{"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/posts\/238267","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/comments?post=238267"}],"version-history":[{"count":2,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/posts\/238267\/revisions"}],"predecessor-version":[{"id":242774,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/posts\/238267\/revisions\/242774"}],"wp:attachment":[{"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/media?parent=238267"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/categories?post=238267"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.travis-ci.com\/wp-json\/wp\/v2\/tags?post=238267"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}