From 7c4ff61785ca01e8761b6ca55bdb76db9cde09cd Mon Sep 17 00:00:00 2001 From: Niclas Thobaben Date: Wed, 7 Jul 2021 14:28:13 +0200 Subject: [PATCH] added Jenkinsfile --- Jenkinsfile | 28 ++++++++++++++++++++++++++++ package.json | 1 - test.json | 49 ------------------------------------------------- 3 files changed, 28 insertions(+), 50 deletions(-) create mode 100644 Jenkinsfile delete mode 100644 test.json diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 0000000..b22068c --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,28 @@ +pipeline { + agent any + environment { + NPM_REGISTRY = 'https://nexus.nclazz.de/repository/npm_releases', + NPM_CREDENTIALS = credentials('npm-publish') + NPM_MAIL = 'info@nclazz.de' + } + stages { + stage('Prepare') { + sh 'npm install -g npm-cli-login' + } + stage('Set Version') { + steps { + when { branch 'master' } + sh 'npm version patch' + sh 'git push' + } + } + stage('Deploy') { + steps { + when { tag 'v*' } + sh 'npm-cli-login -u $NPM_CREDENTIALS_USR -p $NPM_CREDENTIALS_PSW -e $NPM_MAIL -r $NPM_REGISTRY' + sh 'npm publish' + sh 'npm logout --registry=$NPM_REGISTRY' + } + } + } +} \ No newline at end of file diff --git a/package.json b/package.json index 4543f2a..6824f3d 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,6 @@ "description": "Commandline interface for generating and linting api-specs.", "main": "./bin/index.js", "bin": "./bin/index.js", - "scripts": {}, "publishConfig": { "registry": "https://nexus.nclazz.de/repository/npm_releases/" }, diff --git a/test.json b/test.json deleted file mode 100644 index 4c4cd93..0000000 --- a/test.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "name": "test", - "description": "Test.", - "info": { - "contact": { - "name": "Niclas Thobaben", - "email": "info@nclazz.de", - "url": "nclazz.de" - }, - "license": { - "name": "MIT", - "url": "https://opensource.org/licenses/MIT" - } - }, - "imports": [], - "headers": [], - "enums": {}, - "interfaces": {}, - "models": { - "healthcheck": { - "description": "A simple response indicating the health status of a service.", - "fields": [ - { - "name": "status", - "type": "string" - } - ] - } - }, - "unions": {}, - "resources": { - "healthcheck": { - "path": "/_internal_/healthcheck", - "operations": { - "method": "GET", - "path": "/healthcheck", - "description": "Simple healthcheck endpoint to test the status of the service.", - "responses": { - "200": { - "type": "healthcheck", - "description": "Get the current health status of the service." - } - } - } - } - }, - "attributes": {}, - "annotations": {} -} \ No newline at end of file