From 0d609269f5116947ce809d037d04c56f2464395e Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Tue, 20 Aug 2024 23:49:22 +0100 Subject: [PATCH 1/3] add example on how to use `matrix` with env vars --- docs/guide/writing-tasks.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/docs/guide/writing-tasks.md b/docs/guide/writing-tasks.md index c07cb734..9e0cc6c1 100644 --- a/docs/guide/writing-tasks.md +++ b/docs/guide/writing-tasks.md @@ -913,6 +913,29 @@ The `matrix` modification makes it easy to create some pretty complex testing sc test_script: yarn run test ``` +Another example showing how to create 2 tasks with different environment +variables: + +```yaml +task: + name: matrixdemo + container: + image: alpine:3.20 + env: + matrix: + FIRST_VAR: foo + FIRST_VAR: bar + FIRST_VAR: baz + matrix: + SECOND_VAR: alpha + SECOND_VAR: bravo + print_script: + - echo "FIRST_VAR value is $FIRST_VAR" + - echo "SECOND_VAR value is $SECOND_VAR" +``` + +The above will generate 6 tasks. + ## Task Execution Dependencies Sometimes it might be very handy to execute some tasks only after successful execution of other tasks. For such cases From d3b2e14181b7a0c2c6413eb832022598597ebb17 Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 26 Aug 2024 17:48:17 +0100 Subject: [PATCH 2/3] add another example --- docs/guide/writing-tasks.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/docs/guide/writing-tasks.md b/docs/guide/writing-tasks.md index 9e0cc6c1..c54a628c 100644 --- a/docs/guide/writing-tasks.md +++ b/docs/guide/writing-tasks.md @@ -936,6 +936,30 @@ task: The above will generate 6 tasks. +And yet another example, showing how to granularly control the environment variables for each matrix: + +```yaml +task: + name: matrixdemo + container: + image: ubuntu:24.04 + env: + # Android Command-line tools were obtained with https://stackoverflow.com/a/78890086/7009800 + matrix: + - ANDROID_CLT_VERSION: 9123335 # v8, latest compatible with JDK 8+ + JDK_PACKAGE: openjdk-8-jdk + - ANDROID_CLT_VERSION: 9862592 # v10, latest compatible with JDK 11+ + JDK_PACKAGE: openjdk-11-jdk + - ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+ + JDK_PACKAGE: openjdk-17-jdk + - ANDROID_CLT_VERSION: 11479570 # v13, latest compatible with JDK 17+ + JDK_PACKAGE: openjdk-21-jdk + info_script: + - echo "Building Android SDK with Android Command-line tools $ANDROID_CLT_VERSION and JDK $JDK_PACKAGE" +``` + +The above will generate 4 tasks. + ## Task Execution Dependencies Sometimes it might be very handy to execute some tasks only after successful execution of other tasks. For such cases From aba304c5a71b017c712baa99c01e3d0d502e987c Mon Sep 17 00:00:00 2001 From: Bartek Pacia Date: Mon, 26 Aug 2024 18:30:23 +0100 Subject: [PATCH 3/3] .spelling: add `granularly` --- .spelling | 1 + 1 file changed, 1 insertion(+) diff --git a/.spelling b/.spelling index 5980b8ac..2e549dab 100644 --- a/.spelling +++ b/.spelling @@ -209,6 +209,7 @@ gcp.community.nat.cirrus git go-git gradle +granularly hostname i.e. iOS