forked from neo4j-labs/llm-graph-builder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathJenkinsfile
49 lines (44 loc) · 1.75 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
@Library('podTemplateLib')
import net.santiment.utils.podTemplates
properties([
buildDiscarder(
logRotator(
artifactDaysToKeepStr: '30',
artifactNumToKeepStr: '',
daysToKeepStr: '30',
numToKeepStr: ''
)
)
])
slaveTemplates = new podTemplates()
slaveTemplates.dockerTemplate { label ->
node(label) {
stage('Build image') {
container('docker') {
def scmVars = checkout scm
sh 'docker build -t llm-graph-builder-frontend:latest frontend'
sh 'docker build -t llm-graph-builder-backend:latest backend'
}
}
stage('Push image') {
container('docker') {
if (env.BRANCH_NAME == 'master' || env.BRANCH_NAME == 'main') {
withCredentials([
string(
credentialsId: 'aws_account_id',
variable: 'aws_account_id'
)
]) {
def awsRegistry = "${env.aws_account_id}.dkr.ecr.eu-central-1.amazonaws.com"
docker.withRegistry("https://${awsRegistry}", "ecr:eu-central-1:ecr-credentials") {
sh "docker tag llm-graph-builder-frontend:latest ${awsRegistry}/llm-graph-builder-frontend:latest"
sh "docker tag llm-graph-builder-backend:latest ${awsRegistry}/llm-graph-builder-backend:latest"
sh "docker push ${awsRegistry}/llm-graph-builder-frontend:latest"
sh "docker push ${awsRegistry}/llm-graph-builder-backend:latest"
}
}
}
}
}
}
}