From 7250f162a81a9f2851cecaf25a8b92f44c2f907a Mon Sep 17 00:00:00 2001 From: Miu Razvan Date: Fri, 18 Feb 2022 14:16:34 +0200 Subject: [PATCH] Comments tests --- Jenkinsfile | 164 ++++++++++++++++++++++++++-------------------------- 1 file changed, 82 insertions(+), 82 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index c3d6dbdd..7f54b376 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -15,70 +15,70 @@ pipeline { stages { - stage('Integration tests') { - parallel { - stage('Integration with Cypress') { - when { - environment name: 'CHANGE_ID', value: '' - } - steps { - node(label: 'docker') { - script { - try { - sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg''' - sh '''docker pull eeacms/volto-project-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/volto-project-ci cypress''' - } finally { - try { - sh '''rm -rf cypress-reports cypress-results''' - sh '''mkdir -p cypress-reports cypress-results''' - sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/cypress/videos cypress-reports/''' - sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/cypress/reports cypress-results/''' - archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true - } - finally { - catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') { - junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true - } - sh script: "docker stop $BUILD_TAG-plone", returnStatus: true - sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true - sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true - } - } - } - } - } - } - - stage("Docker test build") { - when { - not { - environment name: 'CHANGE_ID', value: '' - } - not { - buildingTag() - } - environment name: 'CHANGE_TARGET', value: 'master' - } - environment { - IMAGE_NAME = BUILD_TAG.toLowerCase() - } - steps { - node(label: 'docker-host') { - script { - checkout scm - try { - dockerImage = docker.build("${IMAGE_NAME}", "--no-cache .") - } finally { - sh script: "docker rmi ${IMAGE_NAME}", returnStatus: true - } - } - } - } - } - - - } - } + // stage('Integration tests') { + // parallel { + // stage('Integration with Cypress') { + // when { + // environment name: 'CHANGE_ID', value: '' + // } + // steps { + // node(label: 'docker') { + // script { + // try { + // sh '''docker pull plone; docker run -d --name="$BUILD_TAG-plone" -e SITE="Plone" -e PROFILES="profile-plone.restapi:blocks" plone fg''' + // sh '''docker pull eeacms/volto-project-ci; docker run -i --name="$BUILD_TAG-cypress" --link $BUILD_TAG-plone:plone -e GIT_NAME=$GIT_NAME -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" eeacms/volto-project-ci cypress''' + // } finally { + // try { + // sh '''rm -rf cypress-reports cypress-results''' + // sh '''mkdir -p cypress-reports cypress-results''' + // sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/cypress/videos cypress-reports/''' + // sh '''docker cp $BUILD_TAG-cypress:/opt/frontend/my-volto-project/cypress/reports cypress-results/''' + // archiveArtifacts artifacts: 'cypress-reports/videos/*.mp4', fingerprint: true + // } + // finally { + // catchError(buildResult: 'SUCCESS', stageResult: 'SUCCESS') { + // junit testResults: 'cypress-results/**/*.xml', allowEmptyResults: true + // } + // sh script: "docker stop $BUILD_TAG-plone", returnStatus: true + // sh script: "docker rm -v $BUILD_TAG-plone", returnStatus: true + // sh script: "docker rm -v $BUILD_TAG-cypress", returnStatus: true + // } + // } + // } + // } + // } + // } + + // stage("Docker test build") { + // when { + // not { + // environment name: 'CHANGE_ID', value: '' + // } + // not { + // buildingTag() + // } + // environment name: 'CHANGE_TARGET', value: 'master' + // } + // environment { + // IMAGE_NAME = BUILD_TAG.toLowerCase() + // } + // steps { + // node(label: 'docker-host') { + // script { + // checkout scm + // try { + // dockerImage = docker.build("${IMAGE_NAME}", "--no-cache .") + // } finally { + // sh script: "docker rmi ${IMAGE_NAME}", returnStatus: true + // } + // } + // } + // } + // } + + + // } + // } stage('Pull Request') { @@ -175,24 +175,24 @@ pipeline { } } - stage('Update SonarQube Tags') { - when { - not { - environment name: 'SONARQUBE_TAG', value: '' - } - buildingTag() - } - steps{ - node(label: 'docker') { - withSonarQubeEnv('Sonarqube') { - withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GIT_TOKEN')]) { - sh '''docker pull eeacms/gitflow''' - sh '''docker run -i --rm --name="${BUILD_TAG}-sonar" -e GIT_NAME=${GIT_NAME} -e GIT_TOKEN="${GIT_TOKEN}" -e SONARQUBE_TAG=${SONARQUBE_TAG} -e SONARQUBE_TOKEN=${SONAR_AUTH_TOKEN} -e SONAR_HOST_URL=${SONAR_HOST_URL} eeacms/gitflow /update_sonarqube_tags.sh''' - } - } - } - } - } + // stage('Update SonarQube Tags') { + // when { + // not { + // environment name: 'SONARQUBE_TAG', value: '' + // } + // buildingTag() + // } + // steps{ + // node(label: 'docker') { + // withSonarQubeEnv('Sonarqube') { + // withCredentials([string(credentialsId: 'eea-jenkins-token', variable: 'GIT_TOKEN')]) { + // sh '''docker pull eeacms/gitflow''' + // sh '''docker run -i --rm --name="${BUILD_TAG}-sonar" -e GIT_NAME=${GIT_NAME} -e GIT_TOKEN="${GIT_TOKEN}" -e SONARQUBE_TAG=${SONARQUBE_TAG} -e SONARQUBE_TOKEN=${SONAR_AUTH_TOKEN} -e SONAR_HOST_URL=${SONAR_HOST_URL} eeacms/gitflow /update_sonarqube_tags.sh''' + // } + // } + // } + // } + // } }