[12.02.20] Additional basics to the pipeline
This commit is contained in:
parent
a0ec3304b2
commit
8cc0ca1e45
@ -5,7 +5,7 @@ env.APPLICATION_LABEL = 'gateways'
|
||||
env.GIT_BRANCH = 'master'
|
||||
env.GIT_REPOSITORY_PATH = "github.com/andyjk15/${env.APPLICATION_NAME}.git"
|
||||
env.GIT_REPOSITORY_URL = "https://${env.GIT_REPOSITORY_PATH}"
|
||||
env.GITHUB_CREDENTIALS_ID = 'cryptosky-admin'
|
||||
env.GITHUB_CREDENTIALS_ID = 'Github'
|
||||
env.DOCKER_REPOSITORY = 'https://registry.cryptosky.me'
|
||||
|
||||
env.NAMESPACE = 'production'
|
||||
@ -25,17 +25,24 @@ String get_application_version() {
|
||||
"${pom.version}-b${env.BUILD_NUMBER}"
|
||||
}
|
||||
|
||||
def deploy( Integer replicas ) {
|
||||
// rollout latest
|
||||
// get rollout status
|
||||
|
||||
// set triggers
|
||||
}
|
||||
|
||||
try {
|
||||
timestamps {
|
||||
node ("${env.SLAVE_LABEL}") {
|
||||
stage('Initialise') {
|
||||
checkout([$class: 'GitSCM', branches: [[name: 'master']], doGenerateSubmoduleConfigurations: false, extensions: [], submoduleCfg: [], userRemoteConfigs: [[credentialsId: 'Github', url: 'https://github.com/andyjk15/db-gateway.git']]])
|
||||
|
||||
//git url: env.GIT_REPOSITORY_URL, branch: env.GIT_BRANCH, credentialsId: env.GITHUB_CREDENTIALS_ID
|
||||
|
||||
env.APPLICATION_VERSION = get_application_version()
|
||||
|
||||
mvn '--version'
|
||||
sh "java -version"
|
||||
sh "python3 --version"
|
||||
}
|
||||
|
||||
stage('Build Artifact') {
|
||||
@ -44,7 +51,7 @@ try {
|
||||
|
||||
stage('Test Artifact') {
|
||||
try {
|
||||
mvn 'verify'
|
||||
mvn 'verify -DskipUTs -DskipTests'
|
||||
} finally {
|
||||
mvn 'test'
|
||||
}
|
||||
@ -52,16 +59,23 @@ try {
|
||||
|
||||
stage('Build Image') {
|
||||
mvn 'clean package -DskipTests'
|
||||
|
||||
// Update build config for kubernetes
|
||||
// Update Service yaml for kubernetes
|
||||
// Update route yaml for kubernetes
|
||||
|
||||
// Run kubernetes start-build
|
||||
}
|
||||
|
||||
stage('Deploy') {
|
||||
|
||||
// Update/map secret.yaml if needed
|
||||
deploy( 1 )
|
||||
}
|
||||
|
||||
stage('Tag Repository') {
|
||||
withCredentials(
|
||||
[usernamePassword(
|
||||
credentialsId: env.BITBUCKET_CREDENTIALS_ID,
|
||||
credentialsId: env.GITHUB_CREDENTIALS_ID,
|
||||
passwordVariable: 'GIT_PASSWORD',
|
||||
usernameVariable: 'GIT_USERNAME'
|
||||
)]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user