-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
46 lines (43 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
pipeline {
agent {
docker {
args '--privileged=true --entrypoint /usr/sbin/init'
image 'yuyuko/jenkinsci-laravel-docker'
}
}
stages {
stage('InitingSystem') {
steps {
sh '''systemctl start php-fpm
systemctl start mysqld
'''
}
}
stage('initingMysql') {
steps {
sh 'mysql -e \'CREATE DATABASE IF NOT EXISTS jenkins;\''
}
}
stage('InitingENV') {
steps {
sh '''composer config -g repo.packagist composer https://packagist.phpcomposer.com
composer self-update
composer install --prefer-dist --optimize-autoloader
cp .env.jenkins .env
php artisan migrate
php artisan test:initTest'''
}
}
stage('TestingAPP') {
steps {
sh 'vendor/bin/phpunit -c phpunit.xml'
}
}
stage('PackingUP') {
steps {
sh 'tar --exclude="./public/resources" --exclude="./Vagrantfile" --exclude="./.env.travis" --exclude="./env" --exclude="./.vagrant" --exclude="./Homestead.yaml" --exclude="./.idea" --exclude="./.git" --exclude="./vendor" -cvf TouHouUC.tar ./'
archiveArtifacts(onlyIfSuccessful: true, fingerprint: true, artifacts: 'TouHouUC.tar', allowEmptyArchive: true, excludes: '--exclude="./public/resources" --exclude="./Vagrantfile" --exclude="./.env.travis" --exclude="./env" --exclude="./.vagrant" --exclude="./Homestead.yaml" --exclude="./.idea" --exclude="./.git" --exclude="./vendor" ')
}
}
}
}