From 5b0d36ada9061b95313fc448029f5b159627e2d0 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 17 Jan 2020 12:55:57 +0100 Subject: [PATCH] Jenkins deployment --- Jenkinsfile | 56 ++++++++++++++++++++++++++++++++++++++++ copyright.txt => LICENSE | 0 README.md | 3 +++ debian/changelog | 2 +- deploy | 5 ---- 5 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 Jenkinsfile rename copyright.txt => LICENSE (100%) create mode 100644 README.md delete mode 100755 deploy diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..23820fb --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,56 @@ +#!/usr/bin/env groovy + +pipeline { + environment { + PROJECT_NAME = 'php-vn-lib' + } + agent { + docker { + image 'registry.verdnatura.es/vn-debuild' + registryUrl 'https://registry.verdnatura.es/' + registryCredentialsId 'docker-registry' + args '-v /mnt/storage/reprepro:/reprepro' + } + } + stages { + stage('Checkout') { + steps { + sh 'printenv' + } + } + stage('Deploy') { + when { + branch 'master' + } + steps { + sh 'debuild -us -uc -b' + sh 'vn-includedeb' + } + } + } + post { + always { + script { + if (!env.GIT_COMMITTER_EMAIL) { + env.COMMITTER_EMAIL = sh( + script: 'git --no-pager show -s --format="%ae"', + returnStdout: true + ).trim() + } else { + env.COMMITTER_EMAIL = env.GIT_COMMITTER_EMAIL; + } + + if (!env.COMMITTER_EMAIL) return + try { + mail( + to: env.COMMITTER_EMAIL, + subject: "Pipeline: ${env.JOB_NAME} (${env.BUILD_NUMBER}): ${currentBuild.currentResult}", + body: "Check status at ${env.BUILD_URL}" + ) + } catch (e) { + echo e.toString() + } + } + } + } +} \ No newline at end of file diff --git a/copyright.txt b/LICENSE similarity index 100% rename from copyright.txt rename to LICENSE diff --git a/README.md b/README.md new file mode 100644 index 0000000..966160f --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# PHP utilities + +Common utilities library for PHP. diff --git a/debian/changelog b/debian/changelog index 2052c95..f5cb355 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -php-vn-lib (2.1.6) stable; urgency=low +php-vn-lib (2.1.7) stable; urgency=low * Initial Release. diff --git a/deploy b/deploy deleted file mode 100755 index 7dae519..0000000 --- a/deploy +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash -set -e - -vn-debuild -vn-deploy root@www1.static root@www2.static