feat: modified the code in the sub-commands #30
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Test Functionality of the Mock cli" | |
on: | |
pull_request: | |
paths: | |
- '.github/workflows/test-mock.yml' | |
- 'cli/**' | |
- 'scripts/**' | |
- 'go.mod' | |
- 'go.sum' | |
types: [ labeled ] | |
branches: [ main ] | |
push: | |
paths: | |
- 'scripts/**' | |
- 'cli/**' | |
- '.github/workflows/test-mock.yml' | |
- 'go.mod' | |
- 'go.sum' | |
branches: [ main ] | |
jobs: | |
ksctl-cli-windows: | |
if: ${{ github.event.label.name == 'pr/lgtm' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} | |
runs-on: windows-latest | |
env: | |
KSCTL_FAKE_FLAG_ENABLED: "1" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.0 | |
- name: build ksctl | |
run: | | |
cd .\scripts | |
.\builder.ps1 | |
cd C:\Users\runneradmin\AppData\Local\ksctl | |
.\ksctl.exe version | |
- name: civo create | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe create civo -n demo -r LON1 --nodeSizeMP "g4s.kube.small" --verbose -1 -s local --approve | |
.\ksctl.exe create ha-civo -n ha-demo --nodeSizeDS "fake.small" --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -s local -r LON1 --verbose -1 --approve | |
- name: azure create | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe create azure -n demo -r fake --nodeSizeMP "fake" -s local --verbose -1 --approve | |
.\ksctl.exe create ha-azure -n ha-demo --nodeSizeDS "fake" --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 -s local --approve | |
- name: local create | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe create local -n demolocal --verbose -1 -s local --approve | |
- name: civo get | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe get -s local -p civo | |
- name: azure get | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe get -s local -p azure | |
- name: get all | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe get -s local | |
- name: civo switch | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe switch -p civo -n demo -s local -r LON1 | |
.\ksctl.exe switch -p ha-civo -n ha-demo -s local -r LON1 | |
- name: azure switch | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe switch -p azure -n demo -s local -r fake | |
.\ksctl.exe switch -p ha-azure -n ha-demo -s local -r fake | |
- name: civo scale up and down | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe delete ha-civo delete-nodes -n ha-demo --noWP 0 -r LON1 -s local --approve -v -1 | |
.\ksctl.exe create ha-civo add-nodes -n ha-demo --noWP 1 --nodeSizeWP "fake.small" -s local -r LON1 -v -1 --approve | |
- name: azure scale up and down | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe delete ha-azure delete-nodes -n ha-demo --noWP 0 -r fake -s local --approve -v -1 | |
.\ksctl.exe create ha-azure add-nodes -n ha-demo --noWP 1 --nodeSizeWP "fake" -s local -r fake -v -1 --approve | |
- name: civo delete | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe delete civo -n demo -r LON1 -s local -v -1 --approve | |
.\ksctl.exe delete ha-civo -n ha-demo -r LON1 -s local -v -1 --approve | |
- name: azure delete | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe delete azure -n demo -r fake -s local -v -1 --approve | |
.\ksctl.exe delete ha-azure -n ha-demo -r fake -s local -v -1 --approve | |
- name: local delete | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe delete local -n demolocal -s local -v -1 --approve | |
- name: storage provider | |
working-directory: 'C:\Users\runneradmin\AppData\Local\ksctl' | |
run: | | |
.\ksctl.exe create local -n demolocal -s local -v -1 --approve | |
.\ksctl.exe create local -n demolocal -s external-mongo -v -1 --approve || echo "Expected to fail :) due to missing env vars" | |
.\ksctl.exe create local -n demolocal -s local123 -v -1 --approve || echo "Expected to fail :) sue to invalid provider name" | |
ksctl-cli-unix: | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest] | |
if: ${{ github.event.label.name == 'pr/lgtm' || (github.event_name == 'push' && github.ref == 'refs/heads/main') }} | |
runs-on: ${{ matrix.os }} | |
env: | |
KSCTL_FAKE_FLAG_ENABLED: "1" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v4 | |
with: | |
go-version: 1.21.0 | |
- name: build ksctl linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
make install_linux | |
ksctl version | |
- name: build ksctl macos | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: | | |
make install_macos_intel | |
ksctl version | |
- name: civo create | |
run: | | |
ksctl create civo -n demo -r LON1 --nodeSizeMP "g4s.kube.small" -s local --verbose -1 --approve | |
ksctl create ha-civo -n ha-demo --nodeSizeDS "fake.small" -s local --nodeSizeLB "fake.small" --nodeSizeCP "fake.small" --nodeSizeWP "fake.small" -r LON1 --verbose -1 --approve | |
- name: azure create | |
run: | | |
ksctl create azure -n demo -r fake --nodeSizeMP "fake" -s local --verbose -1 --approve | |
ksctl create ha-azure -n ha-demo --nodeSizeDS "fake" -s local --nodeSizeLB "fake" --nodeSizeCP "fake" --nodeSizeWP "fake" -r fake --verbose -1 --approve | |
- name: local create | |
run: | | |
ksctl create local -n demolocal -s local --verbose -1 --approve | |
- name: civo get | |
run: | | |
ksctl get -p civo -s local | |
- name: azure get | |
run: | | |
ksctl get -p azure -s local | |
- name: all | |
run: | | |
ksctl get -s local | |
- name: civo switch | |
run: | | |
ksctl switch -p civo -n demo -s local -r LON1 | |
ksctl switch -p ha-civo -n ha-demo -s local -r LON1 | |
- name: azure switch | |
run: | | |
ksctl switch -p azure -n demo -s local -r fake | |
ksctl switch -p ha-azure -n ha-demo -s local -r fake | |
- name: civo scale up and down | |
run: | | |
ksctl delete ha-civo delete-nodes -n ha-demo --noWP 0 -r LON1 -s local --approve -v -1 | |
ksctl create ha-civo add-nodes -n ha-demo --noWP 1 --nodeSizeWP "fake.small" -s local -r LON1 -v -1 --approve | |
- name: azure scale up and down | |
run: | | |
ksctl delete ha-azure delete-nodes -n ha-demo --noWP 0 -s local -r fake --approve -v -1 | |
ksctl create ha-azure add-nodes -n ha-demo --noWP 1 --nodeSizeWP "fake" -s local -r fake -v -1 --approve | |
- name: civo delete | |
run: | | |
ksctl delete civo -n demo -r LON1 -s local -v -1 --approve | |
ksctl delete ha-civo -n ha-demo -r LON1 -s local -v -1 --approve | |
- name: azure delete | |
run: | | |
ksctl delete azure -n demo -r fake -s local -v -1 --approve | |
ksctl delete ha-azure -n ha-demo -r fake -s local -v -1 --approve | |
- name: local delete | |
run: | | |
ksctl delete local -n demolocal -v -1 -s local --approve | |
- name: storage provider | |
run: | | |
ksctl create local -n demolocal -s local -v -1 --approve | |
ksctl create local -n demolocal -s external-mongo -v -1 --approve || echo "Expected to fail :) due to missing env vars" | |
ksctl create local -n demolocal -s local123 -v -1 --approve || echo "Expected to fail :) sue to invalid provider name" |