{"id":727,"date":"2018-07-01T16:30:42","date_gmt":"2018-07-01T08:30:42","guid":{"rendered":"https:\/\/woohuiren.me\/blog\/?p=727"},"modified":"2018-07-01T16:30:42","modified_gmt":"2018-07-01T08:30:42","slug":"travisci-cloud-foundry-deployment-use-dashes","status":"publish","type":"post","link":"https:\/\/woohuiren.me\/blog\/travisci-cloud-foundry-deployment-use-dashes\/","title":{"rendered":"TravisCI Cloud Foundry Deployment: Use Dashes!"},"content":{"rendered":"<p>Summary: Use dashes for naming Cloud Foundry &#8216;Organization&#8217; and &#8216;Space&#8217;. Do not use spaces\/blanks!<\/p>\n<p>Using spaces in my Cloud Foundry &#8216;Organization&#8217; and &#8216;Space&#8217; name caused quite some trouble for me during my TravisCI deployment process. Originally, my Cloud Foundry &#8216;Organization&#8217; and &#8216;Space&#8217; is as follows:<\/p>\n<pre>API endpoint: https:\/\/api.run.pivotal.io\r\nUser: thatsmyemail@example.com\r\nOrg: Some Big Organization\r\nSpace: cloud production api<\/pre>\n<p>With the following travis.yml<\/p>\n<pre>deploy:\r\n\u00a0 provider: cloudfoundry\r\n\u00a0 edge: true\r\n\u00a0 username: thatsmyemail\\@example.com\r\n\u00a0 password:\r\n    secret: somereallysecretivesecret\r\n\u00a0 api: https:\/\/api.run.pivotal.io\r\n\u00a0 organization: Some Big Organization\r\n\u00a0 space: cloud production api\r\n\u00a0 on:\r\n\u00a0   branch: master<\/pre>\n<p>This caused TravisCI&#8217;s Cloud Foundry deployment gem to read my stated configuration as the following:<\/p>\n<pre>deploy:\r\n\u00a0 provider: cloudfoundry\r\n\u00a0 edge: true\r\n\u00a0 username: thatsmyemail\\@example.com\r\n\u00a0 password:\r\n    secret: somereallysecretivesecret\r\n\u00a0 api: https:\/\/api.run.pivotal.io\r\n\u00a0 organization: Some\r\n\u00a0 space: cloud\r\n\u00a0 on:\r\n\u00a0   branch: master<\/pre>\n<p>This will cause deployment failure because the interpreted &#8216;Organization&#8217; and &#8216;Space&#8217; simply doesn&#8217;t exists.<\/p>\n<p>To fix this issue, I just replaced the spaces in my &#8216;Organization&#8217; and &#8216;Space&#8217; with dashes. Take note that TravisCI doesn&#8217;t automatically <a href=\"https:\/\/docs.travis-ci.com\/user\/encryption-keys\/#Note-on-escaping-certain-symbols\">escape special characters<\/a>, so you&#8217;ll have to do it on your own.\u00a0 In this scenario, I have done so by adding backslashes to my dashes.<\/p>\n<pre>deploy:\r\n\u00a0 provider: cloudfoundry\r\n\u00a0 edge: true\r\n\u00a0 username: thatsmyemail\\@example.com\r\n\u00a0 password:\r\n    secret: somereallysecretivesecret\r\n\u00a0 api: https:\/\/api.run.pivotal.io\r\n\u00a0 organization: Some\\-Big\\-Organization\r\n\u00a0 space: cloud\\-production\\-api\r\n\u00a0 on:\r\n\u00a0   branch: master<\/pre>\n<p>Thereafter, this issue is fixed and TravisCI can finally read my configuration properly and deploy correctly!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary: Use dashes for naming Cloud Foundry &#8216;Organization&#8217; and &#8216;Space&#8217;. Do not use spaces\/blanks! Using spaces in my Cloud Foundry &#8216;Organization&#8217; and &#8216;Space&#8217; name caused quite some trouble for me during my TravisCI deployment process. Originally, my Cloud Foundry &#8216;Organization&#8217; and &#8216;Space&#8217; is as follows: API endpoint: https:\/\/api.run.pivotal.io User: thatsmyemail@example.com Org: Some Big Organization Space: &hellip; <a href=\"https:\/\/woohuiren.me\/blog\/travisci-cloud-foundry-deployment-use-dashes\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;TravisCI Cloud Foundry Deployment: Use Dashes!&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":729,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"image","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[71,2,4],"tags":[180,179,182,181,176],"class_list":["post-727","post","type-post","status-publish","format-image","has-post-thumbnail","hentry","category-hosting-industry","category-information-technology","category-it-softwares","tag-cloud-foundry","tag-deployment","tag-pivotal-cloud-foundry","tag-pivotal-web-services","tag-travisci","post_format-post-format-image"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"https:\/\/i0.wp.com\/woohuiren.me\/blog\/wp-content\/uploads\/2018\/07\/untitled.png?fit=1200%2C630&ssl=1","_links":{"self":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/727"}],"collection":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/comments?post=727"}],"version-history":[{"count":3,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/727\/revisions"}],"predecessor-version":[{"id":732,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/posts\/727\/revisions\/732"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/media\/729"}],"wp:attachment":[{"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/media?parent=727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/categories?post=727"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/woohuiren.me\/blog\/wp-json\/wp\/v2\/tags?post=727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}