Full pipeline Frontend Backend - SilverSky9/DevToolNo1 GitHub Wiki
Frontend
pipeline {
agent any
stages {
stage('Pull code') {
steps {
git branch: 'dev', url: 'https://github.com/SilverSky9/DevToolNo1.git'
}
}
stage('Download dependencies') {
steps {
dir("frontend") {
sh "pwd"
sh 'ls'
sh 'npm install'
}
}
}
stage('Unit test'){
steps{
dir("frontend"){
sh 'npm run test'
}
}
}
// stage('Component test') {
// steps {
// echo 'Skip'
// // sh 'cd frontend'
// // sh 'pwd'
// // sh 'cd /var/lib/jenkins/workspace/team-10-frontend/frontend'
// // sh 'ls'
// // sh 'apt-get install xvfb'
// dir("frontend") {
// sh 'npx cypress run --record --spec cypress/integration/component-test_spec.js'
// }
// }
// }
stage('Deploy') {
steps {
echo 'Test'
}
}
}
}
Backend
pipeline {
agent any
tools {
go 'Go 1.18'
dockerTool 'Docker-compose-for-all-student-from-team10'
}
environment {
GO114MODULE = 'on'
CGO_ENABLED = 0
GOPATH = "${JENKINS_HOME}/jobs/${JOB_NAME}/builds/${BUILD_ID}"
COMPOSE_FILE = "docker-compose.yml"
}
stages {
stage('Test echo') {
steps {
echo 'test'
}
}
stage('Pull code') {
steps {
git branch: 'dev', url: 'https://github.com/SilverSky9/DevToolNo1.git'
}
}
stage('Download dependencies') {
steps {
dir("backend"){
sh 'pwd'
sh 'go mod tidy'
}
}
}
stage('Unitesting'){
steps{
dir("backend"){
sh 'go run main.go'
sh 'go test ./... -cover'
}
}
}
stage('Deployment'){
steps{
echo 'Now we skip deployment becuase we can\'t run docker '
}
}
}
}