-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJenkinsfile
More file actions
38 lines (32 loc) · 1.25 KB
/
Jenkinsfile
File metadata and controls
38 lines (32 loc) · 1.25 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
#!/usr/bin/env groovy
node('master') {
try {
stage('build') {
// Checkout the app at the given commit sha from the webhook
checkout scm
// Install dependencies, create a new .env file and generate a new key, just for testing
sh "composer install"
sh "cp .env.example .env"
sh "mysql -uroot -proot123 -e 'create database robot;'"
sh "mysql -uroot -proot123 -e 'GRANT ALL PRIVILEGES ON robot.* TO root@localhost IDENTIFIED BY "root123"';"
sh "php artisan key:generate"
sh "php artisan jwt:secret"
sh "php artisan migrate --seed"
// Run any static asset building, if needed
// sh "npm install && gulp --production"
}
stage('test') {
// Run any testing suites
sh "./vendor/bin/phpunit"
}
stage('deploy') {
// If we had ansible installed on the server, setup to run an ansible playbook
// sh "ansible-playbook -i ./ansible/hosts ./ansible/deploy.yml"
sh "echo 'WE ARE DEPLOYING'"
}
} catch(error) {
throw error
} finally {
// Any cleanup operations needed, whether we hit an error or not
}
}