archidata/.jenkinsfile

47 lines
1.0 KiB
Plaintext
Raw Normal View History

2023-01-08 17:49:20 +01:00
pipeline {
2023-01-10 00:02:11 +01:00
//agent any
agent {
docker { image 'archlinux:base-devel' }
}
2023-01-09 23:54:14 +01:00
options {
timeout(time: 30, unit: 'MINUTES')
disableConcurrentBuilds abortPrevious: true
}
triggers {
cron(env.BRANCH_NAME == 'main' || env.BRANCH_NAME == 'develop' ? '0 21 * * *' : '')
2023-01-08 21:02:52 +01:00
}
2023-01-08 17:49:20 +01:00
environment {
REGISTRY_ADDRESS = "gitea.atria-soft.org"
REGISTRY_ADDRESS_FULL = "https://${REGISTRY_ADDRESS}"
REPOSITORY_BASE_NAME = 'kangaroo-and-rabbit/archidata'
TAG_DOCKER = getEnvName(env.BRANCH_NAME)
}
stages {
stage('save-evironment') {
steps {
sh 'ls -la'
sh 'pwd'
sh 'uname -a'
sh 'printenv | sort'
//sh 'cat version.txt'
sh 'git log -n 20'
sh 'javac --version'
}
}
2023-01-09 23:54:14 +01:00
stage('(prod) Build') {
steps {
2023-01-10 00:02:11 +01:00
sh 'pacman -S jdk-openjdk maven'
2023-01-09 23:54:14 +01:00
sh 'mvn install'
}
}
2023-01-08 17:49:20 +01:00
}
}
def getEnvName(branchName) {
if("master".equals(branchName)) {
return "latest";
} else if("dev".equals(branchName)) {
return "dev";
}
return "other";
}