mirror of
https://github.com/DarkflameUniverse/NexusDashboard.git
synced 2025-08-09 20:14:01 +00:00
Move Code into repo
This commit is contained in:
50
Jenkinsfile
vendored
Normal file
50
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,50 @@
|
||||
properties([
|
||||
parameters([
|
||||
gitParameter(
|
||||
branch: '',
|
||||
branchFilter: 'origin/(.*)',
|
||||
defaultValue: 'origin/refactor',
|
||||
description: '',
|
||||
name: 'BRANCH',
|
||||
quickFilterEnabled: false,
|
||||
selectedValue: 'NONE',
|
||||
sortMode: 'NONE',
|
||||
tagFilter: '*',
|
||||
useRepository: 'git@github.com:aronwk-aaron/AccountManager.git',
|
||||
type: 'PT_BRANCH'
|
||||
)
|
||||
])
|
||||
])
|
||||
|
||||
node('worker'){
|
||||
stage('Clone Code'){
|
||||
checkout([
|
||||
$class: 'GitSCM',
|
||||
branches: [[name: params.BRANCH]],
|
||||
extensions: [],
|
||||
userRemoteConfigs: [
|
||||
[
|
||||
credentialsId: 'aronwk',
|
||||
url: 'git@github.com:aronwk-aaron/AccountManager.git'
|
||||
]
|
||||
]
|
||||
])
|
||||
}
|
||||
def tag = ''
|
||||
stage("Build Container"){
|
||||
|
||||
if (params.BRANCH.contains('master')){
|
||||
tag = 'latest'
|
||||
} else {
|
||||
tag = params.BRANCH.replace('\\', '-')
|
||||
}
|
||||
sh "docker build -t aronwk/dlu-account_manager:${tag} ."
|
||||
}
|
||||
stage("Push Container"){
|
||||
withCredentials([usernamePassword(credentialsId: 'docker-hub-token', passwordVariable: 'password', usernameVariable: 'username')]) {
|
||||
sh "docker login -u ${username} -p ${password}"
|
||||
sh "docker push aronwk/dlu-account_manager:${tag}"
|
||||
sh 'docker logout'
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user