forked from juice-shop/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
48 lines (44 loc) · 1.48 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
'use strict'
module.exports = function (grunt) {
var node = grunt.option('node') || process.env.nodejs_version || process.env.TRAVIS_NODE_VERSION || ''
var platform = grunt.option('platform') || process.env.PLATFORM || process.env.TRAVIS ? 'x64' : ''
var os = grunt.option('os') || process.env.APPVEYOR ? 'windows' : process.env.TRAVIS ? 'linux' : ''
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
compress: {
pckg: {
options: {
mode: os === 'linux' ? 'tgz' : 'zip',
archive: 'dist/<%= pkg.name %>-<%= pkg.version %>' + (node ? ('_node' + node) : '') + (os ? ('_' + os) : '') + (platform ? ('_' + platform) : '') + (os === 'linux' ? '.tgz' : '.zip')
},
files: [
{
src: [
'*.md',
'app.js',
'server.js',
'package.json',
'ctf.key',
'swagger.yml',
'frontend/dist/frontend/**',
'config/*.yml',
'data/*.js',
'data/static/**',
'encryptionkeys/**',
'ftp/**',
'lib/**',
'models/*.js',
'routes/*.js',
'node_modules/**',
'views/**',
'uploads/complaints/.gitkeep'
],
dest: 'juice-shop_<%= pkg.version %>/'
}
]
}
}
})
grunt.loadNpmTasks('grunt-contrib-compress')
grunt.registerTask('package', [ 'compress:pckg' ])
}