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

My branch1 #58

Open
wants to merge 8 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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
node_modules
.gradle
.gradle
dist
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ This is a simple train schedule app written using nodejs. It is intended to be u

## Running the app

It is not necessary to run this app locally in order to complete the learning activities, but if you wish to do so you will need a local installation of npm. Begin by installing the npm dependencies with:
You need a Java JDK 7 or later to run the build. You can run the build like this:

npm install
./gradlew build

Then, you can run the app with:
You can run the app with:

npm start
./gradlew npm_start

Once it is running, you can access it in a browser at [http://localhost:3000](http://localhost:3000)
33 changes: 33 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
plugins {
//inlude the nodeJS plugin to execute nodejs and npm tasks
id "com.moowork.node" version "1.2.0"
}

node {
download = true
}

//declare a build task
task build

//declare a task to create a zip of the app
task zip(type: Zip) {
from ('.') {
include "*"
include "bin/**"
include "data/**"
include "node_modules/**"
include "public/**"
include "routes/**"
include "views/**"
}
destinationDir(file("dist"))
baseName "trainSchedule"
}

//declare task dependencies
build.dependsOn zip
zip.dependsOn npm_build
npm_build.dependsOn npm_test
npm_test.dependsOn npmInstall
npm_build.dependsOn npmInstall
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'
2 changes: 1 addition & 1 deletion views/index.jade
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extends layout

block content
h1 Find your train!
h1 Find your train and book your tickets!
p Select your train below to see its current schedule.
#wrapper
#trainList
Expand Down