-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
41 lines (36 loc) · 1.15 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
pipeline {
agent {
docker {
image 'cypress/base:22.13.1'
}
}
environment {
SLACK_CHANNEL = 'jenkins-notifications'
SLACK_TOKEN = 'slack-token'
}
stages {
stage('Install Dependencies') {
steps {
sh 'npm install'
sh 'npx cypress install --force'
}
}
stage('Run E2E Tests') {
steps {
sh 'npx cypress run'
}
}
}
post {
success {
slackSend color: "#6AA84F", channel: env.SLACK_CHANNEL,
message: "✅ Os testes do sistema ${env.JOB_NAME} foram executados com sucesso! 🚀\nBuild: ${env.BUILD_NUMBER}\n🔗 Acesse: ${env.BUILD_URL}",
tokenCredentialId: env.SLACK_TOKEN
}
failure {
slackSend color: "#D9534F", channel: env.SLACK_CHANNEL,
message: "❌ Falha nos testes do sistema ${env.JOB_NAME}! ⚠️\nBuild: ${env.BUILD_NUMBER}\n🔗 Acesse: ${env.BUILD_URL} para mais detalhes.",
tokenCredentialId: env.SLACK_TOKEN
}
}
}