Skip to content

docs: add guide for CI/CD template testing #15528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Nov 20, 2024
Merged

docs: add guide for CI/CD template testing #15528

merged 8 commits into from
Nov 20, 2024

Conversation

matifali
Copy link
Member

Introduce a new tutorial outlining the process for testing and publishing
Coder templates within a CI/CD pipeline using GitHub Actions. This guide
includes prerequisites, a comprehensive workflow example, and detailed
steps for template validation and deployment.

Closes #9899

Introduce a new tutorial outlining the process for testing and publishing
Coder templates within a CI/CD pipeline using GitHub Actions. This guide
includes prerequisites, a comprehensive workflow example, and detailed
steps for template validation and deployment.
Add a new entry in the documentation's manifest for a tutorial on testing
and publishing Coder templates in a CI/CD pipeline.
Comment on lines 96 to 98
- name: Create a test workspace
run: |
coder create -t $TEMPLATE_NAME --template-version ${{ steps.name.outputs.version_name }} --yes
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also show how to test if specific conditions work inside the template (e.g. make build) or something? Like how to run example commands and ensure they run properly? The coder exp scaletest command may be useful for this.

Copy link
Member Author

@matifali matifali Nov 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

coder ssh <workspace> does not let us run the command, and coder exp scale test doesn't let you use a template not set as active.
Another approach could be to use coder config-ssh along with ssh coder.<workspace-name> -- <command to run>.

Copy link
Member

@bpmct bpmct left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would love @jatcod3r's review as this was something we were discussing lately. We could add this to our demo env

Add SSH configuration and example commands to test the workspace creation using the new template version. This ensures the template functions as expected before promotion.
@matifali matifali requested a review from jatcod3r November 18, 2024 12:34
@bpmct bpmct requested review from EdwardAngert and removed request for EdwardAngert and ethanndickson November 18, 2024 16:56
@bpmct
Copy link
Member

bpmct commented Nov 18, 2024

@jatcod3r Can you be the approver for this PR?

matifali and others added 2 commits November 19, 2024 15:40
Co-authored-by: Edward Angert <EdwardAngert@users.noreply.github.com>
Copy link
Contributor

@EdwardAngert EdwardAngert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

Clarified CLI installation instructions for pushing template versions
and linked to the GitHub Actions setup-coder for automation. Removed
redundant setup-action note and added details on creating a headless
user for CI workflows.
@matifali matifali force-pushed the atif/test-templates branch from b6d559a to fa904b2 Compare November 20, 2024 18:22
@matifali matifali requested a review from jatcod3r November 20, 2024 18:49
@matifali matifali merged commit dcbcf67 into main Nov 20, 2024
25 checks passed
@matifali matifali deleted the atif/test-templates branch November 20, 2024 18:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Area: coder.com/docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add helper script to test a template works after publish
4 participants