Skip to content
This repository has been archived by the owner on Nov 18, 2021. It is now read-only.

Commit

Permalink
ci: fix tip triggers with proper quoting
Browse files Browse the repository at this point in the history
Change-Id: Idd7a4e784f077ea0084d0387154bb5436f143bc7
Reviewed-on: https://cue-review.googlesource.com/c/cue/+/9623
Reviewed-by: CUE cueckoo <[email protected]>
Reviewed-by: Paul Jolly <[email protected]>
  • Loading branch information
myitcv committed May 3, 2021
1 parent 746e02e commit c143a3a
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 69 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/new_version_triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
shell: bash
steps:
- name: Rebuild tip.cuelang.org
run: 'curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{"event_type": "Re-test post release of ${GITHUB_REF##refs/tags/}"}"
https://api.github.com/repos/cuelang/cuelang.org/dispatches'
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{\"event_type\": \"Re-test post release of
${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cuelang/cuelang.org/dispatches'
- name: Trigger unity build
run: 'curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{"event_type": "Check against CUE ${GITHUB_REF##refs/tags/}",
"client_payload": {"type": "unity", "payload": {"versions": "\"${GITHUB_REF##refs/tags/}\"}}}"
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\",
\"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}"
https://api.github.com/repos/cue-sh/unity/dispatches'
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
name: Update Gerrit CL message with starting message
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{
github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
GOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}
name: Post any failures for this matrix entry
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url
}}/actions/runs/${{ github.run_id }} for more details","labels":{"Code-Review":-1}}''
-b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
Expand All @@ -98,7 +98,7 @@ jobs:
- name: Write the gitcookies file
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- name: Update Gerrit CL message with success message
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id
}}","labels":{"Code-Review":1}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tip_triggers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
shell: bash
steps:
- name: Rebuild tip.cuelang.org
run: curl -s -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook
run: curl -f -s -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook
}}
- name: Trigger unity build
run: 'echo curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{"event_type": "Check against ${GITHUB_SHA}",
"client_payload": {"type": "unity", "payload": {"versions": "\"commit:${GITHUB_SHA}\""}}}"
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\",
\"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}"
https://api.github.com/repos/cue-sh/unity/dispatches'
34 changes: 17 additions & 17 deletions cmd/cue/cmd/testdata/script/cmd_github.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,13 @@ jobs:
shell: bash
steps:
- name: Rebuild tip.cuelang.org
run: 'curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{"event_type": "Re-test post release of ${GITHUB_REF##refs/tags/}"}"
https://api.github.com/repos/cuelang/cuelang.org/dispatches'
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{\"event_type\": \"Re-test post release of
${GITHUB_REF##refs/tags/}\"}" https://api.github.com/repos/cuelang/cuelang.org/dispatches'
- name: Trigger unity build
run: 'curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{"event_type": "Check against CUE ${GITHUB_REF##refs/tags/}",
"client_payload": {"type": "unity", "payload": {"versions": "\"${GITHUB_REF##refs/tags/}\"}}}"
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\",
\"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}"
https://api.github.com/repos/cue-sh/unity/dispatches'
-- .github/workflows/release.yml.golden --
# Generated by internal/ci/ci_tool.cue; do not edit
Expand Down Expand Up @@ -231,7 +231,7 @@ jobs:
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') }}
name: Update Gerrit CL message with starting message
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Started
the build... see progress at ${{ github.event.repository.html_url }}/actions/runs/${{
github.run_id }}"}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
Expand Down Expand Up @@ -294,7 +294,7 @@ jobs:
GOPROXY=https://proxy.golang.org go get -d cuelang.org/go/cmd/cue@$v
- if: ${{ startsWith(github.ref, 'refs/heads/ci/') && failure() }}
name: Post any failures for this matrix entry
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
failed for ${{ runner.os }}-${{ matrix.go-version }}; see ${{ github.event.repository.html_url
}}/actions/runs/${{ github.run_id }} for more details","labels":{"Code-Review":-1}}''
-b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
Expand All @@ -310,7 +310,7 @@ jobs:
- name: Write the gitcookies file
run: echo "${{ secrets.gerritCookie }}" > ~/.gitcookies
- name: Update Gerrit CL message with success message
run: 'curl -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
run: 'curl -f -s -H "Content-Type: application/json" --request POST --data ''{"tag":"trybot","message":"Build
succeeded for ${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id
}}","labels":{"Code-Review":1}}'' -b ~/.gitcookies https://cue-review.googlesource.com/a/changes/$(basename
$(dirname $GITHUB_REF))/revisions/$(basename $GITHUB_REF)/review'
Expand Down Expand Up @@ -346,12 +346,12 @@ jobs:
shell: bash
steps:
- name: Rebuild tip.cuelang.org
run: curl -s -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook
run: curl -f -s -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook
}}
- name: Trigger unity build
run: 'echo curl -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{"event_type": "Check against ${GITHUB_SHA}",
"client_payload": {"type": "unity", "payload": {"versions": "\"commit:${GITHUB_SHA}\""}}}"
run: 'curl -f -s -H "Content-Type: application/json" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT
}} --request POST --data-binary "{\"event_type\": \"Check against ${GITHUB_SHA}\",
\"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}"
https://api.github.com/repos/cue-sh/unity/dispatches'
-- internal/ci/ci_tool.cue --
// Copyright 2021 The CUE Authors
Expand Down Expand Up @@ -1414,7 +1414,7 @@ tip_triggers: _#bashWorkflow & {
run: "\(_#curl) -X POST -d {} https://api.netlify.com/build_hooks/${{ secrets.CuelangOrgTipRebuildHook }}"
}, {
name: "Trigger unity build"
run: "echo \(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\"event_type\": \"Check against ${GITHUB_SHA}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"commit:${GITHUB_SHA}\\\"\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches"
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Check against ${GITHUB_SHA}\\\", \\\"client_payload\\\": {\\\"type\\\": \\\"unity\\\", \\\"payload\\\": {\\\"versions\\\": \\\"\\\\\\\"commit:${GITHUB_SHA}\\\\\\\"\\\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches"
}]
}
}
Expand All @@ -1425,10 +1425,10 @@ new_version_triggers: _#bashWorkflow & {
"runs-on": _#linuxMachine
steps: [{
name: "Rebuild tip.cuelang.org"
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\"event_type\": \"Re-test post release of ${GITHUB_REF##refs/tags/}\"}\" https://api.github.com/repos/cuelang/cuelang.org/dispatches"
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Re-test post release of ${GITHUB_REF##refs/tags/}\\\"}\" https://api.github.com/repos/cuelang/cuelang.org/dispatches"
}, {
name: "Trigger unity build"
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\"event_type\": \"Check against CUE ${GITHUB_REF##refs/tags/}\", \"client_payload\": {\"type\": \"unity\", \"payload\": {\"versions\": \"\\\"${GITHUB_REF##refs/tags/}\\\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches"
run: "\(_#curl) -H \"Content-Type: application/json\" -u cueckoo:${{ secrets.CUECKOO_GITHUB_PAT }} --request POST --data-binary \"{\\\"event_type\\\": \\\"Check against CUE ${GITHUB_REF##refs/tags/}\\\", \\\"client_payload\\\": {\\\"type\\\": \\\"unity\\\", \\\"payload\\\": {\\\"versions\\\": \\\"\\\\\\\"${GITHUB_REF##refs/tags/}\\\\\\\"}}}\" https://api.github.com/repos/cue-sh/unity/dispatches"
}]
}
}
Expand Down Expand Up @@ -1559,4 +1559,4 @@ _#copybaraSteps: {
_#name: string
_#cmd: string
}
_#curl: "curl -s"
_#curl: "curl -f -s"
Loading

0 comments on commit c143a3a

Please sign in to comment.