ci: reuse active app list in woodpecker
This commit is contained in:
@@ -15,7 +15,8 @@ class WoodpeckerPipelineTest {
|
||||
String pipeline = Files.readString(repositoryRoot().resolve("woodpecker.yml"));
|
||||
|
||||
assertThat(pipeline)
|
||||
.contains("ACTIVE_APPS=\"gb32960-ingest-app jt808-ingest-app yutong-mqtt-app vehicle-history-app vehicle-analytics-app\"")
|
||||
.contains("ACTIVE_APPS: &active_apps \"gb32960-ingest-app jt808-ingest-app yutong-mqtt-app vehicle-history-app vehicle-analytics-app\"")
|
||||
.contains("ACTIVE_APPS: *active_apps")
|
||||
.contains("- name: docker-build-apps")
|
||||
.doesNotContain("xinda-push-app")
|
||||
.doesNotContain("KAFKA_TOPIC_XINDA_PUSH");
|
||||
@@ -23,6 +24,18 @@ class WoodpeckerPipelineTest {
|
||||
assertThat(countOccurrences(pipeline, "- name: docker-build-")).isEqualTo(1);
|
||||
}
|
||||
|
||||
@Test
|
||||
void activeAppListIsDefinedOnceAndReusedAcrossPipelineSteps() throws IOException {
|
||||
String pipeline = Files.readString(repositoryRoot().resolve("woodpecker.yml"));
|
||||
String activeApps = "gb32960-ingest-app jt808-ingest-app yutong-mqtt-app vehicle-history-app vehicle-analytics-app";
|
||||
|
||||
assertThat(countOccurrences(pipeline, activeApps)).isEqualTo(1);
|
||||
assertThat(pipeline)
|
||||
.contains("ACTIVE_APPS: &active_apps \"" + activeApps + "\"")
|
||||
.contains("ACTIVE_APPS: *active_apps")
|
||||
.doesNotContain("ACTIVE_APPS=\"" + activeApps + "\"");
|
||||
}
|
||||
|
||||
@Test
|
||||
void dockerImageExposesOnlyCurrentProductionPorts() throws IOException {
|
||||
String dockerfile = Files.readString(repositoryRoot().resolve("Dockerfile"));
|
||||
|
||||
Reference in New Issue
Block a user