-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
63 lines (57 loc) · 1.21 KB
/
Jenkinsfile
File metadata and controls
63 lines (57 loc) · 1.21 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
pipeline {
agent any
environment {
VITE_API_BASE_URL='http://ip-address:1200'
}
stages {
stage('Checkout code') {
steps {
git branch: 'main', changelog: false, url: 'https://github.com/kushvahasumit/Bllege.git'
}
}
stage('verify docker enviroment') {
steps {
sh '''
docker --version
docker-compose --version
'''
}
}
stage('Deploy') {
steps {
sh '''
docker-compose down
export VITE_API_BASE_URL=$VITE_API_BASE_URL
docker-compose up -d --build
'''
}
}
stage('Check containers') {
steps {
sh '''
docker ps
docker images
'''
}
}
stage('Test against container') {
steps {
sh '''
curl http://ip-address:1200
'''
}
}
}
post {
always {
// pipeline will fail with exit code 1 if steps not true
sh 'docker system prune -af || true '
}
success {
echo "Pipeline ran successfully"
}
failure {
echo "Pipeline failed"
}
}
}