gpt4 book ai didi

linux - shell脚本无法在eclipse che中创建工作区

转载 作者:太空宇宙 更新时间:2023-11-04 11:48:59 28 4
gpt4 key购买 nike

我已经编写了一个 shell 脚本来在 eclipse che 中创建一个工作区。该脚本正在生成工作区 url。但是当我打开它时,工作区不会退出。我错过了什么吗?

#!/bin/sh
#=========================================================================

repo_url=$1
branch_name=$2
ip_addr=$3
#echo $repo_url
#B="$(cut -d'/' -f4 <<<$repourl)"
temp_var="$(echo $repo_url | cut -d'/' -f5)"
repo_name="$(echo $temp_var | cut -d '.' -f1)"

#rm /opt/stackstorm/packs/jenkins/template/latest_template
sudo cp /opt/stackstorm/packs/dev_prediction/actions/latest_template.sh /opt/stackstorm/packs/dev_prediction/template/
#sed -i "s/repourl/$repo_url/g;s/branchname/$branch_name/g;s/reponame/$repo_name/g;s/ipaddr/$ip_addr/g" latest_template

sudo sed -i "s@repourl@$repo_url@g;s@branchname@$branch_name@g;s@reponame@$repo_name@g;s@ipaddr@$ip_addr@g" /opt/stackstorm/packs/dev_prediction/template/latest_template.sh
sudo chmod u+x /opt/stackstorm/packs/dev_prediction/template/latest_template.sh
#cat /opt/stackstorm/packs/jenkins/template/latest_template
sudo sh /opt/stackstorm/packs/dev_prediction/template/latest_template.sh > /dev/null
sudo rm /opt/stackstorm/packs/dev_prediction/template/latest_template.sh

echo "http://$ip_addr/dashboard/#/ide/admin/$repo_name-$branch_name"

预期和实际网址:"http://URL.ap-south-1.elb.amazonaws.com/dashboard/#/ide/admin/petclinic-new-AIAS-37 "

最佳答案

我实际上并没有遵循...从我在这里看到的情况来看,您只是在生成 URL,而不是在创建工作区。以前做过吗?

要通过访问工作空间的 URL 打开工作空间,工作空间必须先存在 ;-)

如果您正在研究如何从脚本创建工作区,您可以为此使用 REST API 端点。在默认的 Eclipse Che 部署中,我们还在 URL/swagger 上部署了 swagger(在您的例子中为“http://URL.ap-south-1.elb.amazonaws.com/swagger”),因此您可以自己查看所有 API 端点。

您最感兴趣的可能是:

发布到 <cheUrl>/api/devfile从 devfile(新的 Che 7 工作区定义文件)创建工作区

发布到 <cheUrl>/api/workspace从 Che 6 工作区定义 json 创建工作区。

希望这对您有所帮助。

辐射

关于linux - shell脚本无法在eclipse che中创建工作区,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56662796/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com