forked from pagantis/prestashop
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGruntfile.js
117 lines (114 loc) · 5.54 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
module.exports = function(grunt) {
grunt.initConfig({
shell: {
rename: {
command:
'cp pagantis.zip pagantis-$(git rev-parse --abbrev-ref HEAD).zip \n'
},
autoindex: {
command:
'composer global require pagantis/autoindex \n' +
'php ~/.composer/vendor/pagantis/autoindex/index.php ./ || true \n' +
'php /home/circleci/.config/composer/vendor/pagantis/autoindex/index.php . || true \n'
},
composerProd: {
command: 'composer install --no-dev'
},
composerDev: {
command: 'composer install --ignore-platform-reqs'
},
runTestPrestashop17: {
command:
'docker-compose down\n' +
'docker-compose up -d selenium\n' +
'docker-compose up -d prestashop17-test\n' +
'echo "Creating the prestashop17-test"\n' +
'sleep 100\n' +
'date\n' +
'docker-compose logs prestashop17-test\n' +
'set -e\n' +
'vendor/bin/phpunit --group prestashop17basic\n' +
'vendor/bin/phpunit --group prestashop17install\n' +
'vendor/bin/phpunit --group prestashop17register\n' +
'vendor/bin/phpunit --group prestashop17buy\n' +
'vendor/bin/phpunit --group prestashop17advanced\n' +
'vendor/bin/phpunit --group prestashop17validate\n' +
'vendor/bin/phpunit --group prestashop17controller\n'
},
runTestPrestashop16: {
command:
'docker-compose down\n' +
'docker-compose up -d selenium\n' +
'docker-compose up -d prestashop16-test\n' +
'echo "Creating the prestashop16-test"\n' +
'sleep 90\n' +
'date\n' +
'docker-compose logs prestashop16-test\n' +
'set -e\n' +
'vendor/bin/phpunit --group prestashop16basic\n' +
'vendor/bin/phpunit --group prestashop16install\n' +
'vendor/bin/phpunit --group prestashop16register\n' +
'vendor/bin/phpunit --group prestashop16buy\n' +
'vendor/bin/phpunit --group prestashop16advanced\n' +
'vendor/bin/phpunit --group prestashop16validate\n' +
'vendor/bin/phpunit --group prestashop16controller\n'
},
runTestPrestashop15: {
command:
'docker-compose down\n' +
'docker-compose up -d selenium\n' +
'docker-compose up -d prestashop15-test\n' +
'echo "Creating the prestashop15-test"\n' +
'sleep 90\n' +
'date\n' +
'docker-compose logs prestashop15-test\n' +
'set -e\n' +
'vendor/bin/phpunit --group prestashop15basic\n' +
'vendor/bin/phpunit --group prestashop15install\n' +
'vendor/bin/phpunit --group prestashop15register\n' +
'vendor/bin/phpunit --group prestashop15buy\n' +
'vendor/bin/phpunit --group prestashop15validate\n' +
'vendor/bin/phpunit --group prestashop15controller\n'
}
},
compress: {
main: {
options: {
archive: 'pagantis.zip'
},
files: [
{src: ['controllers/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['classes/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['docs/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['override/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['logs/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['vendor/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['translations/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['upgrade/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['optionaloverride/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['oldoverride/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['sql/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['lib/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['defaultoverride/**'], dest: 'pagantis/', filter: 'isFile'},
{src: ['views/**'], dest: 'pagantis/', filter: 'isFile'},
{src: 'index.php', dest: 'pagantis/'},
{src: 'pagantis.php', dest: 'pagantis/'},
{src: 'logo.png', dest: 'pagantis/'},
{src: 'LICENSE.md', dest: 'pagantis/'},
{src: 'CONTRIBUTORS.md', dest: 'pagantis/'},
{src: 'README.md', dest: 'pagantis/'}
]
}
}
});
grunt.loadNpmTasks('grunt-shell');
grunt.loadNpmTasks('grunt-contrib-compress');
grunt.registerTask('default', [
'shell:composerProd',
'shell:autoindex',
'compress',
'shell:rename',
'shell:composerDev'
]);
//manually run the selenium test: "grunt shell:testPrestashop16"
};