Switch Repo to notatio/notatio
This commit is contained in:
commit
9da51a1e6b
26 changed files with 4117 additions and 0 deletions
70
Jenkinsfile
vendored
Normal file
70
Jenkinsfile
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
pipeline {
|
||||
agent {
|
||||
label 'podman'
|
||||
}
|
||||
tools {
|
||||
go '1.21.1'
|
||||
}
|
||||
environment {
|
||||
registry = "docker.io/notatio/notatio"
|
||||
registryCredential = 'docker-hub-credentials'
|
||||
podmanImage = ''
|
||||
}
|
||||
stages {
|
||||
stage('Clone repository') {
|
||||
steps {
|
||||
git branch: 'main', credentialsId: 'codeberg-musselman-builder-jenkins', url: 'https://codeberg.org/Musselman/Notatio.git'
|
||||
}
|
||||
}
|
||||
stage('Retrieve Git tag') {
|
||||
steps {
|
||||
script {
|
||||
def tagOutput = sh(script: 'git describe --abbrev=0 --tags || true', returnStdout: true).trim()
|
||||
if (tagOutput.isEmpty() || tagOutput.equals("fatal: No names found, cannot describe anything.")) {
|
||||
TAG = 'latest' // Set a default tag if no tags are found
|
||||
echo "No tags found, using default tag: ${TAG}"
|
||||
} else {
|
||||
TAG = tagOutput
|
||||
echo "Latest tag found: ${TAG}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Build') {
|
||||
steps {
|
||||
echo 'Building..'
|
||||
sh 'go build'
|
||||
}
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
echo 'Testing..'
|
||||
echo 'No Testing to do currently..'
|
||||
}
|
||||
}
|
||||
stage('Building image') {
|
||||
steps {
|
||||
script {
|
||||
sh "podman build -t notatio ."
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Push image') {
|
||||
steps {
|
||||
script {
|
||||
withCredentials([usernamePassword(credentialsId: registryCredential, passwordVariable: 'REGISTRY_PASSWORD', usernameVariable: 'REGISTRY_USERNAME')]) {
|
||||
sh "podman login -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD docker.io"
|
||||
sh "podman push notatio $registry:${TAG}"
|
||||
sh "podman logout $registry"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Cleanup') {
|
||||
steps {
|
||||
sh "podman rmi -a -f"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue