From c4c14e8775c2b35a28541b8d7e963afc32ecfc62 Mon Sep 17 00:00:00 2001 From: calebcartwright Date: Tue, 23 Apr 2019 19:42:48 -0500 Subject: [PATCH] chore: cleanup JenkinsBuild redirector --- .../jenkins/jenkins-build-redirect.service.js | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/services/jenkins/jenkins-build-redirect.service.js b/services/jenkins/jenkins-build-redirect.service.js index b32b9c3ccf56a..7d95eb686f882 100644 --- a/services/jenkins/jenkins-build-redirect.service.js +++ b/services/jenkins/jenkins-build-redirect.service.js @@ -2,25 +2,28 @@ const { redirector } = require('..') +const transformPath = ({ protocol, host, job }) => + `/jenkins/build/${protocol}/${host}/${job}` + +const commonProps = { + category: 'build', + transformPath, + dateAdded: new Date('2019-04-20'), +} + module.exports = [ redirector({ - category: 'build', route: { base: 'jenkins-ci/s', - pattern: ':protocol(http|https)/:host+/:job+', + pattern: ':protocol(http|https)/:host/:job+', }, - transformPath: ({ protocol, host, job }) => - `/jenkins/build/${protocol}/${host}/${job}`, - dateAdded: new Date('2019-04-20'), + ...commonProps, }), redirector({ - category: 'build', route: { base: 'jenkins/s', - pattern: ':protocol(http|https)/:host+/:job+', + pattern: ':protocol(http|https)/:host/:job+', }, - transformPath: ({ protocol, host, job }) => - `/jenkins/build/${protocol}/${host}/${job}`, - dateAdded: new Date('2019-04-20'), + ...commonProps, }), ]