Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with pullRequest parameter being fetched before check #697

Merged
merged 1 commit into from
May 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 28 additions & 28 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
def isHarnessChange(env, pullRequest, harnesses) {
def isHarnessChange(harnesses) {
def harnessLabels = harnesses.collect { "harness-${it}".toString() } << 'harness-all'
return !env.CHANGE_ID || pullRequest.labels.size() == 0 || harnessLabels.any { pullRequest.labels.contains(it) }
}
Expand Down Expand Up @@ -35,7 +35,7 @@ pipeline {
args '--group-add docker --entrypoint "" --volume /var/run/docker.sock:/var/run/docker.sock --volume "$HOME/.my127:/root/.my127"'
}
}
when { expression { return isHarnessChange(env, pullRequest, ['base', 'drupal8', 'wordpress']) } }
when { expression { return isHarnessChange(['base', 'drupal8', 'wordpress']) } }
stages {
stage('Prepare') {
steps {
Expand Down Expand Up @@ -73,65 +73,65 @@ pipeline {
}
stages {
stage('PHP') {
when { expression { return isHarnessChange(env, pullRequest, ['base']) } }
when { expression { return isHarnessChange(['base']) } }
steps { sh './test php static' }
}
stage('Drupal 8') {
when { expression { return isHarnessChange(env, pullRequest, ['drupal8']) } }
when { expression { return isHarnessChange(['drupal8']) } }
steps { sh './test drupal8 static' }
}
stage('Akeneo 5') {
when { expression { return isHarnessChange(env, pullRequest, ['akeneo']) } }
when { expression { return isHarnessChange(['akeneo']) } }
steps { sh './test akeneo5 static' }
}
stage('Akeneo 4') {
when { expression { return isHarnessChange(env, pullRequest, ['akeneo']) } }
when { expression { return isHarnessChange(['akeneo']) } }
steps { sh './test akeneo4 static' }
}
stage('Wordpress') {
when { expression { return isHarnessChange(env, pullRequest, ['wordpress']) } }
when { expression { return isHarnessChange(['wordpress']) } }
steps { sh './test wordpress static' }
}

stage('PHP Dynamic') {
when { expression { return isHarnessChange(env, pullRequest, ['base']) } }
when { expression { return isHarnessChange(['base']) } }
steps { sh './test php dynamic' }
}
stage('Drupal 8 Dynamic') {
when { expression { return isHarnessChange(env, pullRequest, ['drupal8']) } }
when { expression { return isHarnessChange(['drupal8']) } }
steps { sh './test drupal8 dynamic' }
}
stage('Akeneo 5 Dynamic') {
when { expression { return isHarnessChange(env, pullRequest, ['akeneo']) } }
when { expression { return isHarnessChange(['akeneo']) } }
steps { sh './test akeneo5 dynamic' }
}
stage('Akeneo 4 Dynamic') {
when { expression { return isHarnessChange(env, pullRequest, ['akeneo']) } }
when { expression { return isHarnessChange(['akeneo']) } }
steps { sh './test akeneo4 dynamic' }
}
stage('Wordpress Dynamic') {
when { expression { return isHarnessChange(env, pullRequest, ['wordpress']) } }
when { expression { return isHarnessChange(['wordpress']) } }
steps { sh './test wordpress dynamic' }
}

stage('PHP Mutagen') {
when { expression { return isHarnessChange(env, pullRequest, ['base']) } }
when { expression { return isHarnessChange(['base']) } }
steps { sh './test php dynamic mutagen' }
}
stage('Drupal 8 Mutagen') {
when { expression { return isHarnessChange(env, pullRequest, ['drupal8']) } }
when { expression { return isHarnessChange(['drupal8']) } }
steps { sh './test drupal8 dynamic mutagen' }
}
stage('Akeneo 5 Mutagen') {
when { expression { return isHarnessChange(env, pullRequest, ['akeneo']) } }
when { expression { return isHarnessChange(['akeneo']) } }
steps { sh './test akeneo5 dynamic mutagen' }
}
stage('Akeneo 4 Dynamic Mutagen') {
when { expression { return isHarnessChange(env, pullRequest, ['akeneo']) } }
when { expression { return isHarnessChange(['akeneo']) } }
steps { sh './test akeneo4 dynamic mutagen' }
}
stage('Wordpress Mutagen') {
when { expression { return isHarnessChange(env, pullRequest, ['wordpress']) } }
when { expression { return isHarnessChange(['wordpress']) } }
steps { sh './test wordpress dynamic mutagen' }
}
}
Expand All @@ -155,7 +155,7 @@ pipeline {
args '--group-add docker --entrypoint "" --volume /var/run/docker.sock:/var/run/docker.sock --volume "$HOME/.my127:/root/.my127"'
}
}
when { expression { return isHarnessChange(env, pullRequest, ['symfony', 'magento2', 'magento1']) } }
when { expression { return isHarnessChange(['symfony', 'magento2', 'magento1']) } }
stages {
stage('Prepare') {
steps {
Expand Down Expand Up @@ -189,41 +189,41 @@ pipeline {
}
stages {
stage('Symfony') {
when { expression { return isHarnessChange(env, pullRequest, ['symfony']) } }
when { expression { return isHarnessChange(['symfony']) } }
steps { sh './test symfony static' }
}
stage('Magento 2') {
when { expression { return isHarnessChange(env, pullRequest, ['magento2']) } }
when { expression { return isHarnessChange(['magento2']) } }
steps { sh './test magento2 static' }
}
stage('Magento 1') {
when { expression { return isHarnessChange(env, pullRequest, ['magento1']) } }
when { expression { return isHarnessChange(['magento1']) } }
steps { sh './test magento1 static' }
}

stage('Symfony Dynamic') {
when { expression { return isHarnessChange(env, pullRequest, ['symfony']) } }
when { expression { return isHarnessChange(['symfony']) } }
steps { sh './test symfony dynamic' }
}
stage('Magento 2 Dynamic') {
when { expression { return isHarnessChange(env, pullRequest, ['magento2']) } }
when { expression { return isHarnessChange(['magento2']) } }
steps { sh './test magento2 dynamic' }
}
stage('Magento 1 Dynamic') {
when { expression { return isHarnessChange(env, pullRequest, ['magento1']) } }
when { expression { return isHarnessChange(['magento1']) } }
steps { sh './test magento1 dynamic' }
}

stage('Symfony Mutagen') {
when { expression { return isHarnessChange(env, pullRequest, ['symfony']) } }
when { expression { return isHarnessChange(['symfony']) } }
steps { sh './test symfony dynamic mutagen' }
}
stage('Magento 2 Mutagen') {
when { expression { return isHarnessChange(env, pullRequest, ['magento2']) } }
when { expression { return isHarnessChange(['magento2']) } }
steps { sh './test magento2 dynamic mutagen' }
}
stage('Magento 1 Mutagen') {
when { expression { return isHarnessChange(env, pullRequest, ['magento1']) } }
when { expression { return isHarnessChange(['magento1']) } }
steps { sh './test magento1 dynamic mutagen' }
}
}
Expand All @@ -248,7 +248,7 @@ pipeline {
args '--group-add docker --entrypoint "" --volume /var/run/docker.sock:/var/run/docker.sock --volume "$HOME/.my127:/root/.my127"'
}
}
when { expression { return isHarnessChange(env, pullRequest, ['spryker']) } }
when { expression { return isHarnessChange(['spryker']) } }
stages {
stage('Prepare') {
steps {
Expand Down