-
Notifications
You must be signed in to change notification settings - Fork 8
/
Jenkinsfile
50 lines (49 loc) · 1.43 KB
/
Jenkinsfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
pipeline {
agent any
stages {
stage('Pre-Build Setup') {
steps {
sh 'cp /home/waleeddevops/client-nginx.conf .'
sh 'mv docker-compose-test.yaml ./docker-compose.yaml'
sh 'mv Dockerfile.prod Dockerfile'
}
}
stage('Build for Test') {
steps {
sh 'docker-compose up -d --build'
}
}
stage('Post-Build Cleanup #1') {
steps {
sh 'yes y | docker system prune'
}
}
stage('E2E Test') {
steps {
sh 'cp -r /home/waleeddevops/Front_Test ./'
dir('Front_Test') {
sh 'npm install'
sh './node_modules/.bin/cypress install --force'
sh 'npx cypress run --spec "cypress/e2e/Sign-Up/CheckEmail.cy.js"'
}
}
}
stage('Post-Test Cleanup') {
steps {
sh 'docker-compose down --rmi'
sh 'yes y | docker system prune'
}
}
stage('Build for Deploy') {
steps {
sh 'mv docker-compose-deploy.yaml ./docker-compose.yaml'
sh 'docker-compose up -d --build'
}
}
stage('Post-Build Cleanup #2') {
steps {
sh 'yes y | docker system prune'
}
}
}
}