简体   繁体   English

将 Jenkins 管道部署到 AWS 服务器

[英]Deploy Jenkins pipeline to AWS server

first, I have two AWS Ubuntu servers that I can access by windows cmd using ssh and pem key.首先,我有两台AWS Ubuntu 服务器,我可以通过 windows cmd 使用Z1787D7646304397ADC78访问它们。 However, I have Jenkins installed on one of them.但是,我在其中一个上安装了Jenkins

I have a task which is to use Jenkins Pipeline from the first server to deploy simple files from GitHub repository into the second server.我的任务是使用第一台服务器的 Jenkins 管道将简单文件从GitHub 存储库部署到第二台服务器。 To clarify, the result in server 2 should be the files output from GitHub that is managed by Jenkins in server 1.澄清一下,服务器 2 中的结果应该是来自 GitHub 的文件 output,由服务器 1 中的 Jenkins 管理。

In other words:换句话说:

Server 1: IP = XXX.XXX.XXX.XXX:8080 that contains Jenkins used to manage the output for server 2.服务器 1:IP = XXX.XXX.XXX.XXX:8080 包含用于管理服务器 2 的 output 的 Jenkins。

GitHub: NodeJs and HTML file that outputs "Hello World". GitHub:NodeJs 和 HTML 文件,输出“Hello World”。

Server 2: IP = YYY.YYY.YYY.YYY should output "Hello World" by just using the IP as URL. Server 2: IP = YYY.YYY.YYY.YYY should output "Hello World" by just using the IP as URL.

So, I,m new to this and looking for step by step explanation.所以,我是新手,正在寻找一步一步的解释。 Thanks!谢谢!

Step 1: Install nginx server 2, config the nginx and know the location where the static files are served.步骤 1:安装 nginx 服务器 2,配置 nginx 并知道 static 文件的服务位置。

Step 2: Bring the ssh key to server 1, install nodejs, rsync in server 1 and also create a Jenkins pipeline which can pull the source code from Github, install and build that source code, and rsync to the location where the nginx serves content Step 2: Bring the ssh key to server 1, install nodejs, rsync in server 1 and also create a Jenkins pipeline which can pull the source code from Github, install and build that source code, and rsync to the location where the nginx serves content

I think this is a simple and easy way for you to setup.我认为这是一种简单易行的设置方法。 There are many better ways and you should research how Jenkins and Node work有很多更好的方法,你应该研究 Jenkins 和 Node 是如何工作的

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM