openshift上传java web项目

下载当前客户端

OC(Openshift Client)

https://mirror.openshift.com/pub/openshift-v3/clients/3.9.14/windows/oc.zip

1 切换到oc所在目录。

2 登录控制台以后在你的用户名上面点击"Copy Login command"

3 在命令行运行 oc login https://api.starter-us-west-2.openshift.com --token=83bfawHxr62xB-FXRIDjDvjcJVyworVNq9xpKtqJu2o

4 输入你的帐号及密码

oc-new porject javaweb

oc new-app wildfly:latest~. --name myhelloworld 新建应用服务器

oc start-build myhelloworld --from-file=d:\helloworld.war 上传war包

oc expose svc myhelloworld 使项目对公网可见

oc get routes 查看项目部署情况,以下是博主部署的项目

oc get routes
NAME           HOST/PORT                                                      PATH      SERVICES       PORT       TERMINATION   WILDCARD
myhelloworld   myhelloworld-jdk180.7e14.starter-us-west-2.openshiftapps.com              myhelloworld   8080-tcp                 None

  博主刚刚部署的war名是 helloworld

在浏览器只要输入http://myhelloworld-jdk180.7e14.starter-us-west-2.openshiftapps.com/helloworld即可访问。

效果如下

 参考网址:https://blog.openshift.com/deploying-war-file-openshift-online-3/

转载于:https://www.cnblogs.com/passedbylove/p/8745773.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值