forked from tektoncd/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial setup for prow CI using tektoncd/plumbing 👷
This adds required dependency and scripts to be able to run the CI configured with prow. It contains placeholder code. Signed-off-by: Vincent Demeester <vdemeest@redhat.com>
- Loading branch information
1 parent
c8884d2
commit 4859f74
Showing
46 changed files
with
7,869 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,26 @@ | ||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | ||
# for detailed Gopkg.toml documentation. | ||
|
||
required = [ | ||
"github.com/tektoncd/plumbing/scripts", | ||
"github.com/knative/test-infra/tools/dep-collector", | ||
] | ||
|
||
[[constraint]] | ||
name = "github.com/tektoncd/plumbing" | ||
# HEAD as of 2019-06-24 | ||
revision = "a51e87c5261fdb718470c077c155e070aca690a8" | ||
|
||
[[constraint]] | ||
name = "github.com/knative/test-infra" | ||
# HEAD as of 2019-06-25 | ||
revision = "69af8af1d3fec861ada88efc72409b3467b0588d" | ||
|
||
[prune] | ||
go-tests = true | ||
unused-packages = true | ||
non-go = true | ||
|
||
[[prune.project]] | ||
name = "github.com/tektoncd/plumbing" | ||
non-go = false |
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,19 @@ | ||
/* | ||
Copyright 2019 The Tekton Authors | ||
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 main | ||
|
||
import "fmt" | ||
|
||
func main() { | ||
fmt.Println("Placeholder binary") | ||
} |
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,10 @@ | ||
# Assorted scripts for development | ||
|
||
This directory contains several scripts useful in the development process of | ||
Tekton Operator. | ||
|
||
- [`update-codegen.sh`](./update-codegen.sh): Updates auto-generated client | ||
libraries. | ||
- [`update-deps.sh`](./update-deps.sh): Updates Go dependencies. | ||
- [`verify-codegen.sh`](./verify-codegen.sh): Verifies that auto-generated | ||
client libraries are up-to-date. |
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,15 @@ | ||
/* | ||
Copyright 2019 The Tekton Authors | ||
|
||
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. | ||
*/ |
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,49 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2019 The Tekton Authors | ||
# | ||
# 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. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
source $(dirname $0)/../vendor/github.com/tektoncd/plumbing/scripts/library.sh | ||
|
||
CODEGEN_PKG=${CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/k8s.io/code-generator 2>/dev/null || echo ../../../k8s.io/code-generator)} | ||
|
||
KNATIVE_CODEGEN_PKG=${KNATIVE_CODEGEN_PKG:-$(cd ${REPO_ROOT_DIR}; ls -d -1 ./vendor/github.com/knative/pkg 2>/dev/null || echo ../pkg)} | ||
|
||
# generate the code with: | ||
# --output-base because this script should also be able to run inside the vendor dir of | ||
# k8s.io/kubernetes. The output-base is needed for the generators to output into the vendor dir | ||
# instead of the $GOPATH directly. For normal projects this can be dropped. | ||
${CODEGEN_PKG}/generate-groups.sh "deepcopy,client,informer,lister" \ | ||
github.com/tektoncd/pipeline/pkg/client github.com/tektoncd/pipeline/pkg/apis \ | ||
pipeline:v1alpha1 \ | ||
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt | ||
|
||
# Depends on generate-groups.sh to install bin/deepcopy-gen | ||
${GOPATH}/bin/deepcopy-gen \ | ||
-O zz_generated.deepcopy \ | ||
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt \ | ||
-i github.com/tektoncd/pipeline/pkg/apis/config | ||
|
||
# Knative Injection | ||
${KNATIVE_CODEGEN_PKG}/hack/generate-knative.sh "injection" \ | ||
github.com/tektoncd/pipeline/pkg/client github.com/tektoncd/pipeline/pkg/apis \ | ||
"pipeline:v1alpha1" \ | ||
--go-header-file ${REPO_ROOT_DIR}/hack/boilerplate/boilerplate.go.txt | ||
|
||
# Make sure our dependencies are up-to-date | ||
${REPO_ROOT_DIR}/hack/update-deps.sh |
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 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2019 The Tekton Authors | ||
# | ||
# 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. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
source $(dirname $0)/../vendor/github.com/tektoncd/plumbing/scripts/library.sh | ||
|
||
cd ${REPO_ROOT_DIR} | ||
|
||
# Ensure we have everything we need under vendor/ | ||
dep ensure | ||
|
||
update_licenses third_party/VENDOR-LICENSE "./cmd/*" |
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,53 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2019 The Tekton Authors | ||
# | ||
# 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. | ||
|
||
set -o errexit | ||
set -o nounset | ||
set -o pipefail | ||
|
||
source $(dirname $0)/../vendor/github.com/tektoncd/plumbing/scripts/library.sh | ||
|
||
readonly TMP_DIFFROOT="$(mktemp -d ${REPO_ROOT_DIR}/tmpdiffroot.XXXXXX)" | ||
|
||
cleanup() { | ||
rm -rf "${TMP_DIFFROOT}" | ||
} | ||
|
||
trap "cleanup" EXIT SIGINT | ||
|
||
cleanup | ||
|
||
# Save working tree state | ||
mkdir -p "${TMP_DIFFROOT}/pkg" | ||
cp -aR "${REPO_ROOT_DIR}/Gopkg.lock" "${REPO_ROOT_DIR}/pkg" "${REPO_ROOT_DIR}/vendor" "${TMP_DIFFROOT}" | ||
|
||
"${REPO_ROOT_DIR}/hack/update-codegen.sh" | ||
echo "Diffing ${REPO_ROOT_DIR} against freshly generated codegen" | ||
ret=0 | ||
diff -Naupr "${REPO_ROOT_DIR}/pkg" "${TMP_DIFFROOT}/pkg" || ret=1 | ||
diff -Naupr --no-dereference "${REPO_ROOT_DIR}/vendor" "${TMP_DIFFROOT}/vendor" || ret=1 | ||
|
||
# Restore working tree state | ||
rm -fr "${REPO_ROOT_DIR}/Gopkg.lock" "${REPO_ROOT_DIR}/pkg" "${REPO_ROOT_DIR}/vendor" | ||
cp -aR "${TMP_DIFFROOT}"/* "${REPO_ROOT_DIR}" | ||
|
||
if [[ $ret -eq 0 ]] | ||
then | ||
echo "${REPO_ROOT_DIR} up to date." | ||
else | ||
echo "${REPO_ROOT_DIR} is out of date. Please run hack/update-codegen.sh" | ||
exit 1 | ||
fi |
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,25 @@ | ||
// Copyright © 2018 The Tekton Authors | ||
// | ||
// 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 pkg | ||
|
||
import ( | ||
"testing" | ||
|
||
_ "github.com/tektoncd/plumbing/scripts" | ||
) | ||
|
||
func TestDummy(t *testing.T) { | ||
t.Log("This is required to make sure we get tektoncd/plumbing in the repostiory, folder 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,27 @@ | ||
// +build e2e | ||
|
||
// Copyright © 2018 The Tekton Authors | ||
// | ||
// 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 pkg | ||
|
||
import ( | ||
"testing" | ||
|
||
_ "github.com/tektoncd/plumbing/scripts" | ||
) | ||
|
||
func TestDummy(t *testing.T) { | ||
t.Log("This is required to make sure we get tektoncd/plumbing in the repostiory, folder 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,36 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Copyright 2018 The Knative Authors | ||
# | ||
# 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. | ||
|
||
# This script runs the presubmit tests; it is started by prow for each PR. | ||
# For convenience, it can also be executed manually. | ||
# Running the script without parameters, or with the --all-tests | ||
# flag, causes all tests to be executed, in the right order. | ||
# Use the flags --build-tests, --unit-tests and --integration-tests | ||
# to run a specific set of tests. | ||
|
||
# Markdown linting failures don't show up properly in Gubernator resulting | ||
# in a net-negative contributor experience. | ||
export DISABLE_MD_LINTING=1 | ||
|
||
source $(dirname $0)/../vendor/github.com/tektoncd/plumbing/scripts/presubmit-tests.sh | ||
|
||
function post_build_tests() { | ||
golangci-lint run | ||
} | ||
|
||
# We use the default build, unit and integration test runners. | ||
|
||
main $@ |
Oops, something went wrong.