Come and technology in Taiwan take you easily play with Node.js

Come and technology in Taiwan take you easily play with Node.js
Preface
  the UF cloud in Taiwan - Developer Center provides comprehensive support for the development of state and running state, it can be seen as a cloud a cloud, cloud, DevOps cloud of industries, operation and maintenance personnel of developers, support for innovation cloud. It is an application lifecycle management platform, based on the underlying technology vessel (Docker), is rapidly changing the way companies and users to create, publish and way of running distributed applications.
  DevOps philosophy makes the software industry increasingly clear understanding that in order to timely delivery of software products and services, development, operation and maintenance and operations must work closely together. UFIDA Cloud Developer Center will DevOps concepts into one, to build a one-stop enterprise application development operation and maintenance services.
  In this paper, the front and rear ends of an open source blog system on github as an example, based on the front and rear end Node.js application developers how to quickly deploy in the Developer Center.

1, Node.js front-end application deployment process
  to create a pipeline
  after 1) Click on the button to create lines, fill in some basic information
Come and technology in Taiwan take you easily play with Node.js
  2) fill in the configuration parameter information
Come and technology in Taiwan take you easily play with Node.js
  when filling configuration, note these places:
  · When you select the type of application, based on the Node. js application development must choose "Node application";
  • select Git repository after the build mode, click on the "source build" button to fill in Git information;
  to select "nginx-node" · deploy the base image when the front end of the project;
  · the Node compiler package command to be consistent and build directory and projects set in;
  · the Node do not fill the front end of the project start command, or it may cause the container to fail to start.
  3) configuration deployment information
Come and technology in Taiwan take you easily play with Node.js
  Developer center of each line contains several sets of environment, you need to select the deployment environment when you create the line. In addition to the environmental information provided by the platform environment, you can also customize the environment. After selecting deployment environment, you need to select the appropriate resource pool.
  Next, set the basic information of the application operation, including memory, CPU, ports, environment variables, and other user-defined log path.
  Execution pipeline
  after the pipeline is first created, the system automatically executes the specified line in the configuration environment. When the execution pipeline, each node of the pipeline will be followed by execution.
Come and technology in Taiwan take you easily play with Node.js
  Developers use ynpm Download Center project depends npm package by default. ynpm is a UF-based internal image library, the user can automatically matching network, automatic switching, fast network download, download cache i.e., to achieve a download, full sharing. Net use ynpm not only to solve some dependencies not download problem npm official website within the UF, but also speed up the download speed, greatly improving the efficiency of the mirror construction.
  Developer Center provides a view pipelined execution logging. In the process of pipelined execution, the user can perform real-time view the current progress, details, installation logs, logs, and compiled execution of the abnormality information.
Come and technology in Taiwan take you easily play with Node.js
  Jump to the application details page to view the application
  when the execution environment of the pipeline is completed, the platform will automatically deploy the appropriate application. Click on the top right of the page "Application Management" to view the details of running applications.

Come and technology in Taiwan take you easily play with Node.js
Come and technology in Taiwan take you easily play with Node.js
  After jumping to the application details page, then you can see if the application has been healthy operation. If you have a healthy state, then click on the domain name to access the front page of the project we deployed.
  In the present example, the page is opened after the front end of the following items.
Come and technology in Taiwan take you easily play with Node.js
  In this way, the front end of the project have been deployed up.
  In addition, when we visit the domain name, the default is to open the index.html file for the project. If the project has more access to the entrance, then, the platform also supports access. If the project currently deployed there main.html file, then the path of joining the domain name, you can access, such as HTTP: // ** . /Main.html
 
 application deployment is successful, the project may continue to be in a state of constant iteration. Developer Center iterative application provides a wealth of features, including upgrade, rollback, logging, monitoring, automatic scaling and so on.
 
 Come and technology in Taiwan take you easily play with Node.js

2、Node.js后端应用的部署流程
  新建流水线
  1)填写基本信息
  和之前的例子一样,填写应用名称等基本信息。
Come and technology in Taiwan take you easily play with Node.js
  2)配置参数信息
Come and technology in Taiwan take you easily play with Node.js
  配置信息时,需要注意以下几个地方:
  ·启动命令和端口和项目中的保持一致;
  ·部署服务端项目时要选择node:version基础镜像;
  ·项目中的启动端口可以从环境变量中读取,但是不要使用开发者中心的预置环境变量,如PORT、HOST等,因为这些环境变量不能自定义,即使自定义也不能生效。
  3)配置部署信息
  选择要部署的环境、资源池、内存、CPU、环境变量等,设置完成后,点击“创建应用”按钮完成创建流水线。
  执行流水线
  用户在迭代升级的过程中,可以随时编辑各个节点的参数,保存参数后再次执行流水线时生效。
Come and technology in Taiwan take you easily play with Node.js
  其中“拉取代码”节点提供了设置多git的功能,可以同时设置多个Git仓库。
Come and technology in Taiwan take you easily play with Node.js
  另外,“生成镜像”节点提供了自定义Dockerfile的功能,当用户要实现一些复杂的构建部署逻辑或者个性化的逻辑时,就可以使用Dockerfile神器构建应用。比如我们可以在Dockerfile中设置其他npm源。
Come and technology in Taiwan take you easily play with Node.js
  本实例中,给出的一个Dockerfile内容如下图。
Come and technology in Taiwan take you easily play with Node.js
  查看流水线的执行日志,等待流水线的所有节点执行成功之后,跳转到应用详情页面查看应用。
Come and technology in Taiwan take you easily play with Node.js
  跳转到应用详情页面查看应用
Come and technology in Taiwan take you easily play with Node.js
  After jumping to the application details page, check whether the application is healthy. If health is displayed directly verify the operation of the project. Such as this example, click on the domain name, the domain name stitching "/ currentUser" this location and access, the interface returns the status value of 200, this shows that our application has been deployed successfully and the following diagram.
Come and technology in Taiwan take you easily play with Node.js

3. Conclusion
  In general, front-end developer knowledge about the extent of the operation and maintenance is relatively small, in the ordinary course of the iterative development, on-line, etc., we need professional maintenance personnel to help solve environmental problems, which are to a large extent bound on the front-end development work.
  Pipelining functions Developer Center provides the perfect solution to this problem pain points. Based on the development of live lines, the front end can be self-reliant hold, on-line all the links, but also saves time and effort. All aspects of compilation, packaging, publishing is done on the cloud, does not take up any resources to local developers, the real key to a complete on-line operation.
  This article simply describes the application deployment process on the front and rear end Node.js application in the Developer Center. Developer Center also supports the deployment of many other types of applications, such as Java Web, Java, static websites, Python, Dubbo, Go, PHP , and other micro-service orchestration. In addition to deploying the use of container mode, it also provides a native way for the deployment of Java and Java Web type applications to meet a variety of user needs.
  Developer Center, more exciting because of you!

Guess you like

Origin blog.51cto.com/14084875/2416267