如何编写用于在 AWS 中构建项目的管道脚本?

我对 AWS 部分非常陌生,我想构建和部署我的项目,因为我正在 jenkins 中选择管道脚本我正在编写一些构建脚本,我在控制台上遇到这样的错误

Started by user saitarun
Running in Durability level: MAX_SURVIVABILITY
[Pipeline] Start of Pipeline
[Pipeline] node
Running on Jenkins in /var/lib/jenkins/workspace/sample_pipelinejob
[Pipeline] {
[Pipeline] stage
[Pipeline] { (clone repository and clean project)
[Pipeline] sh
+ git clone https://github.com/saitarun135/ADDRESS_BOOK
/var/lib/jenkins/workspace/sample_pipelinejob@tmp/durable-8b9fc0cc/script.sh: line 1: git: command not found
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 127
Finished: FAILURE

如何纠正这个错误以及如何构建我的项目,请帮我解决这个问题.. 以下图像是我的管道配置。

如何编写用于在 AWS 中构建项目的管道脚本?

如何编写用于在 AWS 中构建项目的管道脚本?

oxiang741 回答:如何编写用于在 AWS 中构建项目的管道脚本?

如何安装git

如果您的 git 安装路径在您的主 Jenkins 实例和 Jenkins 代理之间不相同,则您需要在节点配置中specify that path at the agent level

https://cloudbees.zendesk.com/hc/article_attachments/360065141291/db28cbd4_tool_locations.png

(图片来自“cloudbees Using PATH in Git Configuration / In the node configurations”)

您可能需要在该实例上安装 Git:sudo yum install git

,

错误信息

git: command not found

显示您的 git 机器上未安装 Jenkinsgit 不在您的 PATH 变量中。

本文链接:https://www.f2er.com/11844.html

大家都在问