mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-04-23 03:00:50 -04:00
55 lines
2.1 KiB
Plaintext
55 lines
2.1 KiB
Plaintext
imagePrefix = 'scrolltech'
|
|
credentialDocker = 'dockerhub'
|
|
|
|
pipeline {
|
|
agent any
|
|
options {
|
|
timeout (20)
|
|
}
|
|
tools {
|
|
go 'go-1.18'
|
|
nodejs "nodejs"
|
|
}
|
|
environment {
|
|
GO111MODULE = 'on'
|
|
PATH="/home/ubuntu/.cargo/bin:$PATH"
|
|
// LOG_DOCKER = 'true'
|
|
}
|
|
stages {
|
|
stage('Build') {
|
|
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 {
|
|
withCredentials([usernamePassword(credentialsId: "${credentialDocker}", passwordVariable: 'dockerPassword', usernameVariable: 'dockerUser')]) {
|
|
// Use a scripted pipeline.
|
|
script {
|
|
stage('Push image') {
|
|
sh "echo ${$TAG_NAME}"
|
|
sh "docker login --username=${dockerUser} --password=${dockerPassword}"
|
|
sh '''
|
|
make -C bridge docker
|
|
make -C coordinator docker
|
|
docker tag scrolltech/bridge:${$TAG_NAME}
|
|
docker tag scrolltech/coordinator:${$TAG_NAME}
|
|
docker push scrolltech/bridge:${$TAG_NAME}
|
|
docker push scrolltech/coordinator:${$TAG_NAME}
|
|
'''
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
post {
|
|
always {
|
|
cleanWs()
|
|
slackSend(message: "${JOB_BASE_NAME} ${GIT_COMMIT} #${$TAG_NAME} Tag build ${currentBuild.result}")
|
|
}
|
|
}
|
|
}
|