Jenkins+nodejs+webpack搭建
一、环境准备(java,maven,nodejs,webpack)[root@13 ~]# yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel[root@13 ~]# tar zxvf jdk-8u91-linux-x64.tar.gz -C /opt/[root@13 ~...
一、环境准备(java,maven,nodejs,webpack)
[root@13 ~]# yum install -y curl-devel expat-devel gettext-devel openssl-devel zlib-devel
[root@13 ~]# tar zxvf jdk-8u91-linux-x64.tar.gz -C /opt/
[root@13 ~]# tar xvf apache-maven-3.5.0-bin.tar.gz -C /opt/
[root@13 ~]#wget http://cdn.npm.taobao.org/dist/node/v10.15.1/node-v10.15.1-linux-x64.tar.xz
[root@13 ~]# tar xvf node-v10.15.1-linux-x64.tar.xz -C /opt/
[root@13 ~]# mv /opt/node-v10.15.1-linux-x64 /opt/nodejs
配置环境变量/etc/profile
[root@13 ~]# vi /etc/profile
末尾添加以下配置
#set java environment
JAVA_HOME=/opt/jdk1.8.0_91
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH
#set maven environment
MAVEN_HOME=/opt/apache-maven-3.5.0
export MAVEN_HOME
export PATH=${PATH}:${MAVEN_HOME}/bin
export NODE_HOME=/opt/nodejs
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules
[root@13 ~]# source /etc/profile
[root@13 ~]# ln -s /opt/nodejs/bin/npm /usr/bin/
[root@13 ~]# ln -s /opt/nodejs/bin/node /usr/bin/
[root@13 ~]# ln -s /opt/nodejs/bin/webpack /usr/bin/
通过npm安装webpack
[root@13 ~]# npm install webpack -g
[root@13 ~]# npm install vue-cli -g
[root@13 ~]# npm install webpack-cli -g
[root@13 ~]# npm install -g concurrently
[root@13 ~]# npm install -g lite-server
[root@13 ~]# npm install -g typescript
二、安装Jenkins
[root@13 ~]# sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo
[root@13 ~]# sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key
[root@13 ~]# sudo yum install jenkins -y
[root@13 ~]# vi /etc/rc.d/init.d/jenkins
[root@13 ~]# service jenkins start
修改地址
https://updates.jenkins.io/update-center.json -> http://updates.jenkins.io/update-center.json
添加插件NodeJS Git
配置全局变量
搭建工程
本文只是处理到Jenkins编译前端代码
转载于:https://blog.51cto.com/5535123/2355042
更多推荐
所有评论(0)