两个部分的问题:
我的计划是在我的git存储库中有几个分支,同事们正在处理几个问题。我想建立他们最初的环境。我知道有些事情需要在码头映像中完成,有些事情可以在.gitpod.yml中指定--这里关注的是我在预构建中可以做的事情。
所以我创建了一个分支,在其中我更新了我的基本.gitpod.yml
ports:
- port: 3000
github:
prebuilds:
# enable for the default branch (defaults to true)
master: true
# enable for all branches in this repo (defaults to false)
branches: true
# enable for pull requests coming from this repo (defaults to true)
pullRequests: true
# enable for pull requests coming from forks (defaults to false)
pullRequestsFromForks: false
# add a check to pull requests (defaults to true)
addCheck: true
# add a "Review in Gitpod" button as a comment to pull requests (defaults to false)
addComment: false
# add a "Review in Gitpod" button to the pull request's description (defaults to false)
addBadge: true我相信我已经启动了gitpod的构建:

然后,我尝试在预构建中添加一些琐碎的工作(最终,我想做一些更有用的事情,比如在一个窗格中的开始节点表达式)。
github:
prebuilds:
master: true
# etc ... lines elided
tasks:
- name: "Lefty"
command: echo 'left'
- name: "Dexter"
command: echo 'right'
openMode: split-right我检查了那张零钱,然后推到树枝上。我的期望是,我会在某一时刻看到一个分裂的终端窗口与一些回响的文本。
在工作区生命周期中,我不清楚何时会发生这种情况。我试过这个序列:
.gitpod.yml
这会弹出一个带有更新的.gitpod.yml的新工作区,但我没有看到预构建的证据。我欢迎再教育;)
发布于 2022-07-01 05:59:15
我误解了.gitpod.yml语法,任务部分应该在顶层,而不是像我一样在预构建下。
github:
prebuilds:
master: true
# etc ... lines elided
tasks:
- name: "Lefty"
before: |
echo "In $(pwd)"
init: |
echo "Could npm install here"
command: |
echo 'left'
- name: "Dexter"
command: |
echo 'right'
openMode: split-right我检查了将.gitpod.yml文件重组到git中,启动了一个新的工作区,并看到脚本在拆分的窗口中运行。
带走的想法是,任务节独立于您正在使用的特定git;在我的示例中,github节确定何时运行、init和命令脚本。
https://stackoverflow.com/questions/72819260
复制相似问题