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

Create Jenkinsfile #39

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
14 changes: 14 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
pipeline {
agent any
stages {
stage ('Build') {
steps {
echo 'Running build automation'
sh 'pwd'
sh 'ls -l'
sh './gradlew build --no-daemon'
archiveArtifacts artifacts: 'dist/trainSchedule.zip'
}
}
}
}
46 changes: 19 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,41 +1,33 @@
plugins {
//inlude the nodeJS plugin to execute nodejs and npm tasks
id "com.moowork.node" version "1.2.0"
// Include the updated node plugin to execute nodejs and npm tasks
id 'com.github.node-gradle.node' version '3.2.1'
}

node {
download = true
version = "9.11.1"
npmVersion = "5.6.0"
download = true
version = '16.13.0' // Use a more recent Node.js version compatible with your application
npmVersion = '8.1.2' // Use a more recent npm version compatible with your application
}

repositories.whenObjectAdded {
if (it instanceof IvyArtifactRepository) {
metadataSources {
artifact()
}
}
}

//declare a build task
// Declare a build task
task build

//declare a task to create a zip of the app
// 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"
from('.') {
include "*"
include "bin/**"
include "data/**"
include "node_modules/**"
include "public/**"
include "routes/**"
include "views/**"
}
destinationDir(file("dist"))
baseName = "trainSchedule"
}

//declare task dependencies
// Declare task dependencies
build.dependsOn zip
zip.dependsOn npm_build
npm_build.dependsOn npm_test
Expand Down