From 1df63fb98d380f2f39c92b9d18ffc0d28ed29c64 Mon Sep 17 00:00:00 2001 From: Nicolas Legros Date: Wed, 24 Jul 2024 16:21:30 -0400 Subject: [PATCH] feat: Removed `Jenkinsfile_FT` [UA-9065] --- Jenkinsfile_FT | 99 -------------------------------------------------- 1 file changed, 99 deletions(-) delete mode 100644 Jenkinsfile_FT diff --git a/Jenkinsfile_FT b/Jenkinsfile_FT deleted file mode 100644 index b7e44c92..00000000 --- a/Jenkinsfile_FT +++ /dev/null @@ -1,99 +0,0 @@ -#!groovy - -library( - identifier: 'jenkins-common-lib@v1.6', - retriever: modernSCM(github(credentialsId: 'github-app-dev', repository: 'jenkins-common-lib', repoOwner: 'coveo')), - changelog: false -) - -pipeline { - agent { - dockerfile { - dir 'cypress' - args '--cap-add=SYS_ADMIN' - label 'dev-us-east-1' - } - } - - parameters { - booleanParam(name: 'ONLY_SEND_SLACK_ON_FAILURE', defaultValue: true, description: 'Whether to only send a slack message on failure') - string(name: 'VERSION', defaultValue: '2', description: 'The version to test') - string(name: 'TOKEN_ID', defaultValue: 'coveo-analytics-send-to-dev-commercestore-api-key', description: 'The API Key used to push analytics') - string(name: 'ENDPOINT', defaultValue: 'https://analyticsdev.cloud.coveo.com/rest/ua', description: 'The endpoint on which to send the analytics') - choice(name: 'targetEnv', choices: ['dev', 'prd'], description: 'The target environment') - } - - environment { - CYPRESS_version = "${env.VERSION}" - CYPRESS_endpoint = "${env.ENDPOINT}" - CYPRESS_targetEnv = "${targetEnv}" - BUILD_NODE_VERSION = 'NodeJS Latest' - HOME = "${env.WORKSPACE}" - } - - options { - ansiColor('xterm') - timestamps() - disableConcurrentBuilds() - timeout(time: 45, unit: 'MINUTES') - } - - stages { - stage('Setup') { - steps { - script { - def nodeHome = tool name: env.BUILD_NODE_VERSION, type: 'nodejs' - env.PATH = "${nodeHome}/bin:${env.PATH}" - dir('cypress') { - sh 'npm install' - } - } - } - } - - stage('Test') { - steps { - dir('cypress') { - withCredentials([ - string(credentialsId: env.TOKEN_ID, variable: 'CYPRESS_token') - ]) { - sh 'rm -rf reports' - sh 'npm run cypress' - } - } - } - post { - always { - junit testResults: 'cypress/reports/*.xml' - } - failure { - archiveArtifacts(artifacts: 'cypress/screenshots/**/*.png', allowEmptyArchive: false) - } - } - } - } - - post { - always { - script { - if (!params.ONLY_SEND_SLACK_ON_FAILURE || currentBuild.result != 'SUCCESS' || (currentBuild.result == 'SUCCESS' && currentBuild.previousBuild != null && currentBuild.previousBuild.result != 'SUCCESS')) { - def color = currentBuild.result == 'SUCCESS' ? '#00FF00' : '#FF0000'; - def message = "coveo.analytics health check ${currentBuild.result} on version ${env.VERSION} [${params.targetEnv}] (<${env.BUILD_URL}|#${env.BUILD_NUMBER}>)" - notifySlack( - color: color, - message: message - ) - } - } - } - } -} - - -def notifySlack(options) { - // Cannot use `notify.sendSlackWithChannel` because it hardcodes "tokenCredentialId = "jenkinsbot" - options.channel = "#analyticsdeployments-dev"; - options.botUser = true; - options.tokenCredentialId = "slack_jenkinsbot"; - return slackSend(options); -} \ No newline at end of file