Skip to content
This repository was archived by the owner on May 9, 2023. It is now read-only.

Commit f1b4328

Browse files
committed
Knative Build component removed, Knative deps latest version
1 parent 2cee6b1 commit f1b4328

40 files changed

+237
-1782
lines changed

.circleci/config.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ jobs:
2828
- run:
2929
name: Building package
3030
command: make build
31+
no_output_timeout: 20m
3132
- gcp-cli/install
3233
- gcp-cli/initialize
3334
- run:
@@ -58,6 +59,7 @@ jobs:
5859
- run:
5960
name: Running unit tests
6061
command: mkdir -p ${OUTPUT_DIR} && make test
62+
no_output_timeout: 20m
6163
environment:
6264
OUTPUT_DIR: /tmp/test-results/
6365
- store_test_results:

README.md

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,17 @@ A CLI for [knative](https://github.com/knative)
44

55
## Installation
66

7-
With a working [Golang](https://golang.org/doc/install) environment do:
7+
There are two ways of tm CLI installation:
88

9+
- Download a binary from the [latest release](https://github.com/triggermesh/tm/releases/latest)
10+
11+
- Install CLI from sources:
912
```
10-
go get github.com/triggermesh/tm
13+
git clone https://github.com/triggermesh/tm.git
14+
cd tm
15+
go install
1116
```
1217

13-
Or head to the GitHub [release page](https://github.com/triggermesh/tm/releases) and download a release.
14-
1518
### Configuration
1619

1720
**On TriggerMesh:**
@@ -31,11 +34,11 @@ Deploy service from Docker image
3134
tm deploy service foo -f gcr.io/google-samples/hello-app:1.0 --wait
3235
```
3336

34-
If you have Dockerfile for your service, you can use kaniko buildtemplate to deploy it
37+
If you have Dockerfile for your service, you can use kaniko runtime to deploy it
3538
```
3639
tm deploy service foobar \
3740
-f https://github.com/knative/docs \
38-
--build-template https://raw.githubusercontent.com/triggermesh/build-templates/master/kaniko/kaniko.yaml \
41+
--runtime https://raw.githubusercontent.com/triggermesh/knative-lambda-runtime/master/kaniko/runtime.yaml \
3942
--build-argument DIRECTORY=docs/serving/samples/hello-world/helloworld-go \
4043
--wait
4144
```
@@ -44,7 +47,7 @@ or deploy service straight from Go source using Openfaas runtime
4447
```
4548
tm deploy service bar \
4649
-f https://github.com/golang/example \
47-
--build-template https://raw.githubusercontent.com/triggermesh/openfaas-runtime/master/go/openfaas-go-runtime.yaml \
50+
--runtime https://raw.githubusercontent.com/triggermesh/openfaas-runtime/master/go/openfaas-go-runtime.yaml \
4851
--build-argument DIRECTORY=hello \
4952
--wait
5053
```
@@ -100,10 +103,10 @@ func main() {
100103
EOF
101104
```
102105

103-
Deploy function using Knative lambda buildtemplate with Go runtime
106+
Deploy function using Go Knative lambda runtime
104107

105108
```
106-
tm deploy service go-lambda -f . --build-template https://raw.githubusercontent.com/triggermesh/knative-lambda-runtime/master/go-1.x/buildtemplate.yaml --wait
109+
tm deploy service go-lambda -f . --runtime https://raw.githubusercontent.com/triggermesh/knative-lambda-runtime/master/go-1.x/runtime.yaml --wait
107110
```
108111

109112
Lambda function available via http events
@@ -177,7 +180,7 @@ Besides pulling, this secret may be used to push new images for service deployme
177180

178181
```
179182
tm deploy service foo-private -f https://github.com/serverless/examples \
180-
--build-template knative-node4-runtime \
183+
--runtime knative-node4-runtime \
181184
--build-argument DIRECTORY=aws-node-serve-dynamic-html-via-http-endpoint \
182185
--build-argument HANDLER=handler.landingPage \
183186
--registry-secret foo-registry \

cmd/cmd.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@ import (
2121
"github.com/spf13/cobra"
2222
"github.com/triggermesh/tm/pkg/client"
2323
"github.com/triggermesh/tm/pkg/generate"
24-
"github.com/triggermesh/tm/pkg/resources/build"
25-
"github.com/triggermesh/tm/pkg/resources/buildtemplate"
2624
"github.com/triggermesh/tm/pkg/resources/channel"
27-
"github.com/triggermesh/tm/pkg/resources/clusterbuildtemplate"
2825
"github.com/triggermesh/tm/pkg/resources/configuration"
2926
"github.com/triggermesh/tm/pkg/resources/credential"
3027
"github.com/triggermesh/tm/pkg/resources/pipelineresource"
@@ -50,7 +47,6 @@ var (
5047
registrySecret string
5148
registrySkipTLS bool
5249

53-
b build.Build
5450
c channel.Channel
5551
t task.Task
5652
tr taskrun.TaskRun
@@ -62,8 +58,6 @@ var (
6258
cf configuration.Configuration
6359
gc credential.GitCreds
6460
rc credential.RegistryCreds
65-
bt buildtemplate.Buildtemplate
66-
cbt clusterbuildtemplate.ClusterBuildtemplate
6761
)
6862

6963
// tmCmd represents the base command when called without any subcommands

cmd/delete.go

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ func newDeleteCmd(clientset *client.ConfigSet) *cobra.Command {
3838
deleteCmd.Flags().StringVarP(&file, "file", "f", "serverless.yaml", "Delete functions defined in yaml")
3939
deleteCmd.Flags().IntVarP(&concurrency, "concurrency", "c", 3, "Number of concurrent deletion threads")
4040
deleteCmd.AddCommand(cmdDeleteConfiguration(clientset))
41-
deleteCmd.AddCommand(cmdDeleteBuildTemplate(clientset))
4241
deleteCmd.AddCommand(cmdDeleteRevision(clientset))
4342
deleteCmd.AddCommand(cmdDeleteService(clientset))
44-
deleteCmd.AddCommand(cmdDeleteBuild(clientset))
4543
deleteCmd.AddCommand(cmdDeleteRoute(clientset))
4644
deleteCmd.AddCommand(cmdDeleteChannel(clientset))
4745
deleteCmd.AddCommand(cmdDeleteTask(clientset))
@@ -51,40 +49,6 @@ func newDeleteCmd(clientset *client.ConfigSet) *cobra.Command {
5149
return deleteCmd
5250
}
5351

54-
func cmdDeleteBuild(clientset *client.ConfigSet) *cobra.Command {
55-
return &cobra.Command{
56-
Use: "build",
57-
Aliases: []string{"builds"},
58-
Short: "Delete knative build resource",
59-
Args: cobra.ExactArgs(1),
60-
Run: func(cmd *cobra.Command, args []string) {
61-
b.Name = args[0]
62-
b.Namespace = client.Namespace
63-
if err := b.Delete(clientset); err != nil {
64-
log.Fatalln(err)
65-
}
66-
clientset.Log.Infoln("Build is being deleted")
67-
},
68-
}
69-
}
70-
71-
func cmdDeleteBuildTemplate(clientset *client.ConfigSet) *cobra.Command {
72-
return &cobra.Command{
73-
Use: "buildtemplate",
74-
Aliases: []string{"buildtemplates"},
75-
Short: "Delete knative buildtemplate resource",
76-
Args: cobra.ExactArgs(1),
77-
Run: func(cmd *cobra.Command, args []string) {
78-
bt.Name = args[0]
79-
bt.Namespace = client.Namespace
80-
if err := bt.Delete(clientset); err != nil {
81-
log.Fatalln(err)
82-
}
83-
clientset.Log.Infoln("BuildTemplate is being deleted")
84-
},
85-
}
86-
}
87-
8852
func cmdDeleteChannel(clientset *client.ConfigSet) *cobra.Command {
8953
return &cobra.Command{
9054
Use: "channel",

cmd/deploy.go

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ func newDeployCmd(clientset *client.ConfigSet) *cobra.Command {
4040

4141
deployCmd.AddCommand(cmdDeployService(clientset))
4242
deployCmd.AddCommand(cmdDeployChannel(clientset))
43-
deployCmd.AddCommand(cmdDeployBuild(clientset))
44-
deployCmd.AddCommand(cmdDeployBuildTemplate(clientset))
4543
deployCmd.AddCommand(cmdDeployTask(clientset))
4644
deployCmd.AddCommand(cmdDeployTaskRun(clientset))
4745
deployCmd.AddCommand(cmdDeployPipelineResource(clientset))
@@ -73,13 +71,10 @@ func cmdDeployService(clientset *client.ConfigSet) *cobra.Command {
7371

7472
deployServiceCmd.Flags().StringVarP(&s.Source, "from", "f", "", "Service source to deploy: local folder with sources, git repository or docker image")
7573
deployServiceCmd.Flags().StringVar(&s.Revision, "revision", "master", "Git revision (branch, tag, commit SHA or ref)")
76-
deployServiceCmd.Flags().StringVar(&s.Runtime, "runtime", "", "Existing buildtemplate name, local path or URL to buildtemplate yaml file")
77-
// deployServiceCmd.Flags().StringVar(&s.RegistrySecret, "registry-secret", "", "Name of k8s secret to use in buildtemplate as registry auth json")
78-
// deployServiceCmd.Flags().StringVar(&s.ResultImageTag, "tag", "latest", "Image tag to build")
79-
// deployServiceCmd.Flags().StringVar(&s.PullPolicy, "image-pull-policy", "Always", "Image pull policy")
74+
deployServiceCmd.Flags().StringVar(&s.Runtime, "runtime", "", "Existing task name, local path or URL to task yaml file")
8075
deployServiceCmd.Flags().StringVar(&s.BuildTimeout, "build-timeout", "10m", "Service image build timeout")
8176
deployServiceCmd.Flags().IntVar(&s.Concurrency, "concurrency", 0, "Number of concurrent events per container: 0 - multiple events, 1 - single event, N - particular number of events")
82-
deployServiceCmd.Flags().StringSliceVar(&s.BuildArgs, "build-argument", []string{}, "Buildtemplate arguments")
77+
deployServiceCmd.Flags().StringSliceVar(&s.BuildArgs, "build-argument", []string{}, "Build arguments")
8378
deployServiceCmd.Flags().StringSliceVar(&s.EnvSecrets, "env-secret", []string{}, "Name of k8s secrets to populate pod environment variables")
8479
deployServiceCmd.Flags().BoolVar(&s.BuildOnly, "build-only", false, "Build image and exit")
8580
deployServiceCmd.Flags().StringSliceVarP(&s.Labels, "label", "l", []string{}, "Service labels")
@@ -88,49 +83,6 @@ func cmdDeployService(clientset *client.ConfigSet) *cobra.Command {
8883
return deployServiceCmd
8984
}
9085

91-
func cmdDeployBuild(clientset *client.ConfigSet) *cobra.Command {
92-
deployBuildCmd := &cobra.Command{
93-
Use: "build",
94-
Aliases: []string{"builds"},
95-
Args: cobra.ExactArgs(1),
96-
Short: "Deploy knative build",
97-
Example: "tm deploy build foo-builder --source git-repo --buildtemplate kaniko --args IMAGE=knative-local-registry:5000/foo-image",
98-
Run: func(cmd *cobra.Command, args []string) {
99-
b.Name = args[0]
100-
b.Namespace = client.Namespace
101-
if _, err := b.Deploy(clientset); err != nil {
102-
clientset.Log.Fatal(err)
103-
}
104-
clientset.Log.Infoln("Build created")
105-
},
106-
}
107-
108-
deployBuildCmd.Flags().StringVar(&b.Source, "source", "", "Git URL or local path to get sources from")
109-
deployBuildCmd.Flags().StringVar(&b.Revision, "revision", "master", "Git source revision")
110-
deployBuildCmd.Flags().StringVar(&b.Buildtemplate, "buildtemplate", "", "Buildtemplate name to use with build")
111-
deployBuildCmd.Flags().StringSliceVar(&b.Args, "args", []string{}, "Build arguments")
112-
deployBuildCmd.MarkFlagRequired("source")
113-
return deployBuildCmd
114-
}
115-
116-
func cmdDeployBuildTemplate(clientset *client.ConfigSet) *cobra.Command {
117-
deployBuildTemplateCmd := &cobra.Command{
118-
Use: "buildtemplate",
119-
Aliases: []string{"buildtemplates", "bldtmpl"},
120-
Short: "Deploy knative build template",
121-
Example: "tm -n default deploy buildtemplate -f https://raw.githubusercontent.com/triggermesh/nodejs-runtime/master/knative-build-template.yaml",
122-
Run: func(cmd *cobra.Command, args []string) {
123-
bt.Namespace = client.Namespace
124-
if _, err := bt.Deploy(clientset); err != nil {
125-
clientset.Log.Fatal(err)
126-
}
127-
},
128-
}
129-
130-
deployBuildTemplateCmd.Flags().StringVarP(&bt.File, "from", "f", "", "Local path or URL to buildtemplate yaml file")
131-
return deployBuildTemplateCmd
132-
}
133-
13486
func cmdDeployChannel(clientset *client.ConfigSet) *cobra.Command {
13587
deployChannelCmd := &cobra.Command{
13688
Use: "channel",

cmd/get.go

Lines changed: 0 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ var getCmd = &cobra.Command{
3636

3737
// NewGetCmd returns "Get" cobra CLI command with its subcommands
3838
func newGetCmd(clientset *client.ConfigSet) *cobra.Command {
39-
getCmd.AddCommand(cmdListBuild(clientset))
40-
getCmd.AddCommand(cmdListBuildTemplates(clientset))
41-
getCmd.AddCommand(cmdListClusterBuildTemplates(clientset))
4239
getCmd.AddCommand(cmdListConfigurations(clientset))
4340
getCmd.AddCommand(cmdListRevision(clientset))
4441
getCmd.AddCommand(cmdListRoute(clientset))
@@ -51,92 +48,6 @@ func newGetCmd(clientset *client.ConfigSet) *cobra.Command {
5148
return getCmd
5249
}
5350

54-
func cmdListBuild(clientset *client.ConfigSet) *cobra.Command {
55-
return &cobra.Command{
56-
Use: "build",
57-
Aliases: []string{"builds"},
58-
Short: "List of knative build resources",
59-
Run: func(cmd *cobra.Command, args []string) {
60-
b.Namespace = client.Namespace
61-
if len(args) == 0 {
62-
list, err := b.List(clientset)
63-
if err != nil {
64-
clientset.Log.Fatalln(err)
65-
}
66-
if len(list.Items) == 0 {
67-
fmt.Fprintf(cmd.OutOrStdout(), "No builds found\n")
68-
return
69-
}
70-
clientset.Printer.PrintTable(b.GetTable(list))
71-
return
72-
}
73-
b.Name = args[0]
74-
build, err := b.Get(clientset)
75-
if err != nil {
76-
clientset.Log.Fatalln(err)
77-
}
78-
clientset.Printer.PrintObject(b.GetObject(build))
79-
},
80-
}
81-
}
82-
83-
func cmdListBuildTemplates(clientset *client.ConfigSet) *cobra.Command {
84-
return &cobra.Command{
85-
Use: "buildtemplate",
86-
Aliases: []string{"buildtemplates"},
87-
Short: "List of buildtemplates",
88-
Run: func(cmd *cobra.Command, args []string) {
89-
bt.Namespace = client.Namespace
90-
if len(args) == 0 {
91-
list, err := bt.List(clientset)
92-
if err != nil {
93-
clientset.Log.Fatalln(err)
94-
}
95-
if len(list.Items) == 0 {
96-
fmt.Fprintf(cmd.OutOrStdout(), "No builds found\n")
97-
return
98-
}
99-
clientset.Printer.PrintTable(bt.GetTable(list))
100-
return
101-
}
102-
bt.Name = args[0]
103-
buildtemplate, err := bt.Get(clientset)
104-
if err != nil {
105-
clientset.Log.Fatalln(err)
106-
}
107-
clientset.Printer.PrintObject(bt.GetObject(buildtemplate))
108-
},
109-
}
110-
}
111-
112-
func cmdListClusterBuildTemplates(clientset *client.ConfigSet) *cobra.Command {
113-
return &cobra.Command{
114-
Use: "clusterbuildtemplate",
115-
Aliases: []string{"cbuildtemplates", "cbuildtemplate", "clusterbuildtemplates"},
116-
Short: "List of clusterbuildtemplates",
117-
Run: func(cmd *cobra.Command, args []string) {
118-
if len(args) == 0 {
119-
list, err := cbt.List(clientset)
120-
if err != nil {
121-
clientset.Log.Fatalln(err)
122-
}
123-
if len(list.Items) == 0 {
124-
fmt.Fprintf(cmd.OutOrStdout(), "No clusterbuildtemplates found\n")
125-
return
126-
}
127-
clientset.Printer.PrintTable(cbt.GetTable(list))
128-
return
129-
}
130-
cbt.Name = args[0]
131-
cbuildtemplate, err := cbt.Get(clientset)
132-
if err != nil {
133-
clientset.Log.Fatalln(err)
134-
}
135-
clientset.Printer.PrintObject(cbt.GetObject(cbuildtemplate))
136-
},
137-
}
138-
}
139-
14051
func cmdListChannels(clientset *client.ConfigSet) *cobra.Command {
14152
return &cobra.Command{
14253
Use: "channel",

0 commit comments

Comments
 (0)