提交 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
assets
build
dist
public
package-lock.json
......@@ -12,7 +12,7 @@ var gulp = require('gulp'),
gulp.task('webserver', function () {
connect.server({
root: 'dist',
root: 'public',
host: '127.0.0.1', //
port: 80
});
......@@ -20,7 +20,7 @@ gulp.task('webserver', function () {
gulp.task('js', function () {
return gulp.src('src/js/*.js')
.pipe(uglify())
.pipe(gulp.dest('dist/js'))
.pipe(gulp.dest('public/js'))
});
gulp.task('css', function () {
return gulp.src("src/css/*.css")
......@@ -28,16 +28,16 @@ gulp.task('css', function () {
.pipe(cleanCss({
compatibility: 'ie8'
}))
.pipe(gulp.dest('dist/css'))
.pipe(gulp.dest('public/css'))
});
gulp.task('zip', function () {
return gulp.src("src/static/*.zip")
.pipe(gulp.dest('dist/static'))
.pipe(gulp.dest('public/static'))
});
gulp.task('image', function () {
return gulp.src('src/img/*.{jpg,png,gif,svg}') //要处理的图片目录为img目录下的所有的.jpg .png .gif 格式的图片;
.pipe(cached(imagemin()))
.pipe(gulp.dest('dist/img'))
.pipe(gulp.dest('public/img'))
});
gulp.task('fileinclude', function () {
......@@ -51,12 +51,12 @@ gulp.task('fileinclude', function () {
collapseWhitespace: true,
removeComments: true
}))
.pipe(gulp.dest('dist'));
.pipe(gulp.dest('public'));
});
gulp.task('testFile', function(){
return gulp.src(['src/test/**/*.*'])
.pipe(gulp.dest('dist/test'));
.pipe(gulp.dest('public/test'));
})
gulp.task('watch', function () {
......@@ -69,7 +69,7 @@ gulp.task('watch', function () {
})
gulp.task('clean', function () {
return del('dist');
return del('public');
});
gulp.task('default', ['clean'], function () {
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.
先完成此消息的编辑!
想要评论请 注册