Skip to content

Commit

Permalink
TeamCity: make unmerged apps builds noop
Browse files Browse the repository at this point in the history
(cherry picked from commit 5163d52)
  • Loading branch information
Hypnosphi committed Apr 23, 2018
1 parent 58c15c0 commit e7f22d3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,16 @@ package OpenSourceProjects_Storybook.buildTypes
import jetbrains.buildServer.configs.kotlin.v2017_2.*
import jetbrains.buildServer.configs.kotlin.v2017_2.buildFeatures.commitStatusPublisher
import jetbrains.buildServer.configs.kotlin.v2017_2.buildSteps.script
import jetbrains.buildServer.configs.kotlin.v2017_2.triggers.vcs
import jetbrains.buildServer.configs.kotlin.v2017_2.triggers.VcsTrigger
import jetbrains.buildServer.configs.kotlin.v2017_2.failureConditions.BuildFailureOnMetric
import jetbrains.buildServer.configs.kotlin.v2017_2.failureConditions.failOnMetricChange

enum class StorybookApp(val appName: String, val exampleDir: String, val branch: String? = null) {
enum class StorybookApp(val appName: String, val exampleDir: String, val merged: Boolean = true) {
CRA("CRA", "cra-kitchen-sink"),
VUE("Vue", "vue-kitchen-sink"),
ANGULAR("Angular", "angular-cli"),
POLYMER("Polymer", "polymer-cli"),
MITHRIL("Mithril", "mithril-kitchen-sink"),
HTML("HTML", "html-kitchen-sink", "pull/3475");
HTML("HTML", "html-kitchen-sink", false);

val lowerName = appName.toLowerCase()

Expand All @@ -25,14 +23,12 @@ enum class StorybookApp(val appName: String, val exampleDir: String, val branch:
id = "OpenSourceProjects_Storybook_$appName"
name = appName

if (!merged) return

artifactRules = artifactPath

vcs {
root(OpenSourceProjects_Storybook.vcsRoots.OpenSourceProjects_Storybook_HttpsGithubComStorybooksStorybookRefsHeadsMaster)

if (branch != null) {
buildDefaultBranch = false
}
}

steps {
Expand Down Expand Up @@ -70,15 +66,6 @@ enum class StorybookApp(val appName: String, val exampleDir: String, val branch:
}
}

if (branch != null) {
triggers {
vcs {
quietPeriodMode = VcsTrigger.QuietPeriodMode.USE_DEFAULT
branchFilter = "+:$branch"
}
}
}

features {
commitStatusPublisher {
publisher = github {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,13 @@ object OpenSourceProjects_Storybook_Chromatic : BuildType({

dependencies {
allApps {
if (branch == null) {
dependency(config) {
snapshot {
onDependencyCancel = FailureAction.CANCEL
}
dependency(config) {
snapshot {
onDependencyCancel = FailureAction.CANCEL
}

artifacts {
artifactRules = "$lowerName.zip!** => examples/$exampleDir/storybook-static"
}
artifacts {
artifactRules = "$lowerName.zip!** => examples/$exampleDir/storybook-static"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,14 @@ examples/official-storybook/image-snapshots/__image_snapshots__ => image-snapsho

dependencies {
allApps {
if (branch == null) {
dependency(config) {
snapshot {
onDependencyCancel = FailureAction.CANCEL
}
dependency(config) {
snapshot {
onDependencyCancel = FailureAction.CANCEL
}

artifacts {
cleanDestination = true
artifactRules = "$lowerName.zip!** => examples/$exampleDir/storybook-static"
}
artifacts {
cleanDestination = true
artifactRules = "$lowerName.zip!** => examples/$exampleDir/storybook-static"
}
}
}
Expand Down

0 comments on commit e7f22d3

Please sign in to comment.