-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Commands are now reworked to support 'noun verb' order. Build subcommand is added, shipwright CLI is now able to create, delete and list build objects in Kubernetes. Added github actions for unit tests
- Loading branch information
Alice Rum
committed
Mar 18, 2021
1 parent
23ba9c1
commit 19ee9e4
Showing
35 changed files
with
754 additions
and
522 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: Unit Tests | ||
|
||
on: | ||
push: | ||
tags-ignore: | ||
- '**' | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
test: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ^1.16 | ||
|
||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Tools | ||
run: sudo apt-get update && sudo apt-get install -y make gcc | ||
|
||
- name: Build Application | ||
run: make build | ||
|
||
- name: Run Unit Tests | ||
run: make test |
This file was deleted.
Oops, something went wrong.
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
package build | ||
|
||
import ( | ||
"os" | ||
|
||
buildv1alpha1 "github.com/shipwright-io/build/pkg/apis/build/v1alpha1" | ||
"github.com/spf13/cobra" | ||
|
||
"k8s.io/cli-runtime/pkg/genericclioptions" | ||
|
||
"github.com/shipwright-io/cli/pkg/shp/cmd/runner" | ||
"github.com/shipwright-io/cli/pkg/shp/params" | ||
"github.com/shipwright-io/cli/pkg/shp/resource" | ||
) | ||
|
||
var ( | ||
buildResource *resource.Resource | ||
) | ||
|
||
// Command returns Build subcommand of Shipwright CLI | ||
// for interaction with shipwright builds | ||
func Command(p *params.Params) *cobra.Command { | ||
buildResource = resource.NewShpResource( | ||
p, | ||
buildv1alpha1.SchemeGroupVersion, | ||
"Build", | ||
"builds", | ||
) | ||
|
||
command := &cobra.Command{ | ||
Use: "build", | ||
Aliases: []string{"bd"}, | ||
Short: "Manage Builds", | ||
Annotations: map[string]string{ | ||
"commandType": "main", | ||
}, | ||
} | ||
|
||
streams := genericclioptions.IOStreams{ | ||
In: os.Stdin, | ||
Out: os.Stdout, | ||
ErrOut: os.Stderr, | ||
} | ||
|
||
// TODO: add support for `update` and `get` commands | ||
command.AddCommand( | ||
runner.NewRunner(p, streams, createCmd()).Cmd(), | ||
runner.NewRunner(p, streams, listCmd()).Cmd(), | ||
runner.NewRunner(p, streams, deleteCmd()).Cmd(), | ||
) | ||
return command | ||
} |
Oops, something went wrong.