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

edited build stage #26

Open
wants to merge 59 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
a21dad3
added jenkinsfile
albanngwa Oct 25, 2024
026d435
added build stage
albanngwa Oct 26, 2024
acffd2b
Update Jenkinsfile
albanngwa Oct 26, 2024
640fbff
added test stage
albanngwa Oct 26, 2024
725bb09
edited test syntax
albanngwa Oct 26, 2024
b899c3b
added agent to test stage
albanngwa Oct 26, 2024
ca82833
added junit
albanngwa Oct 26, 2024
5e6a169
added e2e stage
albanngwa Oct 26, 2024
82bd327
added commands
albanngwa Oct 26, 2024
d73c29d
commented out build stage
albanngwa Oct 26, 2024
111f14d
added
albanngwa Oct 26, 2024
834cc01
added parallel stage
albanngwa Oct 26, 2024
8dde660
added j unit
albanngwa Oct 27, 2024
ebb5289
added e2e stage
albanngwa Oct 27, 2024
f19da5e
added correct dir
albanngwa Oct 27, 2024
fbfc1b5
added html
albanngwa Oct 27, 2024
973e85e
added html script
albanngwa Oct 27, 2024
7cc28ad
parrallel stage
albanngwa Oct 27, 2024
1ae61fb
added deploy stage
albanngwa Oct 27, 2024
7a5972a
added env variables
albanngwa Oct 27, 2024
94f525c
edited env
albanngwa Oct 27, 2024
ba82436
added credentials
albanngwa Oct 27, 2024
8222c94
add
albanngwa Oct 27, 2024
fe188a5
added a small change
albanngwa Oct 28, 2024
eeca826
ad
albanngwa Oct 28, 2024
3ae8f21
added a staging stafe
albanngwa Oct 28, 2024
f0c1df2
added files
albanngwa Oct 28, 2024
0866336
edited
albanngwa Oct 28, 2024
bd04438
imolemented site id
albanngwa Oct 30, 2024
04625bb
added a token credential
albanngwa Oct 30, 2024
4efcd89
corrected error
albanngwa Oct 30, 2024
1037696
Corrected wrong spelling
albanngwa Oct 30, 2024
290b4c0
and again
albanngwa Oct 30, 2024
5ab68f0
should work now
albanngwa Oct 30, 2024
79fbefa
added post deployment tests
albanngwa Oct 30, 2024
22c68db
w
albanngwa Oct 30, 2024
e9cb745
added a staging environment
albanngwa Oct 30, 2024
229417d
added
albanngwa Oct 30, 2024
d6375f2
added site url
albanngwa Oct 30, 2024
c7f6194
d
albanngwa Oct 30, 2024
cc05819
added jenkinsfile
albanngwa Jan 29, 2025
64353a1
added build stage
albanngwa Jan 31, 2025
0c0ba04
corrected error from "npde" to "node"
albanngwa Jan 31, 2025
ed69f32
added test stage
albanngwa Jan 31, 2025
453e312
added agent to test stage
albanngwa Jan 31, 2025
f8d9b22
added a "post" stage
albanngwa Jan 31, 2025
8c64e30
commented out the build stage
albanngwa Jan 31, 2025
81ea245
added E2E stage
albanngwa Jan 31, 2025
29c5b54
added relative path to "serve"
albanngwa Jan 31, 2025
247d560
made a & change
albanngwa Jan 31, 2025
7b5f4f5
chnaged save direcrtory
albanngwa Jan 31, 2025
7d56317
made a config change
albanngwa Jan 31, 2025
f4a27be
reverted changes
albanngwa Jan 31, 2025
62cf8e8
made more config changes
albanngwa Jan 31, 2025
f6f2d02
added html reporter
albanngwa Jan 31, 2025
09a5b6a
commented in build stage
albanngwa Jan 31, 2025
609f98e
made some config changes
albanngwa Jan 31, 2025
27bf11f
made anew file
albanngwa Jan 31, 2025
18cffe8
slight change
albanngwa Jan 31, 2025
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
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM mcr.microsoft.com/playwright:v1.39.0-jammy
RUN npm install -g netlify-cli node-jq
64 changes: 64 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
pipeline {
agent any

stages {
stage('Build') {
agent {
docker {
image 'node:18-alpine'
}
}
steps {
sh '''
ls -la
node --version
npm --version
npm ci
npm run build
test -d build || { echo "Error: build directory not found"; exit 1; }
ls -la
'''
}
}

stage('Test') {
agent {
docker {
image 'node:18-alpine'
}
}
steps {
sh '''
npm ci # Ensure dependencies are installed
test -d build || mkdir build # Ensure build directory exists
npm test
'''
}
}

stage('E2E') {
agent {
docker {
image 'mcr.microsoft.com/playwright:v1.50.1-noble'
}
}
steps {
sh '''
npm install serve
nohup node_modules/.bin/serve -s build > serve.log 2>&1 &
sleep 15
curl -I http://localhost:8080 || { echo "Server failed to start"; exit 1; }
npx playwright install --with-deps
npx playwright test --reporter=junit,junit-results.xml
'''
}
}
}

post {
always {
junit 'junit-results.xml'
publishHTML([allowMissing: false, alwaysLinkToLastBuild: false, keepAll: false, reportDir: 'playwright-report', reportFiles: 'index.html', reportName: 'Playwright HTML Report'])
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"jest-junit": {
"suiteName": "jest tests",
"outputDirectory": "test-results",
"outputDirectory": "jest-results",
"outputName": "junit.xml",
"uniqueOutputName": "false",
"classNameTemplate": "{classname}-{title}",
Expand Down