-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- extract go generation logic to shared package - extract common model-annotator - support for omitempty in the shared generator and model-annotator logic - added required indentation style for Makefile in the .editorconfig [tekton-annotator] - replace tekton-annotator with shared model-annotator [tekton-generator] - generate separate tekton schema for versions using different go source dependency version - use shared go generation logic for tekton generators - use go vendor directory for tekton generators - skip building the generator binary for tekton, instead only run the code [tekton-model] - split tekton model by version into v1alpha1 and v1beta1 - remove the generated *Schema class for tekton
- Loading branch information
Showing
38 changed files
with
3,760 additions
and
1,562 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
166 changes: 0 additions & 166 deletions
166
extensions/tekton/annotator/src/main/java/io/fabric8/tekton/TektonTypeAnnotator.java
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 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
61 changes: 61 additions & 0 deletions
61
.../tekton/examples/src/main/java/io/fabric8/tekton/api/examples/v1alpha1/TaskRunCreate.java
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,61 @@ | ||
/** | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.fabric8.tekton.api.examples.v1alpha1; | ||
|
||
import io.fabric8.tekton.client.DefaultTektonClient; | ||
import io.fabric8.tekton.client.TektonClient; | ||
import io.fabric8.tekton.pipeline.v1alpha1.TaskRun; | ||
import io.fabric8.tekton.pipeline.v1alpha1.TaskRunBuilder; | ||
import io.fabric8.tekton.pipeline.v1alpha1.TaskRunList; | ||
|
||
public class TaskRunCreate { | ||
public static void main(String[] args) { | ||
try (TektonClient tektonClient = new DefaultTektonClient()) { | ||
String namespace = "default"; | ||
|
||
TaskRun taskRun = new TaskRunBuilder() | ||
.withNewMetadata().withGenerateName("build-gcs-targz-").endMetadata() | ||
.withNewSpec() | ||
.withNewTaskSpec() | ||
.withNewInputs() | ||
.addNewResource().withName("source").withType("storage").endResource() | ||
.endInputs() | ||
.addNewStep().withImage("ubuntu").withScript("cat source/file.txt").endStep() | ||
.endTaskSpec() | ||
.withNewInputs() | ||
.addNewResource() | ||
.withName("source") | ||
.withNewResourceSpec() | ||
.withType("storage") | ||
.addNewParam().withName("location").withValue("gs://build-crd-tests/archive.tar.gz").endParam() | ||
.addNewParam().withName("artifactType").withValue("TarGzArchive").endParam() | ||
.addNewParam().withName("type").withValue("build-gcs").endParam() | ||
.endResourceSpec() | ||
.endResource() | ||
.endInputs() | ||
.endSpec() | ||
.build(); | ||
|
||
// Create TaskRun | ||
taskRun = tektonClient.v1alpha1().taskRuns().inNamespace(namespace).create(taskRun); | ||
System.out.println("Created: " + taskRun.getMetadata().getName()); | ||
|
||
// List TaskRun | ||
TaskRunList taskRunList = tektonClient.v1alpha1().taskRuns().inNamespace(namespace).list(); | ||
System.out.println("There are " + taskRunList.getItems().size() + " TaskRun objects in " + namespace); | ||
} | ||
} | ||
} |
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 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 @@ | ||
/vendor/ |
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,28 @@ | ||
# | ||
# Copyright (C) 2015 Red Hat, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
SHELL := /bin/bash | ||
|
||
all: build | ||
|
||
build: gobuild | ||
pushd ../model-v1alpha1 && \ | ||
mvn clean install -o && \ | ||
popd | ||
|
||
gobuild: | ||
go mod vendor | ||
CGO_ENABLED=0 GO111MODULE=on GO15VENDOREXPERIMENT=1 go run -mod=vendor -a ./cmd/generate/generate.go > ../model-v1alpha1/src/main/resources/schema/tekton-schema-v1alpha1.json |
Oops, something went wrong.