Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jenkins-practice
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Muhammad Tehami
jenkins-practice
Commits
ce2a8000
Commit
ce2a8000
authored
Jan 21, 2020
by
Muhammad Tehami
💡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Jenkinsfile added
parent
89512509
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
63 additions
and
0 deletions
+63
-0
Jenkinsfile
solitaire-javascript/Jenkinsfile
+63
-0
No files found.
solitaire-javascript/Jenkinsfile
0 → 100644
View file @
ce2a8000
stage
'CI'
node
{
checkout
scm
//git 'https://gitlab.mynisum.com/mtehami/jenkins-practice.git'
dir
(
'solitaire-javascript'
)
{
// pull dependencies from npm
// on windows use: bat 'npm install'
sh
'npm install'
// stash code & dependencies to expedite subsequent testing
// and ensure same code & dependencies are used throughout the pipeline
// stash is a temporary archive
stash
name:
'everything'
,
excludes:
'test-results/**'
includes:
'**'
// test with PhantomJS for "fast" "generic" results
// on windows use: bat 'npm run test-single-run -- --browsers PhantomJS'
sh
'npm run test-single-run -- --browsers PhantomJS'
}
// archive karma test results (karma is configured to export junit xml files)
step
([
$class
:
'JUnitResultArchiver'
,
testResults:
'solitaire-javascript/test-results/**/test-results.xml'
])
}
stage
'Browser Testing'
parallel
chrome:
{
runTests
(
"Chrome"
)
},
firefox:
{
runTests
(
"Firefox"
)
}
def
runTests
(
browser
)
{
node
{
// on windows use: bat 'del /S /Q *'
sh
'rm -rf *'
unstash
'everything'
dir
(
'solitaire-javascript'
)
{
// on windows use: bat "npm run test-single-run -- --browsers ${browser}"
sh
"npm run test-single-run -- --browsers ${browser}"
}
sh
'ls'
step
([
$class
:
'JUnitResultArchiver'
,
testResults:
'test-results/**/test-results.xml'
])
}
}
stage
name:
'Deploy to staging'
,
concurrency:
1
input
'Deploy to staging?'
node
{
// write build number to index page so we can see this update
// on windows use: bat "echo '<h1>${env.BUILD_DISPLAY_NAME}</h1>' >> app/index.html"
sh
"echo '<h1>${env.BUILD_DISPLAY_NAME}</h1>' >> app/index.html"
// deploy to a docker container mapped to port 3000
// on windows use: bat 'docker-compose up -d --build'
sh
'docker-compose up -d --build'
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment