From 64e4b26c8beff3f2d95a42877948079bab4ac965 Mon Sep 17 00:00:00 2001 From: Julien Cabillot Date: Sat, 14 Mar 2026 22:46:15 -0400 Subject: [PATCH] feat: add pipeline --- Jenkinsfile | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..e07fc12 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,39 @@ +pipeline { + environment { + registry = 'https://registry.hub.docker.com' + registryCredential = 'dockerhub_jcabillot' + dockerImage = 'jcabillot/nanobot' + } + + agent any + + triggers { + cron('@midnight') + } + + stages { + stage('Clone repository') { + steps{ + checkout scm + } + } + + stage('Build image') { + steps{ + sh 'git clone "https://github.com/HKUDS/nanobot.git"' + sh 'docker build --force-rm=true --no-cache=true --pull -t ${dockerImage} -f nanobot/Dockerfile nanobot/' + } + } + + stage('Deploy Image') { + steps{ + script { + withCredentials([usernamePassword(credentialsId: 'dockerhub_jcabillot', usernameVariable: 'DOCKER_USER', passwordVariable: 'DOCKER_PASS')]) { + sh 'docker login --username ${DOCKER_USER} --password ${DOCKER_PASS}' + sh 'docker push ${dockerImage}' + } + } + } + } + } +}