Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gradle build #89

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ Then, you can run the app with:

npm start

Once it is running, you can access it in a browser at [http://localhost:3000](http://localhost:3000)
Once it is running, you can access it in a browser at [http://localhost:3000](http://localhost:3000)

Test changes for automated build in Jenkins
47 changes: 47 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,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
Binary file added dist/trainSchedule.zip
Binary file not shown.
10 changes: 10 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/*
* This file was generated by the Gradle 'init' task.
*
* The settings file is used to specify which projects to include in your build.
*
* Detailed information about configuring a multi-project build in Gradle can be found
* in the user guide at https://docs.gradle.org/4.6/userguide/multi_project_builds.html
*/

rootProject.name = 'cicd-pipeline-train-schedule-gradle'