-
Notifications
You must be signed in to change notification settings - Fork 13
/
Jenkinsfile
49 lines (44 loc) · 1.11 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
#! /usr/bin/env groovy
pipeline {
agent { label 'docker' }
environment {
// Make sure we're ignoring any override files that may be present
COMPOSE_FILE = "docker-compose.yml"
}
stages {
stage('Test') {
matrix {
agent { label 'docker' }
axes {
axis {
name 'RUBY_VERSION'
values '2.7', '3.0', '3.1', '3.2'
}
axis {
name 'LOCKFILE'
values 'activerecord-6.0', 'activerecord-6.1', 'activerecord-7.0', 'Gemfile.lock'
}
}
stages {
stage('Build') {
steps {
sh "docker compose build --pull --build-arg RUBY_VERSION=${RUBY_VERSION} --build-arg BUNDLE_LOCKFILE=${LOCKFILE} app"
sh 'docker compose run --rm app rake'
}
}
}
}
}
stage('Lint') {
steps {
sh "docker compose build --pull --build-arg BUNDLE_LOCKFILE=Gemfile.lock"
sh "docker compose run --rm app bin/rubocop"
}
}
}
post {
cleanup {
sh 'docker compose down --remove-orphans --rmi all'
}
}
}