From 59c8369e409655de24daad54597ce02394ff229c Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 09:32:21 +0100 Subject: [PATCH 01/31] use my GH func action --- .github/workflows/main-build-all.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main-build-all.yaml b/.github/workflows/main-build-all.yaml index 2eaa95b..62ac130 100644 --- a/.github/workflows/main-build-all.yaml +++ b/.github/workflows/main-build-all.yaml @@ -8,19 +8,16 @@ jobs: builds: runs-on: ubuntu-latest env: - VERSION: "v1.15.1" + FUNC_VERSION: "knative-v1.16.1" steps: - name: Checkout code uses: actions/checkout@v4 - name: Install func - run: | - echo "Installing func ${{env.VERSION}}" - program_url="https://github.com/knative/func/releases/download/knative-${{env.VERSION}}/func_linux_amd64" - curl -SLO $program_url && mv func_linux_amd64 f && chmod +x f - cp f /usr/local/bin - f version - + uses: gauron99/knative-func-action@main + with: + version: ${{FUNC_VERSION}} + name: f - name: Build Functions run: | WORKDIR=$(mktemp -d) From 3e8088042c38387c0bbd2992a7d964b1167d4c9a Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 09:35:41 +0100 Subject: [PATCH 02/31] fix Signed-off-by: David Fridrich --- .github/workflows/build-all.yaml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-all.yaml b/.github/workflows/build-all.yaml index b9f0fbf..8b35b37 100644 --- a/.github/workflows/build-all.yaml +++ b/.github/workflows/build-all.yaml @@ -6,19 +6,16 @@ jobs: builds: runs-on: ubuntu-latest env: - VERSION: "v1.15.1" + FUNC_VERSION: "v1.16.1" steps: - name: Checkout code uses: actions/checkout@v4 - name: Install func - run: | - echo "Installing func ${{env.VERSION}}" - program_url="https://github.com/knative/func/releases/download/knative-${{env.VERSION}}/func_linux_amd64" - curl -SLO $program_url && mv func_linux_amd64 f && chmod +x f - cp f /usr/local/bin - f version - + uses: gauron99/knative-func-action@main + with: + version: ${{ VERSION }} + name: f - name: Build Functions run: | WORKDIR=$(mktemp -d) From 53cb75ab344b3fd9e41a639d016fb57bae5525d6 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 09:42:39 +0100 Subject: [PATCH 03/31] manual wf fix --- .github/workflows/build-all.yaml | 2 +- .github/workflows/manual-workflow.yml | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-all.yaml b/.github/workflows/build-all.yaml index 8b35b37..43a08bb 100644 --- a/.github/workflows/build-all.yaml +++ b/.github/workflows/build-all.yaml @@ -14,7 +14,7 @@ jobs: - name: Install func uses: gauron99/knative-func-action@main with: - version: ${{ VERSION }} + version: ${{ FUNC_VERSION }} name: f - name: Build Functions run: | diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index fa7e7cf..9b4b8fd 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -6,19 +6,16 @@ jobs: builds: runs-on: ubuntu-latest env: - VERSION: "v1.15.1" + FUNC_VERSION: "v1.16.1" ACTIONS_STEP_DEBUG: true steps: - name: Checkout code uses: actions/checkout@v4 - name: Install func - run: | - echo "Installing func ${{env.VERSION}}" - program_url="https://github.com/knative/func/releases/download/knative-${{env.VERSION}}/func_linux_amd64" - curl -SLO $program_url && mv func_linux_amd64 f && chmod +x f - cp f /usr/local/bin - f version + uses: gauron99/knative-func-action@main + version: ${{ FUNC_VERSION}} + name: f - name: Build Functions run: | From aef1635fb34427b33239df0b90d616328ceabc65 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 10:13:41 +0100 Subject: [PATCH 04/31] update manual --- .github/workflows/manual-workflow.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 9b4b8fd..5439f44 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -8,16 +8,19 @@ jobs: env: FUNC_VERSION: "v1.16.1" ACTIONS_STEP_DEBUG: true + ALL_LANGUAGES: "['go','python','node','rust','springboot','quarkus','typescript']" steps: - name: Checkout code uses: actions/checkout@v4 - name: Install func uses: gauron99/knative-func-action@main - version: ${{ FUNC_VERSION}} + with: + version: ${{ FUNC_VERSION }} name: f - name: Build Functions + matrix: ${{ ALL_LANGUAGES }} run: | WORKDIR=$(mktemp -d) cd $WORKDIR @@ -39,11 +42,7 @@ jobs: ls -la ${GITHUB_WORKSPACE} template=$(basename "$template_dir_abs") echo "f create $lang-$template -r=$url -l=$lang -t=$template" - if [ $lang = "python" ];then - f create $lang-$template -r "$url" - else - f create $lang-$template -r "$url" -l "$lang" -t "$template" - fi + f create $lang-$template -r "$url" -l "$lang" -t "$template" #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f done done From 8e88bdfa64e1b035fef1caf9a900b9a88e38cf7d Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 10:24:20 +0100 Subject: [PATCH 05/31] fix Signed-off-by: David Fridrich --- .github/workflows/build-all.yaml | 1 + .github/workflows/main-build-all.yaml | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-all.yaml b/.github/workflows/build-all.yaml index 43a08bb..ec50634 100644 --- a/.github/workflows/build-all.yaml +++ b/.github/workflows/build-all.yaml @@ -16,6 +16,7 @@ jobs: with: version: ${{ FUNC_VERSION }} name: f + - name: Build Functions run: | WORKDIR=$(mktemp -d) diff --git a/.github/workflows/main-build-all.yaml b/.github/workflows/main-build-all.yaml index 62ac130..d1589e9 100644 --- a/.github/workflows/main-build-all.yaml +++ b/.github/workflows/main-build-all.yaml @@ -15,9 +15,10 @@ jobs: - name: Install func uses: gauron99/knative-func-action@main - with: - version: ${{FUNC_VERSION}} - name: f + with: + version: ${{FUNC_VERSION}} + name: f + - name: Build Functions run: | WORKDIR=$(mktemp -d) From f7d3d86d40478859f0272a6333715372596727b9 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 10:34:33 +0100 Subject: [PATCH 06/31] manual update --- .github/workflows/manual-workflow.yml | 34 +++++++++++++++++++-------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 5439f44..892b3f5 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -3,12 +3,12 @@ name: Manual Flow Testing on: workflow_dispatch jobs: - builds: + prepare: runs-on: ubuntu-latest + outputs: + languages: ${{ steps.get-matrix.outputs.languages }} env: FUNC_VERSION: "v1.16.1" - ACTIONS_STEP_DEBUG: true - ALL_LANGUAGES: "['go','python','node','rust','springboot','quarkus','typescript']" steps: - name: Checkout code uses: actions/checkout@v4 @@ -16,21 +16,35 @@ jobs: - name: Install func uses: gauron99/knative-func-action@main with: - version: ${{ FUNC_VERSION }} + version: ${{ env.FUNC_VERSION }} name: f - - name: Build Functions - matrix: ${{ ALL_LANGUAGES }} + - name: Get Matrix + id: get-matrix run: | WORKDIR=$(mktemp -d) cd $WORKDIR echo "did the cd work?" pwd ## NOTE: ls -d returns absolute path - ## GITHUB_WORKSPACE is the root directory - #cycle through all languages - url="http://github.com/gauron99/func-templates" - for lang_dir_abs in $(ls -d ${GITHUB_WORKSPACE}/*/); do + ## GITHUB_WORKSPACE is the root directory + echo "TO MATRIX: $(ls -d ${GITHUB_WORKSPACE}/*/)" + echo "languages=$(ls -d ${GITHUB_WORKSPACE}/*/)" >> $GITHUB_OUTPUT + + deploy: + runs-on: ubuntu-latest + strategy: + matrix: + language: ${{ needs.prepare.outputs.languages }} + env: + ACTIONS_STEP_DEBUG: true + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Build Functions + run: | + lang=$(basename "$lang_dir_abs") echo "Building funcs in language $lang" for template_dir_abs in $(ls -d $lang_dir_abs*/); do From 4f69fbfaba1b3ffc71df262900f830dc523433a8 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 10:35:40 +0100 Subject: [PATCH 07/31] manual update --- .github/workflows/manual-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 892b3f5..e280bf4 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -41,7 +41,7 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 - + - name: Build Functions run: | From 67a175c8cbe4ee500f934e3f121c65857d71f885 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 10:47:31 +0100 Subject: [PATCH 08/31] manual wf fix --- .github/workflows/manual-workflow.yml | 38 +++++++++++++-------------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index e280bf4..608ec03 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -18,7 +18,6 @@ jobs: with: version: ${{ env.FUNC_VERSION }} name: f - - name: Get Matrix id: get-matrix run: | @@ -29,13 +28,14 @@ jobs: ## NOTE: ls -d returns absolute path ## GITHUB_WORKSPACE is the root directory echo "TO MATRIX: $(ls -d ${GITHUB_WORKSPACE}/*/)" - echo "languages=$(ls -d ${GITHUB_WORKSPACE}/*/)" >> $GITHUB_OUTPUT - + echo "languages=$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + deploy: + needs: prepare runs-on: ubuntu-latest strategy: matrix: - language: ${{ needs.prepare.outputs.languages }} + language: ${{ fromJSON(needs.prepare.outputs.languages) }} env: ACTIONS_STEP_DEBUG: true steps: @@ -44,21 +44,19 @@ jobs: - name: Build Functions run: | - - lang=$(basename "$lang_dir_abs") - echo "Building funcs in language $lang" - for template_dir_abs in $(ls -d $lang_dir_abs*/); do - echo "ls -la" - ls -la - echo "pwd" - pwd - echo "ls -la ${GITHUB_WORKSPACE}" - ls -la ${GITHUB_WORKSPACE} - template=$(basename "$template_dir_abs") - echo "f create $lang-$template -r=$url -l=$lang -t=$template" - f create $lang-$template -r "$url" -l "$lang" -t "$template" - #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f - done - done + lang=$(basename "$lang_dir_abs") + echo "Building funcs in language $lang" + for template_dir_abs in $(ls -d $lang_dir_abs*/); do + echo "ls -la" + ls -la + echo "pwd" + pwd + echo "ls -la ${GITHUB_WORKSPACE}" + ls -la ${GITHUB_WORKSPACE} + template=$(basename "$template_dir_abs") + echo "f create $lang-$template -r=$url -l=$lang -t=$template" + f create $lang-$template -r "$url" -l "$lang" -t "$template" + #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f done + From ca05b8268ac14ea5ae737497cea8e3372bff61a7 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 10:56:45 +0100 Subject: [PATCH 09/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 608ec03..e4ba6aa 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -17,7 +17,7 @@ jobs: uses: gauron99/knative-func-action@main with: version: ${{ env.FUNC_VERSION }} - name: f + name: func - name: Get Matrix id: get-matrix run: | From 8745329f5d1b39908c01b0cfee08a937fb0cee7a Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 10:59:07 +0100 Subject: [PATCH 10/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index e4ba6aa..979cb97 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -8,7 +8,7 @@ jobs: outputs: languages: ${{ steps.get-matrix.outputs.languages }} env: - FUNC_VERSION: "v1.16.1" + FUNC_VERSION: "knative-v1.16.1" steps: - name: Checkout code uses: actions/checkout@v4 From d65e9f8a8f6b7cd2e734ee3d65759e3c255f3571 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 11:06:48 +0100 Subject: [PATCH 11/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 979cb97..209bbb8 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -17,7 +17,7 @@ jobs: uses: gauron99/knative-func-action@main with: version: ${{ env.FUNC_VERSION }} - name: func + name: f - name: Get Matrix id: get-matrix run: | @@ -27,8 +27,13 @@ jobs: pwd ## NOTE: ls -d returns absolute path ## GITHUB_WORKSPACE is the root directory - echo "TO MATRIX: $(ls -d ${GITHUB_WORKSPACE}/*/)" - echo "languages=$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" >> $GITHUB_OUTPUT + languages="{\"new\":[" + languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" + languages+="]}" + + echo "TO MATRIX:$languages" + + echo languages=languages >> $GITHUB_OUTPUT deploy: needs: prepare From 7ced5376f4cb8046f7741a762e11457c7e1d8bfc Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 11:08:52 +0100 Subject: [PATCH 12/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 209bbb8..9c31b8f 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -33,7 +33,7 @@ jobs: echo "TO MATRIX:$languages" - echo languages=languages >> $GITHUB_OUTPUT + echo languages=$languages >> $GITHUB_OUTPUT deploy: needs: prepare From 0b50ee24e65b9aa7eed3671eefd3261761ad11b9 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 11:12:30 +0100 Subject: [PATCH 13/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 9c31b8f..39b78c4 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -27,10 +27,11 @@ jobs: pwd ## NOTE: ls -d returns absolute path ## GITHUB_WORKSPACE is the root directory - languages="{\"new\":[" - languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" - languages+="]}" + #languages="{\"new\":[" + #languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" + #languages+="]}" + languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" echo "TO MATRIX:$languages" echo languages=$languages >> $GITHUB_OUTPUT @@ -40,7 +41,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - language: ${{ fromJSON(needs.prepare.outputs.languages) }} + language: ${{ needs.prepare.outputs.languages }} + #language: ${{ fromJSON(needs.prepare.outputs.languages) }} env: ACTIONS_STEP_DEBUG: true steps: From 8a4610470c4903e94a4145c08fa1ce5cb17c1c53 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 11:19:16 +0100 Subject: [PATCH 14/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 39b78c4..205cf7c 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -28,10 +28,9 @@ jobs: ## NOTE: ls -d returns absolute path ## GITHUB_WORKSPACE is the root directory #languages="{\"new\":[" - #languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" + languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" #languages+="]}" - languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" echo "TO MATRIX:$languages" echo languages=$languages >> $GITHUB_OUTPUT @@ -41,8 +40,8 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - language: ${{ needs.prepare.outputs.languages }} - #language: ${{ fromJSON(needs.prepare.outputs.languages) }} + #language: ${{ needs.prepare.outputs.languages }} + language: ${{ fromJSON(needs.prepare.outputs.languages) }} env: ACTIONS_STEP_DEBUG: true steps: From 3eba6ccb825a3f826d500fd18fa00f8e51d99a3e Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 11:56:16 +0100 Subject: [PATCH 15/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 205cf7c..aff223e 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -7,6 +7,7 @@ jobs: runs-on: ubuntu-latest outputs: languages: ${{ steps.get-matrix.outputs.languages }} + language_paths: ${{ steps.get-matrix.outputs.language_paths }} env: FUNC_VERSION: "knative-v1.16.1" steps: @@ -27,12 +28,12 @@ jobs: pwd ## NOTE: ls -d returns absolute path ## GITHUB_WORKSPACE is the root directory - #languages="{\"new\":[" - languages+="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" - #languages+="]}" + language_paths="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" + languages="$(ls -d ${GITHUB_WORKSPACE}/*/ | basename | jq -R -s 'split("\n")[:-1]')" echo "TO MATRIX:$languages" + echo language_paths=$language_paths >> $GITHUB_OUTPUT echo languages=$languages >> $GITHUB_OUTPUT deploy: @@ -40,8 +41,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - #language: ${{ needs.prepare.outputs.languages }} - language: ${{ fromJSON(needs.prepare.outputs.languages) }} + language_path: ${{ fromJSON(needs.prepare.outputs.languages) }} env: ACTIONS_STEP_DEBUG: true steps: @@ -50,7 +50,7 @@ jobs: - name: Build Functions run: | - lang=$(basename "$lang_dir_abs") + lang=$(basename "${{matrix.language_path}}") echo "Building funcs in language $lang" for template_dir_abs in $(ls -d $lang_dir_abs*/); do echo "ls -la" From e29a0ce6d4cd4090e6f9780ceff4412fd1264f34 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 11:59:05 +0100 Subject: [PATCH 16/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index aff223e..ad03d8d 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -29,8 +29,8 @@ jobs: ## NOTE: ls -d returns absolute path ## GITHUB_WORKSPACE is the root directory language_paths="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" - languages="$(ls -d ${GITHUB_WORKSPACE}/*/ | basename | jq -R -s 'split("\n")[:-1]')" - + #languages="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" + languages="$(ls -d ${GITHUB_WORKSPACE}/*/ | xargs -n 1 basename | jq -R -s 'split("\n")[:-1]')" echo "TO MATRIX:$languages" echo language_paths=$language_paths >> $GITHUB_OUTPUT From 868a9295d4870fbdb253d1104f80daae1e59590c Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 12:12:58 +0100 Subject: [PATCH 17/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 38 +++++++++++++++++---------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index ad03d8d..9973560 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -6,8 +6,8 @@ jobs: prepare: runs-on: ubuntu-latest outputs: - languages: ${{ steps.get-matrix.outputs.languages }} - language_paths: ${{ steps.get-matrix.outputs.language_paths }} + languages: ${{ steps.prep-matrix.outputs.languages }} + language_paths: ${{ steps.prep-matrix.outputs.language_paths }} env: FUNC_VERSION: "knative-v1.16.1" steps: @@ -19,20 +19,15 @@ jobs: with: version: ${{ env.FUNC_VERSION }} name: f - - name: Get Matrix - id: get-matrix + - name: Prep Matrix + id: prep-matrix run: | - WORKDIR=$(mktemp -d) - cd $WORKDIR - echo "did the cd work?" - pwd ## NOTE: ls -d returns absolute path ## GITHUB_WORKSPACE is the root directory language_paths="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" - #languages="$(ls -d ${GITHUB_WORKSPACE}/*/ | jq -R -s 'split("\n")[:-1]')" languages="$(ls -d ${GITHUB_WORKSPACE}/*/ | xargs -n 1 basename | jq -R -s 'split("\n")[:-1]')" - echo "TO MATRIX:$languages" + # set output echo language_paths=$language_paths >> $GITHUB_OUTPUT echo languages=$languages >> $GITHUB_OUTPUT @@ -41,18 +36,33 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - language_path: ${{ fromJSON(needs.prepare.outputs.languages) }} + language: ${{ fromJSON(needs.prepare.outputs.languages) }} env: ACTIONS_STEP_DEBUG: true + language_paths: ${{needs.prepare.outputs.language_paths}} steps: - name: Checkout code uses: actions/checkout@v4 - name: Build Functions run: | - lang=$(basename "${{matrix.language_path}}") - echo "Building funcs in language $lang" - for template_dir_abs in $(ls -d $lang_dir_abs*/); do + echo "Current language: ${{ matrix.language }}" + + # Convert the JSON string of 'language_paths' into an array + language_paths_list=$(echo ${{ needs.prepare.outputs.language_paths }} | jq -r '.[]') + IFS=$'\n' read -d '' -ra language_paths_array <<< "$language_paths_list" + + # Find the index of the current language in the languages array + index=$(echo ${{ toJSON(matrix.language) }} | jq 'index(.)' ${{ needs.prepare.outputs.languages }}) + + # Use the index to get the corresponding value from 'language_paths' + echo "Corresponding language path: ${language_paths_array[$index]}" + + + WORKDIR=$(mktemp -d) + cd $WORKDIR + echo "Building funcs in language $language" + for template_dir_abs in $(ls -d ${{env.language_path}}*/); do echo "ls -la" ls -la echo "pwd" From eef9b143bdf20186e60f06f9cf1a5023d2571c42 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 12:16:49 +0100 Subject: [PATCH 18/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 9973560..192e93e 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -50,6 +50,7 @@ jobs: # Convert the JSON string of 'language_paths' into an array language_paths_list=$(echo ${{ needs.prepare.outputs.language_paths }} | jq -r '.[]') + echo $language_paths_list IFS=$'\n' read -d '' -ra language_paths_array <<< "$language_paths_list" # Find the index of the current language in the languages array @@ -72,7 +73,8 @@ jobs: template=$(basename "$template_dir_abs") echo "f create $lang-$template -r=$url -l=$lang -t=$template" f create $lang-$template -r "$url" -l "$lang" -t "$template" - #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f done + #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f + done From 901c6838152379bd67de2b668a4f80603381a597 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 12:17:41 +0100 Subject: [PATCH 19/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 192e93e..46e19b1 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -74,7 +74,7 @@ jobs: echo "f create $lang-$template -r=$url -l=$lang -t=$template" f create $lang-$template -r "$url" -l "$lang" -t "$template" #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f - done + done From 63095b0b8f2ecdfa20c2a835e17f5b75ec04ceee Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 12:24:04 +0100 Subject: [PATCH 20/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 46e19b1..ba45b67 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -49,12 +49,9 @@ jobs: echo "Current language: ${{ matrix.language }}" # Convert the JSON string of 'language_paths' into an array - language_paths_list=$(echo ${{ needs.prepare.outputs.language_paths }} | jq -r '.[]') + language_paths_list=$(echo ${{ needs.prepare.outputs.language_paths }} | jq -c '.[]') echo $language_paths_list IFS=$'\n' read -d '' -ra language_paths_array <<< "$language_paths_list" - - # Find the index of the current language in the languages array - index=$(echo ${{ toJSON(matrix.language) }} | jq 'index(.)' ${{ needs.prepare.outputs.languages }}) # Use the index to get the corresponding value from 'language_paths' echo "Corresponding language path: ${language_paths_array[$index]}" @@ -74,7 +71,4 @@ jobs: echo "f create $lang-$template -r=$url -l=$lang -t=$template" f create $lang-$template -r "$url" -l "$lang" -t "$template" #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f - done - - - + done \ No newline at end of file From 4ba4f40836d620c7d9d02f1925606c577b494631 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:07:56 +0100 Subject: [PATCH 21/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index ba45b67..8093c01 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -48,11 +48,7 @@ jobs: run: | echo "Current language: ${{ matrix.language }}" - # Convert the JSON string of 'language_paths' into an array - language_paths_list=$(echo ${{ needs.prepare.outputs.language_paths }} | jq -c '.[]') - echo $language_paths_list - IFS=$'\n' read -d '' -ra language_paths_array <<< "$language_paths_list" - + index=$(echo $language_paths | jq -r ".[] | select(contains(\"${{matrix.language}}\"))" # Use the index to get the corresponding value from 'language_paths' echo "Corresponding language path: ${language_paths_array[$index]}" From 6c24d624cba554043bdd47cbc6afaf51df2cd091 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:08:54 +0100 Subject: [PATCH 22/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 8093c01..7e14535 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -48,7 +48,7 @@ jobs: run: | echo "Current language: ${{ matrix.language }}" - index=$(echo $language_paths | jq -r ".[] | select(contains(\"${{matrix.language}}\"))" + index=$(echo $language_paths | jq -r ".[] | select(contains(\"${{matrix.language}}\"))") # Use the index to get the corresponding value from 'language_paths' echo "Corresponding language path: ${language_paths_array[$index]}" From 1b839957c8e48d6a92cdac9161f673d780dd8bd5 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:12:20 +0100 Subject: [PATCH 23/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 7e14535..b92679d 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -50,12 +50,12 @@ jobs: index=$(echo $language_paths | jq -r ".[] | select(contains(\"${{matrix.language}}\"))") # Use the index to get the corresponding value from 'language_paths' - echo "Corresponding language path: ${language_paths_array[$index]}" + echo "Corresponding language path: $index" WORKDIR=$(mktemp -d) cd $WORKDIR - echo "Building funcs in language $language" + echo "Building funcs in language ${{matrix.language}}" for template_dir_abs in $(ls -d ${{env.language_path}}*/); do echo "ls -la" ls -la From 95a1230cd249682c4d78b8aecdf2522e3a69ebcd Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:13:51 +0100 Subject: [PATCH 24/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index b92679d..1dfef9a 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -52,7 +52,8 @@ jobs: # Use the index to get the corresponding value from 'language_paths' echo "Corresponding language path: $index" - + ls -lR $index + WORKDIR=$(mktemp -d) cd $WORKDIR echo "Building funcs in language ${{matrix.language}}" From 90fbc33db74fcb3a665365156ad799e217f6c399 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:16:27 +0100 Subject: [PATCH 25/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 1dfef9a..464530d 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -48,16 +48,15 @@ jobs: run: | echo "Current language: ${{ matrix.language }}" - index=$(echo $language_paths | jq -r ".[] | select(contains(\"${{matrix.language}}\"))") + language_path=$(echo ${{env.language_paths}} | jq -r ".[] | select(contains(\"${{matrix.language}}\"))") # Use the index to get the corresponding value from 'language_paths' - echo "Corresponding language path: $index" + echo "Corresponding language path: $language_path" + ls -laR $language_path - ls -lR $index - WORKDIR=$(mktemp -d) cd $WORKDIR echo "Building funcs in language ${{matrix.language}}" - for template_dir_abs in $(ls -d ${{env.language_path}}*/); do + for template_dir_abs in $(ls -d $language_path*/); do echo "ls -la" ls -la echo "pwd" From 300a80e56bea2767cb297ddb2f02c6b1b5a53862 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:18:37 +0100 Subject: [PATCH 26/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 464530d..3c309d4 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -48,7 +48,7 @@ jobs: run: | echo "Current language: ${{ matrix.language }}" - language_path=$(echo ${{env.language_paths}} | jq -r ".[] | select(contains(\"${{matrix.language}}\"))") + language_path=$(echo '${{env.language_paths}}' | jq -r ".[] | select(contains(\"${{matrix.language}}\"))") # Use the index to get the corresponding value from 'language_paths' echo "Corresponding language path: $language_path" ls -laR $language_path From f6278f0b115267c8522fa46b096ca6fdd0f5f9bd Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:23:23 +0100 Subject: [PATCH 27/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 3c309d4..96c8ba4 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -47,24 +47,21 @@ jobs: - name: Build Functions run: | echo "Current language: ${{ matrix.language }}" - + + # This takes the array of paths, wraps it in single quotes for jq, then + # selects only the value that matches with language to get current + # language AND its full path (where the func template is) language_path=$(echo '${{env.language_paths}}' | jq -r ".[] | select(contains(\"${{matrix.language}}\"))") - # Use the index to get the corresponding value from 'language_paths' - echo "Corresponding language path: $language_path" - ls -laR $language_path - + + url="https://github.com/gauron99/func-templates" WORKDIR=$(mktemp -d) cd $WORKDIR echo "Building funcs in language ${{matrix.language}}" for template_dir_abs in $(ls -d $language_path*/); do - echo "ls -la" - ls -la - echo "pwd" - pwd echo "ls -la ${GITHUB_WORKSPACE}" ls -la ${GITHUB_WORKSPACE} template=$(basename "$template_dir_abs") echo "f create $lang-$template -r=$url -l=$lang -t=$template" - f create $lang-$template -r "$url" -l "$lang" -t "$template" + f create $language-$template -r "$url" -l "$language" -t "$template" #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f done \ No newline at end of file From 67b5ebe3fac7b5d81ebc0cc3dca2f4543d89a566 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:23:38 +0100 Subject: [PATCH 28/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 96c8ba4..61c7609 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -61,7 +61,7 @@ jobs: echo "ls -la ${GITHUB_WORKSPACE}" ls -la ${GITHUB_WORKSPACE} template=$(basename "$template_dir_abs") - echo "f create $lang-$template -r=$url -l=$lang -t=$template" + echo "f create $language-$template -r=$url -l=$language -t=$template" f create $language-$template -r "$url" -l "$language" -t "$template" #FUNC_ENABLE_HOST_BUILDER=1 FUNC_BUILDER=host FUNC_CONTAINER=false FUNC_REGISTRY=docker.io/4141gauron3268 f done \ No newline at end of file From ea55244028fc1556f16483ba4d8dc2f2874f9a73 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:25:05 +0100 Subject: [PATCH 29/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index 61c7609..a635476 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -46,7 +46,8 @@ jobs: - name: Build Functions run: | - echo "Current language: ${{ matrix.language }}" + language=${{matrix.language}} + echo "Current language: $language" # This takes the array of paths, wraps it in single quotes for jq, then # selects only the value that matches with language to get current From 6d76e08bbf97e0392a1d62548a93d2737c247c90 Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:26:25 +0100 Subject: [PATCH 30/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index a635476..faf4a80 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -49,6 +49,11 @@ jobs: language=${{matrix.language}} echo "Current language: $language" + f version + which f + func version + which func + # This takes the array of paths, wraps it in single quotes for jq, then # selects only the value that matches with language to get current # language AND its full path (where the func template is) From 9e525cb6acd83336cb6c148713226d6cd54145ad Mon Sep 17 00:00:00 2001 From: David Fridrich Date: Wed, 11 Dec 2024 13:27:33 +0100 Subject: [PATCH 31/31] fix Signed-off-by: David Fridrich --- .github/workflows/manual-workflow.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/manual-workflow.yml b/.github/workflows/manual-workflow.yml index faf4a80..cbf91fa 100644 --- a/.github/workflows/manual-workflow.yml +++ b/.github/workflows/manual-workflow.yml @@ -14,11 +14,6 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - - name: Install func - uses: gauron99/knative-func-action@main - with: - version: ${{ env.FUNC_VERSION }} - name: f - name: Prep Matrix id: prep-matrix run: | @@ -44,16 +39,17 @@ jobs: - name: Checkout code uses: actions/checkout@v4 + - name: Install func + uses: gauron99/knative-func-action@main + with: + version: ${{ env.FUNC_VERSION }} + name: f + - name: Build Functions run: | language=${{matrix.language}} echo "Current language: $language" - f version - which f - func version - which func - # This takes the array of paths, wraps it in single quotes for jq, then # selects only the value that matches with language to get current # language AND its full path (where the func template is)