forked from scroll-tech/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Jenkinsfile
65 lines (57 loc) · 2.03 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
pipeline {
agent any
tools {
go 'go-1.17'
}
environment {
GO111MODULE = 'on'
}
stages {
stage('Build') {
steps {
// Get some code from a GitHub repository
// git branch: 'zkrollup',
// credentialsId: 'testgitchuhan1',
// url: '[email protected]:scroll-tech/go-ethereum.git'
// Build the app.
sh 'go build'
}
}
stage('Test') {
// Use golang.
steps {
// Remove cached test results.
sh 'go clean -cache'
// Run Unit Tests.
sh 'make test'
}
}
stage('Docker') {
environment {
// Extract the username and password of our credentials into "DOCKER_CREDENTIALS_USR" and "DOCKER_CREDENTIALS_PSW".
// (NOTE 1: DOCKER_CREDENTIALS will be set to "your_username:your_password".)
// The new variables will always be YOUR_VARIABLE_NAME + _USR and _PSW.
// (NOTE 2: You can't print credentials in the pipeline for security reasons.)
DOCKER_CREDENTIALS = credentials('dockerhub')
}
steps {
// Use a scripted pipeline.
script {
def app
// stage('Initialize') {
// def dockerHome = tool 'myDocker'
// env.PATH = "${dockerHome}/bin:${env.PATH}"
// }
stage('Build image') {
app = docker.build("${env.DOCKER_CREDENTIALS_USR}/l2geth-img")
}
}
}
}
}
post {
always {
cleanWs()
}
}
}