forked from linuxacademy/cicd-pipeline-train-schedule-gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
47 lines (44 loc) · 1.75 KB
/
build.gradle
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
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
*/
plugins {
id("com.github.node-gradle.node") version "2.2.4"
}
node {
version = '9.11.2'
download = true
}
task build
// Create a task that is the Zip type
task zip(type: Zip) {
// Find the files at . (dot) which means "right here in the root of the directory"
from ('.') {
// Grab all of the files in the root directory, not the files AND subdirectories
// with their files, just the files sitting right in the root directory.
include "*"
// These next few lines have double asterisks, which means EVERYTHING. For each line, we want to grab the
// directory that we've named, and everything (files and subdirectories) below it in the file tree.
include "bin/**"
include "data/**"
include "node_modules/**"
include "public/**"
include "routes/**"
include "views/**"
}
// This is the destination where the zip file is going to land. We're putting it in a directory names dist,
// which is going to be a subdirectory of the root directory.
destinationDir(file("dist"))
// We're naming the zip file itself. When we're done, there should be a trainSchedule.zip sitting in the ./dist
// directory.
baseName "trainSchedule"
}
// This will make the build task call on the zip task. If zip doesn't finish, the build fails.
build.dependsOn zip
// Here, we want to make sure our zip task runs after npm_build
zip.dependsOn npm_build
build.dependsOn npm_build
npm_build.dependsOn npm_test
npm_test.dependsOn npmInstall