Skip to content
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

Improve devx of preview scripts #9758

Merged
merged 8 commits into from
May 4, 2022

Conversation

mads-hartmann
Copy link
Contributor

@mads-hartmann mads-hartmann commented May 4, 2022

Description

This PR is a collection of a few smaller changes that should improve the DevX of using our dev/preview scripts:

  • Move the scripts around so that ./dev/preview/*.sh are all scripts that are intended to be run by the user. All other scripts are moved to util and test - this makes it easier as a developer to get an overview of what "commands" are available (we really should create a go-based CLI soon)
  • Ensure all user-runnable scripts ./dev/preview/*.sh are cwd agnostic.
  • Ensure the VM_NAME can be used for all user-runnable script, e.g. VM_NAME=mads-impro9290016879 ../dev/preview/ssh-vm.sh - it will still default to the VM of the branch if you don't explicitly set VM_NAME. Using this consistently means that it's easy to access a VM that's based off another branch than the one you're on (e.g. if you want to test something on the preview environment of main).
  • Use VM_NAME for the kubectx name so it's possible to have multiple contexts installed in a workspace. This is useful for people (like me) who might use a single workspace to work on a lot of different branches.
  • Introduces a dev/preview/list-vms.sh script so it's easier to find the names of VM for when you want to use VM_NAME. E.g. dev/preview/list-vms.sh | grep mads and then VM_NAME=xyz ../dev/preview/ssh-vm.sh

Related Issue(s)

Fixes #9713

How to test

I tested all scripts in four different ways

  • with and without explicitly setting VM_NAME
    • install-k3s-kubeconfig.sh
    • ssh-vm.sh
    • port-forward-monitoring-satellite.sh
  • running them from the root or from another folder (I used .werft)
    • install-k3s-kubeconfig.sh
    • ssh-vm.sh
    • port-forward-monitoring-satellite.sh

Release Notes

NONE

Documentation

N/A

@github-actions
Copy link
Contributor

github-actions bot commented May 4, 2022

⚠️ Hey reviewer! BE CAREFUL ⚠️
Review the code before opening in your Gitpod. .gitpod.yml was changed and it might be harmful.

@mads-hartmann mads-hartmann marked this pull request as ready for review May 4, 2022 11:27
@mads-hartmann mads-hartmann requested a review from a team May 4, 2022 11:27
Copy link
Contributor

@liam-j-bennett liam-j-bennett left a comment

Choose a reason for hiding this comment

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

🛹

@roboquat roboquat merged commit 6ce82a0 into main May 4, 2022
@roboquat roboquat deleted the mads-hartmann/install-k-s-kubeconfig-9713 branch May 4, 2022 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

install-k3s-kubeconfig.sh should be agnostic to the CWD
3 participants