提交 4d62267d 编写于 作者: 李少辉-开发者's avatar 李少辉-开发者 🎧

add ci file

Signed-off-by: 李少辉-开发者's avatarlish <lish@csdn.net>
上级 21da9e2e
流水线 #4094 已通过 ,包含阶段
in 6 分38 秒
image: node:10.16.3
pages:
script:
- npm install
- npm run build
artifacts:
paths:
- public
expire_in: 1 day
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
...@@ -3,3 +3,5 @@ node_modules ...@@ -3,3 +3,5 @@ node_modules
assets assets
build build
dist dist
public
package-lock.json
...@@ -12,7 +12,7 @@ var gulp = require('gulp'), ...@@ -12,7 +12,7 @@ var gulp = require('gulp'),
gulp.task('webserver', function () { gulp.task('webserver', function () {
connect.server({ connect.server({
root: 'dist', root: 'public',
host: '127.0.0.1', // host: '127.0.0.1', //
port: 80 port: 80
}); });
...@@ -20,7 +20,7 @@ gulp.task('webserver', function () { ...@@ -20,7 +20,7 @@ gulp.task('webserver', function () {
gulp.task('js', function () { gulp.task('js', function () {
return gulp.src('src/js/*.js') return gulp.src('src/js/*.js')
.pipe(uglify()) .pipe(uglify())
.pipe(gulp.dest('dist/js')) .pipe(gulp.dest('public/js'))
}); });
gulp.task('css', function () { gulp.task('css', function () {
return gulp.src("src/css/*.css") return gulp.src("src/css/*.css")
...@@ -28,16 +28,16 @@ gulp.task('css', function () { ...@@ -28,16 +28,16 @@ gulp.task('css', function () {
.pipe(cleanCss({ .pipe(cleanCss({
compatibility: 'ie8' compatibility: 'ie8'
})) }))
.pipe(gulp.dest('dist/css')) .pipe(gulp.dest('public/css'))
}); });
gulp.task('zip', function () { gulp.task('zip', function () {
return gulp.src("src/static/*.zip") return gulp.src("src/static/*.zip")
.pipe(gulp.dest('dist/static')) .pipe(gulp.dest('public/static'))
}); });
gulp.task('image', function () { gulp.task('image', function () {
return gulp.src('src/img/*.{jpg,png,gif,svg}') //要处理的图片目录为img目录下的所有的.jpg .png .gif 格式的图片; return gulp.src('src/img/*.{jpg,png,gif,svg}') //要处理的图片目录为img目录下的所有的.jpg .png .gif 格式的图片;
.pipe(cached(imagemin())) .pipe(cached(imagemin()))
.pipe(gulp.dest('dist/img')) .pipe(gulp.dest('public/img'))
}); });
gulp.task('fileinclude', function () { gulp.task('fileinclude', function () {
...@@ -51,12 +51,12 @@ gulp.task('fileinclude', function () { ...@@ -51,12 +51,12 @@ gulp.task('fileinclude', function () {
collapseWhitespace: true, collapseWhitespace: true,
removeComments: true removeComments: true
})) }))
.pipe(gulp.dest('dist')); .pipe(gulp.dest('public'));
}); });
gulp.task('testFile', function(){ gulp.task('testFile', function(){
return gulp.src(['src/test/**/*.*']) return gulp.src(['src/test/**/*.*'])
.pipe(gulp.dest('dist/test')); .pipe(gulp.dest('public/test'));
}) })
gulp.task('watch', function () { gulp.task('watch', function () {
...@@ -69,7 +69,7 @@ gulp.task('watch', function () { ...@@ -69,7 +69,7 @@ gulp.task('watch', function () {
}) })
gulp.task('clean', function () { gulp.task('clean', function () {
return del('dist'); return del('public');
}); });
gulp.task('default', ['clean'], function () { gulp.task('default', ['clean'], function () {
gulp.start('fileinclude', 'css', 'image', 'js', 'webserver', 'watch','zip', 'testFile'); gulp.start('fileinclude', 'css', 'image', 'js', 'webserver', 'watch','zip', 'testFile');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册