Skip to content

Commit 03cb386

Browse files
committed
Merge branch 'main' into bq/insights-page
2 parents f147a4d + 7447bfa commit 03cb386

File tree

10 files changed

+45
-8
lines changed

10 files changed

+45
-8
lines changed

.github/workflows/pr-deploy.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,26 +28,29 @@ jobs:
2828
PR_NUMBER: ${{ steps.pr_number.outputs.PR_NUMBER }}
2929
PR_TITLE: ${{ steps.pr_number.outputs.PR_TITLE }}
3030
PR_URL: ${{ steps.pr_number.outputs.PR_URL }}
31+
PR_BRANCH: ${{ steps.pr_number.outputs.PR_BRANCH }}
3132
COMMENT_ID: ${{ steps.comment_id.outputs.comment-id }}
3233
CODER_BASE_IMAGE_TAG: ${{ steps.set_tags.outputs.CODER_BASE_IMAGE_TAG }}
3334
CODER_IMAGE_TAG: ${{ steps.set_tags.outputs.CODER_IMAGE_TAG }}
3435

3536
runs-on: "ubuntu-latest"
3637
steps:
37-
- name: Get PR number and title
38+
- name: Get PR number, title, and branch name
3839
id: pr_number
3940
run: |
4041
set -euxo pipefail
4142
if [[ ${{ github.event_name }} == "workflow_dispatch" ]]; then
4243
PR_NUMBER=${{ github.event.inputs.pr_number }}
43-
PR_TITLE=$(curl -sSL -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/repos/coder/coder/pulls/$PR_NUMBER" | jq -r '.title')
44+
PR_TITLE=$(gh pr view $PR_NUMBER --json title | jq -r '.title')
4445
else
4546
PR_NUMBER=${{ github.event.issue.number }}
4647
PR_TITLE='${{ github.event.issue.title }}'
4748
fi
49+
PR_BRANCH=$(gh pr view $PR_NUMBER --json headRefName | jq -r '.headRefName')
4850
echo "PR_URL=https://github.com/coder/coder/pull/$PR_NUMBER" >> $GITHUB_OUTPUT
4951
echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_OUTPUT
5052
echo "PR_TITLE=$PR_TITLE" >> $GITHUB_OUTPUT
53+
echo "PR_BRANCH=$PR_BRANCH" >> $GITHUB_OUTPUT
5154
5255
- name: Set required tags
5356
id: set_tags
@@ -85,10 +88,12 @@ jobs:
8588
DOCKER_CLI_EXPERIMENTAL: "enabled"
8689
CODER_IMAGE_TAG: ${{ needs.pr_commented.outputs.coder_image_tag }}
8790
PR_NUMBER: ${{ needs.pr_commented.outputs.pr_number }}
91+
PR_BRANCH: ${{ needs.pr_commented.outputs.pr_branch }}
8892
steps:
8993
- name: Checkout
9094
uses: actions/checkout@v3
9195
with:
96+
ref: ${{ env.PR_BRANCH }}
9297
fetch-depth: 0
9398

9499
- name: Setup Node

cli/templatecreate.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,11 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
170170
Description: "Specify a set of values for Terraform-managed variables.",
171171
Value: clibase.StringArrayOf(&variables),
172172
},
173+
{
174+
Flag: "var",
175+
Description: "Alias of --variable.",
176+
Value: clibase.StringArrayOf(&variables),
177+
},
173178
{
174179
Flag: "provisioner-tag",
175180
Description: "Specify a set of tags to target provisioner daemons.",

cli/templatepush.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,11 @@ func (r *RootCmd) templatePush() *clibase.Cmd {
291291
Description: "Specify a set of values for Terraform-managed variables.",
292292
Value: clibase.StringArrayOf(&variables),
293293
},
294+
{
295+
Flag: "var",
296+
Description: "Alias of --variable.",
297+
Value: clibase.StringArrayOf(&variables),
298+
},
294299
{
295300
Flag: "provisioner-tag",
296301
Description: "Specify a set of tags to target provisioner daemons.",

cli/testdata/coder_templates_create_--help.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ Create a template from the current directory or as specified by flag
3434
--provisioner-tag string-array
3535
Specify a set of tags to target provisioner daemons.
3636

37+
--var string-array
38+
Alias of --variable.
39+
3740
--variable string-array
3841
Specify a set of values for Terraform-managed variables.
3942

cli/testdata/coder_templates_push_--help.golden

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ Push a new template version from the current directory or as specified by flag
3232
--provisioner-tag string-array
3333
Specify a set of tags to target provisioner daemons.
3434

35+
--var string-array
36+
Alias of --variable.
37+
3538
--variable string-array
3639
Specify a set of values for Terraform-managed variables.
3740

docs/cli/templates_create.md

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/templates_push.md

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/platforms/jfrog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ provider "artifactory" {
6262
}
6363
```
6464

65-
When pushing the template, you can pass in the variables using the `--variable` flag:
65+
When pushing the template, you can pass in the variables using the `-V` flag:
6666

6767
```sh
68-
coder templates push --variable 'jfrog_url=https://YYY.jfrog.io' --variable 'artifactory_access_token=XXX'
68+
coder templates push --var 'jfrog_url=https://YYY.jfrog.io' --var 'artifactory_access_token=XXX'
6969
```
7070

7171
## Installing jf

examples/templates/envbox/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ Coder. Consult the [migration](https://coder.com/docs/v2/latest/templates/parame
3535
documentation for details on how to do so.
3636

3737
To supply values to existing existing Terraform variables you can specify the
38-
`--variable` flag. For example
38+
`-V` flag. For example
3939

4040
```bash
41-
coder templates create envbox --variable namespace="mynamespace" --variable max_cpus=2 --variable min_cpus=1 --variable max_memory=4 --variable min_memory=1
41+
coder templates create envbox --var namespace="mynamespace" --var max_cpus=2 --var min_cpus=1 --var max_memory=4 --var min_memory=1
4242
```
4343

4444
## Contributions

examples/templates/fly-docker-image/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ This template provisions a [code-server](https://github.com/coder/code-server) i
2222

2323
```bash
2424
coder templates create fly-docker-image \
25-
--variable fly_api_token=$(flyctl auth token) \
26-
--variable fly_org=personal
25+
--var fly_api_token=$(flyctl auth token) \
26+
--var fly_org=personal
2727
```
2828

2929
> If the Coder server is also running as a fly.io app, then instead of setting variable `fly_api_token` you can also set a fly.io secret with the name `FLY_API_TOKEN`

0 commit comments

Comments
 (0)