diff --git a/.codechina-ci.yml b/.codechina-ci.yml new file mode 100644 index 0000000000000000000000000000000000000000..4c62f22e9912946be4b8412f8a5795f232f3f57c --- /dev/null +++ b/.codechina-ci.yml @@ -0,0 +1,12 @@ +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 diff --git a/.gitignore b/.gitignore index b6ad6ff687f743301746c2440f17434acf9a59ed..ace4a8fef37bb43fcab14605e1fbd7d2e04bb58d 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ node_modules assets build dist +public +package-lock.json diff --git a/gulpfile.js b/gulpfile.js index 1a5af9a95ca58ebb14ac4a0d4d1be02e5b8db627..131e7243949ceea8b85a085b466a332a211872f1 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -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');