From 6a8061eb0d2c2791bc16cbfc34e7dd511d7747f1 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 18 Jul 2023 09:16:51 +0300 Subject: [PATCH 1/7] chore: use commit title as template message in dogfood --- .github/workflows/dogfood.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index 9dc2ae56c19cc..cd074ed15b5b0 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -57,21 +57,27 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - - name: Get short commit SHA - id: vars - run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + - name: "Get latest Coder binary from the server" run: | curl -fsSL "https://dev.coder.com/bin/coder-linux-amd64" -o "./coder" chmod +x "./coder" + + - name: Get Latest Commit Title + id: message + run: | + pr_title=$(git log --format=%s -n 1 ${{ github.sha }}) + echo "PR title=$pr_title" >> $GITHUB_OUTPUT + - name: "Push template" run: | - ./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION + ./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION --message=$CODER_TEMPLATE_MESSAGE env: # Consumed by Coder CLI CODER_URL: https://dev.coder.com CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }} # Template source & details CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }} - CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }} + CODER_TEMPLATE_VERSION: ${{ github.sha }} CODER_TEMPLATE_DIR: ./dogfood + CODER_TEMPLATE_MESSAGE: ${{ steps.message.output.pr_title }} From 6d269589e14de0d7c98bf0ad26ecf8c54220108a Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Tue, 18 Jul 2023 06:33:28 +0000 Subject: [PATCH 2/7] make fmt --- .github/workflows/dogfood.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index cd074ed15b5b0..e5e8779422ebb 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -57,18 +57,18 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 - + - name: "Get latest Coder binary from the server" run: | curl -fsSL "https://dev.coder.com/bin/coder-linux-amd64" -o "./coder" chmod +x "./coder" - + - name: Get Latest Commit Title id: message run: | pr_title=$(git log --format=%s -n 1 ${{ github.sha }}) echo "PR title=$pr_title" >> $GITHUB_OUTPUT - + - name: "Push template" run: | ./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION --message=$CODER_TEMPLATE_MESSAGE From 32e1cb883581f5041731f957cdd8f8dcc6abb396 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 18 Jul 2023 09:51:33 +0300 Subject: [PATCH 3/7] use shortcommit --- .github/workflows/dogfood.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index e5e8779422ebb..c1ad467ca6b59 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -62,7 +62,7 @@ jobs: run: | curl -fsSL "https://dev.coder.com/bin/coder-linux-amd64" -o "./coder" chmod +x "./coder" - + - name: Get Latest Commit Title id: message run: | @@ -78,6 +78,6 @@ jobs: CODER_SESSION_TOKEN: ${{ secrets.CODER_SESSION_TOKEN }} # Template source & details CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }} - CODER_TEMPLATE_VERSION: ${{ github.sha }} + CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }} CODER_TEMPLATE_DIR: ./dogfood CODER_TEMPLATE_MESSAGE: ${{ steps.message.output.pr_title }} From 173e7691dda893bc19f89e0485e066e3e8b11a3e Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 18 Jul 2023 09:53:14 +0300 Subject: [PATCH 4/7] Update dogfood.yaml --- .github/workflows/dogfood.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index c1ad467ca6b59..253b0a86e29ef 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -57,17 +57,19 @@ jobs: steps: - name: Checkout uses: actions/checkout@v3 + + - name: Get short commit SHA + id: vars + run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Get Latest Commit Title + id: message + run: echo "pr_title==$(git log --format=%s -n 1 ${{ github.sha }})" >> $GITHUB_OUTPUT - name: "Get latest Coder binary from the server" run: | curl -fsSL "https://dev.coder.com/bin/coder-linux-amd64" -o "./coder" chmod +x "./coder" - - - name: Get Latest Commit Title - id: message - run: | - pr_title=$(git log --format=%s -n 1 ${{ github.sha }}) - echo "PR title=$pr_title" >> $GITHUB_OUTPUT - name: "Push template" run: | From 8b9def8162c05e79f5539de324f752f35a85703a Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 18 Jul 2023 09:54:10 +0300 Subject: [PATCH 5/7] Update dogfood.yaml --- .github/workflows/dogfood.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index 253b0a86e29ef..77c80098c272c 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -51,6 +51,7 @@ jobs: tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest" cache-from: type=registry,ref=codercom/oss-dogfood:latest cache-to: type=inline + deploy_template: needs: deploy_image runs-on: ubuntu-latest @@ -82,4 +83,4 @@ jobs: CODER_TEMPLATE_NAME: ${{ secrets.CODER_TEMPLATE_NAME }} CODER_TEMPLATE_VERSION: ${{ steps.vars.outputs.sha_short }} CODER_TEMPLATE_DIR: ./dogfood - CODER_TEMPLATE_MESSAGE: ${{ steps.message.output.pr_title }} + CODER_TEMPLATE_MESSAGE: ${{ steps.message.outputs.pr_title }} From f23b7a97d363f0d2bfa09c0f4b9a6c64d0424801 Mon Sep 17 00:00:00 2001 From: Atif Ali Date: Tue, 18 Jul 2023 06:57:04 +0000 Subject: [PATCH 6/7] make fmt --- .github/workflows/dogfood.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index 77c80098c272c..5483ac2c2b06d 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -51,18 +51,18 @@ jobs: tags: "codercom/oss-dogfood:${{ steps.docker-tag-name.outputs.tag }},codercom/oss-dogfood:latest" cache-from: type=registry,ref=codercom/oss-dogfood:latest cache-to: type=inline - + deploy_template: needs: deploy_image runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 - + - name: Get short commit SHA id: vars run: echo "sha_short=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT - + - name: Get Latest Commit Title id: message run: echo "pr_title==$(git log --format=%s -n 1 ${{ github.sha }})" >> $GITHUB_OUTPUT From a5ebea054c1bbee2a45df39eb25057b24cdf8814 Mon Sep 17 00:00:00 2001 From: Muhammad Atif Ali Date: Tue, 18 Jul 2023 12:05:31 +0300 Subject: [PATCH 7/7] Update .github/workflows/dogfood.yaml Co-authored-by: Mathias Fredriksson --- .github/workflows/dogfood.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dogfood.yaml b/.github/workflows/dogfood.yaml index 5483ac2c2b06d..f1424d940a2f5 100644 --- a/.github/workflows/dogfood.yaml +++ b/.github/workflows/dogfood.yaml @@ -74,7 +74,7 @@ jobs: - name: "Push template" run: | - ./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION --message=$CODER_TEMPLATE_MESSAGE + ./coder templates push $CODER_TEMPLATE_NAME --directory $CODER_TEMPLATE_DIR --yes --name=$CODER_TEMPLATE_VERSION --message="$CODER_TEMPLATE_MESSAGE" env: # Consumed by Coder CLI CODER_URL: https://dev.coder.com