Continuously deploy your Angular application
部署Angular项目
- Code on github
- create a DevOps Toolchain on the cloud
- deploy and view the app
` Create a delivery pipeline
A DevOps Toolchain is a set of tools for development, deployment, and operations tasks that you can use together to automate many development tasks (for example, testing and deployment).
#!/bin/bash
export NVM_DIR=/home/pipeline/nvm
export NODE_VERSION=10.9.0
export NVM_VERSION=0.29.0
npm config delete prefix \
&& curl https://raw.githubusercontent.com/creationix/nvm/v${NVM_VERSION}/install.sh | sh \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& node -v \
&& npm -v
npm install -g @angular/cli
npm install
ng build --prod
image.png
#!/bin/bash
cf push "${CF_APP}" --hostname dmat-admin-console --no-manifest -b 'https://github.com/cloudfoundry/staticfile-buildpack'
用自动部署的一些感受:
当push代码到github的时候就会触发自动部署,感觉省去了很多工序节省时间;
网友评论