-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jenkinsfile
85 lines (73 loc) · 2.13 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
pipeline {
environment {
COSIGN_PASSWORD=credentials('cosign-password')
COSIGN_PRIVATE_KEY=credentials('cosign-private-key')
DOCKER_TOKEN=credentials('453d0ba1-373f-4dd9-897f-aab4c395a1cf')
DOCKER_CONTENT_TRUST="1"
DOCKER_CONTENT_TRUST_SERVER="https://notary.artichokenetwork.com"
}
agent {
kubernetes {
inheritFrom 'default'
}
}
stages {
stage('Clone Repository') {
agent {
kubernetes {
inheritFrom 'git'
}
}
steps {
git url: "https://github.com/Smartich0ke/FerriteCMS.git"
}
}
stage('Build') {
agent {
kubernetes {
inheritFrom 'php-tools-8.1'
}
}
steps {
sh 'composer install'
sh 'cp .env.example .env'
sh 'php artisan key:generate'
// Build assets
sh 'npm install'
sh 'npm run build'
}
}
stage('Test') {
agent {
kubernetes {
inheritFrom 'php-tools-8.1'
}
}
steps {
sh './vendor/bin/phpunit'
}
}
stage('Package') {
agent {
kubernetes {
inheritFrom 'docker'
}
}
steps {
sh 'echo "$DOCKER_TOKEN_PSW" | docker login harbor.artichokenetwork.com -u $DOCKER_TOKEN_USR --password-stdin'
sh 'docker build -t harbor.artichokenetwork.com/ferritecms/ferrite:latest .'
sh 'docker push harbor.artichokenetwork.com/ferritecms/ferrite:latest'
}
}
stage('Sign') {
agent {
kubernetes {
inheritFrom 'cosign'
}
}
steps {
sh 'cosign sign --yes --key $COSIGN_PRIVATE_KEY harbor.artichokenetwork.com/ferritecms/ferrite:latest'
}
}
}
}