一、手工绑定
cf map-route appname domain -n hostname --path route
二、yaml 文件配置,也是这里想着重介绍的快捷方法
1、下载安装cf-cli工具
wget -O cf-cli-installer_6.22.2_x86-64.deb https://cli.run.pivotal.io/stable?release=debian64&version=6.22.2&source=github-rel >> cf-cli-installer_6.22.2_x86-64.deb
dpkg -i cf-cli-installer_6.22.2_x86-64.deb
2、编辑yaml 配置文件
$ cat manifest-prod.yml
---
applications:
- name: test20171129-164923
memory: 512M
disk_quota: 512M
instances: 1
routes:
- route: a1.test.com/t
- route: a2.test2.com
path: ./
stack: cflinuxfs2
command: ./appname
buildpack: binary_buildpack
env:
GOVERSION: go1.8
GOPACKAGENAME: "appname"
3、发布应用
cf push -f manifest-prod.yml
参考:
http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html
https://github.com/cloudfoundry/cli/releases/tag/v6.22.2