This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
forked from juice-shop/juice-shop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gruntfile.js
60 lines (55 loc) · 1.87 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
49
50
51
52
53
54
55
56
57
58
59
60
'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.TRAVIS ? 'x64' : ''
var os = grunt.option('os') || process.env.TRAVIS_OS_NAME === 'windows' ? 'win32' : (process.env.TRAVIS_OS_NAME === 'osx' ? 'darwin' : (process.env.TRAVIS_OS_NAME || ''))
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
replace_json: {
manifest: {
src: 'package.json',
changes: {
'engines.node': (node || '<%= pkg.engines.node %>'),
os: (os ? [os] : '<%= pkg.os %>'),
cpu: (platform ? [platform] : '<%= pkg.cpu %>')
}
}
},
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-replace-json')
grunt.loadNpmTasks('grunt-contrib-compress')
grunt.registerTask('package', ['replace_json:manifest', 'compress:pckg'])
}