├── .dockerignore ├── .github └── workflows │ ├── .mlc_config.json │ ├── codeql-analysis.yml │ └── pull-request.yml ├── .gitignore ├── .helmignore ├── .jx └── updatebot.yaml ├── .lighthouse └── jenkins-x │ ├── pullrequest.yaml │ ├── release.yaml │ └── triggers.yaml ├── .whitesource.config ├── LICENSE ├── Makefile ├── OWNERS ├── OWNERS_ALIASES ├── README.md ├── bdd ├── bbs │ ├── README.md │ ├── ci.sh │ ├── cluster.yaml │ ├── jx-requirements.yml │ └── parameters.yaml ├── capture-failed-pod-logs.sh ├── ghe │ ├── README.md │ ├── ci.sh │ ├── cluster.yaml │ ├── jx-requirements.yml │ └── parameters.yaml ├── gitea │ ├── ci.sh │ ├── gitea.values.yaml.template │ ├── user.template.json │ └── values.yaml.template ├── github │ ├── README.md │ ├── ci.sh │ ├── cluster.yaml │ ├── jx-requirements.yml │ └── parameters.yaml ├── gitlab │ ├── README.md │ ├── ci.sh │ ├── cluster.yaml │ ├── jx-requirements.yml │ └── parameters.yaml ├── helm-requirements.yaml.template ├── jenkins │ ├── ci.sh │ ├── jenkins-values.yaml.template │ └── lighthouse-values.yaml.template ├── lh-jx-values.yaml ├── tekton │ ├── ci.sh │ └── values.yaml.template └── values.yaml.template ├── charts └── lighthouse │ ├── .helmignore │ ├── Chart.yaml │ ├── Makefile │ ├── README.md │ ├── README.md.gotmpl │ ├── config │ ├── lighthousebreakpoints.lighthouse.jenkins.io-v1.yaml │ ├── lighthousebreakpoints.lighthouse.jenkins.io.yaml │ ├── lighthousejobs.lighthouse.jenkins.io-v1.yaml │ └── lighthousejobs.lighthouse.jenkins.io.yaml │ ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── config-cm.yaml │ ├── config-external-plugins.yaml │ ├── foghorn-deployment.yaml │ ├── foghorn-rb.yaml │ ├── foghorn-role.yaml │ ├── foghorn-sa.yaml │ ├── gc-jobs-cj.yaml │ ├── gc-jobs-rb.yaml │ ├── gc-jobs-role.yaml │ ├── gc-jobs-sa.yaml │ ├── hmacsecret.yaml │ ├── jenkins-controller-deployment.yaml │ ├── jenkins-controller-rb.yaml │ ├── jenkins-controller-role.yaml │ ├── jenkins-controller-sa.yaml │ ├── jenkins-controller-secret.yaml │ ├── jenkins-controller-service.yaml │ ├── keeper-deployment.yaml │ ├── keeper-rb.yaml │ ├── keeper-role.yaml │ ├── keeper-sa.yaml │ ├── keeper-service.yaml │ ├── lighthousebreakpoints-crd.yaml │ ├── lighthousejobs-crd.yaml │ ├── oauthsecret.yaml │ ├── plugins-cm.yaml │ ├── poller-deployment.yaml │ ├── poller-rb.yaml │ ├── poller-role.yaml │ ├── poller-sa.yaml │ ├── tekton-controller-deployment.yaml │ ├── tekton-controller-rb.yaml │ ├── tekton-controller-role.yaml │ ├── tekton-controller-sa.yaml │ ├── tekton-controller-service.yaml │ ├── tide-githubapp-secrets.yaml │ ├── webhooks-deployment.yaml │ ├── webhooks-ingress.yaml │ ├── webhooks-rb.yaml │ ├── webhooks-role.yaml │ ├── webhooks-sa.yaml │ └── webhooks-service.yaml │ └── values.yaml ├── cmd ├── foghorn │ └── main.go ├── gc │ └── main.go ├── jenkins │ └── main.go ├── keeper │ ├── OWNERS │ ├── README.md │ ├── config.md │ ├── main.go │ ├── maintainers.md │ ├── pr-authors.md │ └── status-context.png ├── poller │ └── main.go ├── tektoncontroller │ └── main.go └── webhooks │ └── main.go ├── crds ├── lighthouse.jenkins.io_lighthousebreakpoints.yaml └── lighthouse.jenkins.io_lighthousejobs.yaml ├── dependency-matrix ├── matrix.md └── matrix.yaml ├── docker ├── foghorn │ └── Dockerfile ├── gc │ └── Dockerfile ├── jenkins │ └── Dockerfile ├── keeper │ └── Dockerfile ├── poller │ └── Dockerfile ├── tekton │ └── Dockerfile └── webhooks │ └── Dockerfile ├── docs ├── PLUGINS.md ├── config │ ├── README.md │ ├── jobs │ │ ├── github-com-jenkins-x-lighthouse-pkg-config-job.md │ │ ├── github-com-tektoncd-pipeline-pkg-apis-pipeline-v1beta1.md │ │ ├── github-com-tektoncd-pipeline-pkg-apis-resource-v1alpha1.md │ │ ├── k8s-io-api-core-v1.md │ │ ├── k8s-io-apimachinery-pkg-api-resource.md │ │ ├── k8s-io-apimachinery-pkg-apis-meta-v1.md │ │ ├── k8s-io-apimachinery-pkg-runtime.md │ │ ├── k8s-io-apimachinery-pkg-types.md │ │ └── k8s-io-apimachinery-pkg-util-intstr.md │ ├── lighthouse │ │ ├── github-com-jenkins-x-lighthouse-pkg-config-branchprotection.md │ │ ├── github-com-jenkins-x-lighthouse-pkg-config-keeper.md │ │ ├── github-com-jenkins-x-lighthouse-pkg-config-lighthouse.md │ │ └── github-com-jenkins-x-lighthouse-pkg-config-org.md │ └── plugins │ │ └── github-com-jenkins-x-lighthouse-pkg-plugins.md ├── crds │ ├── github-com-jenkins-x-lighthouse-pkg-apis-lighthouse-v1alpha1.md │ ├── github-com-jenkins-x-lighthouse-pkg-config-job.md │ ├── github-com-tektoncd-pipeline-pkg-apis-pipeline-v1beta1.md │ ├── github-com-tektoncd-pipeline-pkg-apis-resource-v1alpha1.md │ ├── k8s-io-api-core-v1.md │ ├── k8s-io-apimachinery-pkg-api-resource.md │ ├── k8s-io-apimachinery-pkg-apis-meta-v1.md │ ├── k8s-io-apimachinery-pkg-runtime.md │ ├── k8s-io-apimachinery-pkg-types.md │ └── k8s-io-apimachinery-pkg-util-intstr.md ├── install_lighthouse_with_jenkins.md ├── install_lighthouse_with_tekton.md ├── pipelines.md ├── plugins │ ├── Plugins config.md │ ├── hold.md │ ├── shrug.md │ ├── size.md │ ├── welcome.md │ ├── wip.md │ └── yuks.md └── trigger │ ├── github-com-jenkins-x-lighthouse-pkg-config-job.md │ ├── github-com-jenkins-x-lighthouse-pkg-triggerconfig.md │ ├── github-com-tektoncd-pipeline-pkg-apis-pipeline-v1beta1.md │ ├── github-com-tektoncd-pipeline-pkg-apis-resource-v1alpha1.md │ ├── k8s-io-api-core-v1.md │ ├── k8s-io-apimachinery-pkg-api-resource.md │ ├── k8s-io-apimachinery-pkg-apis-meta-v1.md │ ├── k8s-io-apimachinery-pkg-runtime.md │ ├── k8s-io-apimachinery-pkg-types.md │ └── k8s-io-apimachinery-pkg-util-intstr.md ├── go.mod ├── go.sum ├── graph.txt ├── hack ├── changelog-header.md ├── generate-groups.sh ├── go.mod ├── go.sum ├── gofmt.sh ├── linter.sh ├── patchDevImages.sh ├── struct-docs.go ├── tools.go └── update-codegen.sh ├── init-helm.sh ├── pkg ├── apis │ └── lighthouse │ │ ├── register.go │ │ └── v1alpha1 │ │ ├── breakpoint.go │ │ ├── breakpoint_test.go │ │ ├── doc.go │ │ ├── register.go │ │ ├── types.go │ │ ├── types_test.go │ │ └── zz_generated.deepcopy.go ├── client │ ├── clientset │ │ └── versioned │ │ │ ├── clientset.go │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ ├── clientset_generated.go │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ ├── scheme │ │ │ ├── doc.go │ │ │ └── register.go │ │ │ └── typed │ │ │ └── lighthouse │ │ │ └── v1alpha1 │ │ │ ├── doc.go │ │ │ ├── fake │ │ │ ├── doc.go │ │ │ ├── fake_lighthouse_client.go │ │ │ ├── fake_lighthousebreakpoint.go │ │ │ └── fake_lighthousejob.go │ │ │ ├── generated_expansion.go │ │ │ ├── lighthouse_client.go │ │ │ ├── lighthousebreakpoint.go │ │ │ └── lighthousejob.go │ ├── informers │ │ └── externalversions │ │ │ ├── factory.go │ │ │ ├── generic.go │ │ │ ├── internalinterfaces │ │ │ └── factory_interfaces.go │ │ │ └── lighthouse │ │ │ ├── interface.go │ │ │ └── v1alpha1 │ │ │ ├── interface.go │ │ │ ├── lighthousebreakpoint.go │ │ │ └── lighthousejob.go │ └── listers │ │ └── lighthouse │ │ └── v1alpha1 │ │ ├── expansion_generated.go │ │ ├── lighthousebreakpoint.go │ │ └── lighthousejob.go ├── clients │ └── clients.go ├── commentpruner │ ├── commentpruner.go │ └── commentpruner_test.go ├── config │ ├── agent.go │ ├── branch_protection_test.go │ ├── branchprotection │ │ ├── branch.go │ │ ├── config.go │ │ ├── contextpolicy.go │ │ ├── org.go │ │ ├── policy.go │ │ ├── policy_test.go │ │ ├── repo.go │ │ ├── restrictions.go │ │ ├── reviewpolicy.go │ │ ├── util.go │ │ └── util_test.go │ ├── config.go │ ├── config_test.go │ ├── githuboauth.go │ ├── job │ │ ├── agent.go │ │ ├── base.go │ │ ├── brancher.go │ │ ├── changedfilesprovider.go │ │ ├── config.go │ │ ├── deployment.go │ │ ├── label.go │ │ ├── periodic.go │ │ ├── pipelinekind.go │ │ ├── pipelinerunparam.go │ │ ├── postsubmit.go │ │ ├── preset.go │ │ ├── presubmit.go │ │ ├── regexpchangematcher.go │ │ ├── regexpchangematcher_test.go │ │ ├── reporter.go │ │ └── utilityconfig.go │ ├── keeper │ │ ├── config.go │ │ ├── contextpolicy.go │ │ ├── contextpolicyoptions.go │ │ ├── mergecommittemplate.go │ │ ├── orgcontextpolicy.go │ │ ├── pullrequestmergetype.go │ │ ├── queries.go │ │ ├── query.go │ │ ├── query_test.go │ │ ├── querymap.go │ │ └── repocontextpolicy.go │ ├── keeper_test.go │ ├── lighthouse │ │ ├── config.go │ │ ├── controller.go │ │ ├── githuboptions.go │ │ ├── jenkins_config.go │ │ ├── ownersdirexclude.go │ │ ├── plank.go │ │ ├── providerconfig.go │ │ ├── pubsubsubscriptions.go │ │ └── pushgateway.go │ ├── org │ │ ├── org.go │ │ └── org_test.go │ ├── secret │ │ ├── agent.go │ │ └── secret.go │ ├── test_data │ │ ├── config.yaml │ │ └── config │ │ │ ├── README.md │ │ │ └── jobs │ │ │ ├── GoogleCloudPlatform │ │ │ ├── k8s-cluster-bundle │ │ │ │ └── k8s-cluster-bundle.yaml │ │ │ └── k8s-multicluster-ingress │ │ │ │ ├── OWNERS │ │ │ │ └── k8s-multicluster-ingress-config.yaml │ │ │ ├── README.md │ │ │ ├── apache-spark-on-k8s │ │ │ └── spark-integration │ │ │ │ ├── OWNERS │ │ │ │ └── spark-config.yaml │ │ │ ├── bazelbuild │ │ │ └── rules_k8s │ │ │ │ ├── OWNERS │ │ │ │ └── rules_k8s_config.yaml │ │ │ ├── cadvisor │ │ │ ├── OWNERS │ │ │ └── cadvisor.yaml │ │ │ ├── containerd │ │ │ └── cri │ │ │ │ ├── OWNERS │ │ │ │ └── containerd-cri-presubmit-jobs.yaml │ │ │ ├── gke │ │ │ └── containerd │ │ │ │ ├── OWNERS │ │ │ │ └── gke-test-containerd.yaml │ │ │ ├── helm │ │ │ └── charts │ │ │ │ ├── OWNERS │ │ │ │ └── charts.yaml │ │ │ ├── kubeflow │ │ │ ├── OWNERS │ │ │ ├── kubeflow-periodics.yaml │ │ │ ├── kubeflow-postsubmits.yaml │ │ │ └── kubeflow-presubmits.yaml │ │ │ ├── kubernetes-csi │ │ │ ├── OWNERS │ │ │ └── csi-lib-utils │ │ │ │ └── csi-lib-utils-config.yaml │ │ │ ├── kubernetes-incubator │ │ │ └── service-catalog │ │ │ │ ├── OWNERS │ │ │ │ └── service-catalog-presubmits.yaml │ │ │ ├── kubernetes-sigs │ │ │ ├── aws-alb-ingress-controller │ │ │ │ ├── OWNERS │ │ │ │ └── aws-alb-ingress-controller-presubmits.yaml │ │ │ ├── aws-ebs-csi-driver │ │ │ │ ├── OWNERS │ │ │ │ └── aws-ebs-csi-driver-presubmits.yaml │ │ │ ├── cluster-api-provider-aws │ │ │ │ ├── OWNERS │ │ │ │ ├── cluster-api-provider-aws-ci.yaml │ │ │ │ └── cluster-api-provider-aws-presubmits.yaml │ │ │ ├── cluster-api-provider-azure │ │ │ │ ├── OWNERS │ │ │ │ └── cluster-api-provider-azure-presubmits.yaml │ │ │ ├── cluster-api-provider-digitalocean │ │ │ │ ├── OWNERS │ │ │ │ └── cluster-api-provider-digitalocean-presubmits.yaml │ │ │ ├── cluster-api-provider-gcp │ │ │ │ ├── OWNERS │ │ │ │ ├── cluster-api-provider-gcp-ci.yaml │ │ │ │ └── cluster-api-provider-gcp-presubmits.yaml │ │ │ ├── cluster-api-provider-openstack │ │ │ │ ├── OWNERS │ │ │ │ └── cluster-api-provider-openstack-presubmits.yaml │ │ │ ├── cluster-api-provider-vsphere │ │ │ │ ├── OWNERS │ │ │ │ └── cluster-api-provider-vsphere-presubmits.yaml │ │ │ ├── cluster-api │ │ │ │ ├── OWNERS │ │ │ │ ├── cluster-api-ci.yaml │ │ │ │ └── cluster-api-presubmits.yaml │ │ │ ├── gcp-compute-persistent-disk-csi-driver │ │ │ │ ├── OWNERS │ │ │ │ ├── config.yaml │ │ │ │ └── gcp-compute-persistent-disk-csi-driver-postsubmits.yaml │ │ │ ├── gcp-filestore-csi-driver │ │ │ │ ├── OWNERS │ │ │ │ └── gcp-filestore-csi-driver-config.yaml │ │ │ ├── kind │ │ │ │ ├── kind-postsubmits.yaml │ │ │ │ ├── kind-presubmits.yaml │ │ │ │ └── kind.yaml │ │ │ ├── kube-storage-version-migrator │ │ │ │ ├── OWNERS │ │ │ │ └── presubmits.yaml │ │ │ ├── kustomize │ │ │ │ ├── OWNERS │ │ │ │ └── kustomize-config.yaml │ │ │ ├── poseidon │ │ │ │ ├── OWNERS │ │ │ │ └── poseidon-config.yaml │ │ │ ├── sig-storage-local-static-provisioner │ │ │ │ ├── OWNERS │ │ │ │ ├── sig-storage-local-static-provisioner-trusted.yaml │ │ │ │ └── sig-storage-local-static-provisioner.yaml │ │ │ ├── sig-windows │ │ │ │ ├── OWNERS │ │ │ │ └── sig-windows-config.yaml │ │ │ ├── structured-merge-diff │ │ │ │ ├── OWNERS │ │ │ │ ├── structured-merge-diff-ci.yaml │ │ │ │ └── structured-merge-diff-presubmits.yaml │ │ │ └── testing_frameworks │ │ │ │ ├── OWNERS │ │ │ │ └── testing-frameworks-config.yaml │ │ │ ├── kubernetes │ │ │ ├── cloud-provider-aws │ │ │ │ ├── OWNERS │ │ │ │ └── cloud-provider-aws-config.yaml │ │ │ ├── cloud-provider-azure │ │ │ │ ├── OWNERS │ │ │ │ └── cloud-provider-azure-config.yaml │ │ │ ├── cloud-provider-gcp │ │ │ │ ├── OWNERS │ │ │ │ └── cloud-provider-gcp-presubmits.yaml │ │ │ ├── cloud-provider-openstack │ │ │ │ ├── OWNERS │ │ │ │ └── cloud-provider-openstack-config.yaml │ │ │ ├── cloud-provider-vsphere │ │ │ │ ├── OWNERS │ │ │ │ └── cloud-provider-vsphere-presubmits.yaml │ │ │ ├── cluster-registry │ │ │ │ ├── OWNERS │ │ │ │ └── cluster-registry-config.yaml │ │ │ ├── community │ │ │ │ ├── OWNERS │ │ │ │ └── community-presubmit.yaml │ │ │ ├── generated │ │ │ │ ├── OWNERS │ │ │ │ └── generated.yaml │ │ │ ├── kops │ │ │ │ ├── OWNERS │ │ │ │ └── kops-config.yaml │ │ │ ├── minikube │ │ │ │ └── minikube.yaml │ │ │ ├── org │ │ │ │ ├── OWNERS │ │ │ │ └── kubernetes-org-jobs.yaml │ │ │ ├── publishing-bot │ │ │ │ ├── OWNERS │ │ │ │ └── publishing-bot-presubmits.yaml │ │ │ ├── sig-api-machinery │ │ │ │ ├── OWNERS │ │ │ │ └── sig-api-machinery-config.yaml │ │ │ ├── sig-apps │ │ │ │ ├── OWNERS │ │ │ │ └── sig-apps-config.yaml │ │ │ ├── sig-autoscaling │ │ │ │ ├── OWNERS │ │ │ │ └── sig-autoscaling-config.yaml │ │ │ ├── sig-aws │ │ │ │ ├── OWNERS │ │ │ │ ├── eks │ │ │ │ │ ├── OWNERS │ │ │ │ │ ├── eks-periodics.yaml │ │ │ │ │ ├── eks-presets.yaml │ │ │ │ │ └── eks-presubmits.yaml │ │ │ │ ├── kops │ │ │ │ │ ├── kops-periodics.yaml │ │ │ │ │ ├── kops-presets.yaml │ │ │ │ │ └── kops-presubmits.yaml │ │ │ │ └── sig-aws-credentials.yaml │ │ │ ├── sig-cli │ │ │ │ ├── OWNERS │ │ │ │ └── sig-cli-config.yaml │ │ │ ├── sig-cluster-lifecycle │ │ │ │ ├── OWNERS │ │ │ │ ├── k8s-upgrade-gce.yaml │ │ │ │ ├── k8s-upgrade-gke.yaml │ │ │ │ ├── kubeadm-upgrade.yaml │ │ │ │ ├── kubeadm-x-on-y.yaml │ │ │ │ ├── kubeadm.yaml │ │ │ │ ├── manifests.yaml │ │ │ │ ├── packages.yaml │ │ │ │ └── sig-cluster-lifecycle-misc.yaml │ │ │ ├── sig-gcp │ │ │ │ ├── OWNERS │ │ │ │ ├── gce-conformance.yaml │ │ │ │ ├── gpu │ │ │ │ │ ├── OWNERS │ │ │ │ │ ├── sig-gcp-gpu-autoscaling.yaml │ │ │ │ │ ├── sig-gcp-gpu-gce.yaml │ │ │ │ │ ├── sig-gcp-gpu-gke.yaml │ │ │ │ │ ├── sig-gcp-gpu-presubmit.yaml │ │ │ │ │ └── sig-gcp-gpu-upgrade-downgrade.yaml │ │ │ │ ├── sig-gcp-gce-config.yaml │ │ │ │ ├── sig-gcp-gke-config.yaml │ │ │ │ └── sig-gcp-windows.yaml │ │ │ ├── sig-instrumentation │ │ │ │ ├── OWNERS │ │ │ │ └── sig-instrumentation-config.yaml │ │ │ ├── sig-network │ │ │ │ ├── OWNERS │ │ │ │ ├── ci-e2e-gce-netd.yaml │ │ │ │ ├── ingress-gce-e2e.yaml │ │ │ │ └── sig-network-misc.yaml │ │ │ ├── sig-node │ │ │ │ ├── OWNERS │ │ │ │ ├── containerd.yaml │ │ │ │ ├── local-e2e-containerized.yaml │ │ │ │ ├── node-docker.yaml │ │ │ │ ├── node-kubelet.yaml │ │ │ │ └── sig-node-presubmit.yaml │ │ │ ├── sig-release │ │ │ │ ├── OWNERS │ │ │ │ └── kubernetes-builds.yaml │ │ │ ├── sig-scalability │ │ │ │ ├── OWNERS │ │ │ │ ├── sig-scalability-periodic-jobs.yaml │ │ │ │ ├── sig-scalability-presets.yaml │ │ │ │ ├── sig-scalability-presubmit-jobs.yaml │ │ │ │ └── sig-scalability-release-blocking-jobs.yaml │ │ │ ├── sig-scheduling │ │ │ │ ├── OWNERS │ │ │ │ └── sig-scheduling-config.yaml │ │ │ ├── sig-storage │ │ │ │ ├── OWNERS │ │ │ │ └── sig-storage-gce-config.yaml │ │ │ ├── sig-testing │ │ │ │ ├── bazel-build-test.yaml │ │ │ │ ├── coverage.yaml │ │ │ │ ├── godeps.yaml │ │ │ │ ├── integration.yaml │ │ │ │ ├── kubetest-canaries.yaml │ │ │ │ ├── local-e2e.yaml │ │ │ │ ├── typecheck.yaml │ │ │ │ └── verify.yaml │ │ │ └── test-infra │ │ │ │ ├── fejta-bot-periodics.yaml │ │ │ │ ├── janitors.yaml │ │ │ │ ├── test-infra-canaries.yaml │ │ │ │ ├── test-infra-periodics.yaml │ │ │ │ ├── test-infra-postsubmits.yaml │ │ │ │ ├── test-infra-presubmits.yaml │ │ │ │ └── test-infra-trusted.yaml │ │ │ └── tensorflow │ │ │ └── minigo │ │ │ ├── OWNERS │ │ │ └── minigo.yaml │ └── util │ │ └── util.go ├── engines │ ├── jenkins │ │ ├── client.go │ │ ├── client_test.go │ │ ├── controller.go │ │ ├── doc.go │ │ ├── jenkins.go │ │ └── metrics.go │ └── tekton │ │ ├── activity.go │ │ ├── activity_test.go │ │ ├── controller.go │ │ ├── controller_test.go │ │ ├── pipelinerun_rerun_controller.go │ │ ├── test_data │ │ ├── activity │ │ │ ├── failed_single_task │ │ │ │ ├── pr.yaml │ │ │ │ ├── record.yaml │ │ │ │ └── tr.yaml │ │ │ ├── running_multiple_tasks │ │ │ │ ├── pr.yaml │ │ │ │ ├── record.yaml │ │ │ │ ├── tr.yaml │ │ │ │ └── tr2.yaml │ │ │ ├── running_single_task │ │ │ │ ├── pr.yaml │ │ │ │ ├── record.yaml │ │ │ │ └── tr.yaml │ │ │ ├── successful_multiple_tasks │ │ │ │ ├── pr.yaml │ │ │ │ ├── record.yaml │ │ │ │ ├── tr.yaml │ │ │ │ └── tr2.yaml │ │ │ └── successful_single_task │ │ │ │ ├── pr.yaml │ │ │ │ ├── record.yaml │ │ │ │ └── tr.yaml │ │ └── controller │ │ │ ├── start-batch-pullrequest │ │ │ ├── expected-lhjob.yml │ │ │ ├── expected-pr.yml │ │ │ ├── observed-lhjob.yml │ │ │ └── observed-pipeline.yml │ │ │ ├── start-pullrequest │ │ │ ├── expected-lhjob.yml │ │ │ ├── expected-pr.yml │ │ │ ├── observed-lhjob.yml │ │ │ └── observed-pipeline.yml │ │ │ ├── start-push │ │ │ ├── expected-lhjob.yml │ │ │ ├── expected-pr.yml │ │ │ ├── observed-lhjob.yml │ │ │ └── observed-pipeline.yml │ │ │ └── update-job │ │ │ ├── expected-lhjob.yml │ │ │ ├── expected-pr.yml │ │ │ ├── observed-lhjob.yml │ │ │ ├── observed-pr.yml │ │ │ └── observed-tr.yml │ │ └── utils.go ├── errorutil │ ├── aggregate.go │ └── doc.go ├── externalplugincfg │ ├── load.go │ ├── load_test.go │ └── types.go ├── filebrowser │ ├── fake │ │ └── fake_file_browser.go │ ├── fetch_cache.go │ ├── fetch_cache_test.go │ ├── file_browsers.go │ ├── file_browsers_test.go │ ├── git_file_browser.go │ ├── git_file_browser_test.go │ └── interface.go ├── foghorn │ ├── controller.go │ ├── controller_test.go │ ├── plugins.go │ └── test_data │ │ ├── no-status-change │ │ ├── expected-lhjob.yml │ │ └── observed-lhjob.yml │ │ └── status-change │ │ ├── expected-lhjob.yml │ │ └── observed-lhjob.yml ├── genfiles │ ├── genfiles.go │ └── genfiles_test.go ├── git │ ├── git.go │ ├── localgit │ │ └── localgit.go │ └── v2 │ │ ├── client_factory.go │ │ ├── executor.go │ │ ├── executor_test.go │ │ ├── fakes.go │ │ ├── interactor.go │ │ ├── interactor_test.go │ │ ├── no_mirror_client_factory.go │ │ ├── publisher.go │ │ ├── publisher_test.go │ │ ├── remote.go │ │ └── remote_test.go ├── gitattributes │ ├── gitattributes.go │ ├── gitattributes_test.go │ ├── pattern.go │ └── pattern_test.go ├── gittest │ └── helpers.go ├── interrupts │ ├── interrupts.go │ └── interrupts_test.go ├── jobutil │ ├── filter.go │ ├── filter_test.go │ ├── jobutil.go │ ├── jobutil_test.go │ └── pprof.go ├── keeper │ ├── README.md │ ├── blockers │ │ ├── blockers.go │ │ └── blockers_test.go │ ├── githubapp │ │ ├── factory.go │ │ ├── github_app_ctrl.go │ │ ├── owner_query.go │ │ ├── owner_query_test.go │ │ └── test_data │ │ │ └── config.yaml │ ├── history │ │ ├── history.go │ │ └── history_test.go │ ├── interface.go │ ├── keeper.go │ ├── keeper_test.go │ ├── search.go │ ├── search_test.go │ ├── status.go │ └── status_test.go ├── labels │ └── labels.go ├── launcher │ ├── fake │ │ └── fake.go │ ├── interface.go │ └── launcher.go ├── logrusutil │ ├── logrusutil.go │ ├── logrusutil_test.go │ └── stackdriver │ │ ├── formatter.go │ │ └── formatter_test.go ├── metrics │ └── metrics.go ├── pluginhelp │ └── pluginhelp.go ├── plugins │ ├── approve │ │ ├── approve.go │ │ ├── approve_test.go │ │ └── approvers │ │ │ ├── README.md │ │ │ ├── approvers_test.go │ │ │ ├── images │ │ │ ├── bot_notification_for_approval_selection_mechanism.png │ │ │ └── directory_structure.png │ │ │ ├── owners.go │ │ │ └── owners_test.go │ ├── assign │ │ ├── assign.go │ │ └── assign_test.go │ ├── blockade │ │ ├── blockade.go │ │ └── blockade_test.go │ ├── branchcleaner │ │ ├── README.md │ │ ├── branchcleaner.go │ │ └── branchcleaner_test.go │ ├── cat │ │ ├── .gitignore │ │ ├── cat.go │ │ └── cat_test.go │ ├── cherrypickunapproved │ │ ├── cherrypick-unapproved.go │ │ └── cherrypick-unapproved_test.go │ ├── command.go │ ├── command_test.go │ ├── config.go │ ├── config_test.go │ ├── dog │ │ ├── dog.go │ │ └── dog_test.go │ ├── help │ │ ├── help.go │ │ └── help_test.go │ ├── hold │ │ ├── hold.go │ │ └── hold_test.go │ ├── label │ │ ├── label.go │ │ └── label_test.go │ ├── lgtm │ │ ├── lgtm.go │ │ └── lgtm_test.go │ ├── lifecycle │ │ ├── close.go │ │ ├── close_test.go │ │ ├── lifecycle.go │ │ ├── lifecycle_test.go │ │ ├── reopen.go │ │ └── reopen_test.go │ ├── milestone │ │ ├── milestone.go │ │ └── milestone_test.go │ ├── milestonestatus │ │ ├── milestonestatus.go │ │ └── milestonestatus_test.go │ ├── override │ │ ├── override.go │ │ └── override_test.go │ ├── owners-label │ │ ├── owners-label.go │ │ └── owners-label_test.go │ ├── plugin.go │ ├── plugin_test.go │ ├── plugins.go │ ├── plugins_test.go │ ├── pony │ │ ├── pony.go │ │ └── pony_test.go │ ├── respond.go │ ├── respond_test.go │ ├── shrug │ │ ├── shrug.go │ │ └── shrug_test.go │ ├── sigmention │ │ ├── sigmention.go │ │ └── sigmention_test.go │ ├── size │ │ ├── size.go │ │ └── size_test.go │ ├── skip │ │ ├── skip.go │ │ └── skip_test.go │ ├── stage │ │ ├── stage.go │ │ └── stage_test.go │ ├── trigger │ │ ├── deployment.go │ │ ├── deployment_test.go │ │ ├── generic-comment.go │ │ ├── generic-comment_test.go │ │ ├── periodic.go │ │ ├── periodic_test.go │ │ ├── pull-request.go │ │ ├── pull-request_test.go │ │ ├── push.go │ │ ├── push_test.go │ │ ├── test_data │ │ │ └── testorg │ │ │ │ └── myapp │ │ │ │ └── .lighthouse │ │ │ │ └── jenkins-x │ │ │ │ ├── dailyjob.yaml │ │ │ │ └── triggers.yaml │ │ ├── trigger.go │ │ └── trigger_test.go │ ├── updateconfig │ │ ├── test_data │ │ │ ├── invalid-config.yaml │ │ │ ├── invalid-yaml.yaml │ │ │ └── valid-config.yaml │ │ ├── updateconfig.go │ │ └── updateconfig_test.go │ ├── welcome │ │ ├── welcome.go │ │ └── welcome_test.go │ ├── wip │ │ ├── wip-label.go │ │ └── wip-label_test.go │ └── yuks │ │ ├── yuks.go │ │ └── yuks_test.go ├── poller │ ├── poller.go │ ├── poller_test.go │ ├── pollstate │ │ ├── interface.go │ │ └── memory.go │ └── test_data │ │ └── myorg │ │ └── myrepo │ │ └── README.md ├── repoowners │ ├── repoowners.go │ └── repoowners_test.go ├── scmprovider │ ├── client.go │ ├── content.go │ ├── fake │ │ └── fake.go │ ├── git.go │ ├── issues.go │ ├── labels.go │ ├── legacy_helpers.go │ ├── milestones.go │ ├── organizations.go │ ├── pull_requests.go │ ├── reporter │ │ ├── reporter.go │ │ └── reporter_test.go │ ├── repositories.go │ ├── reviews.go │ └── test_helpers.go ├── triggerconfig │ ├── inrepo │ │ ├── calculate.go │ │ ├── calculate_test.go │ │ ├── default_parameters.go │ │ ├── default_parameters_test.go │ │ ├── git_uri.go │ │ ├── git_uri_test.go │ │ ├── load_integration_test.go │ │ ├── load_pipelinerun.go │ │ ├── load_pipelinerun_test.go │ │ ├── load_triggers.go │ │ ├── load_triggers_test.go │ │ ├── overrides.go │ │ ├── params.go │ │ ├── resolver_cache.go │ │ ├── test_data │ │ │ ├── empty_dir │ │ │ │ └── README.md │ │ │ ├── jenkins-x │ │ │ │ └── jx3-pipeline-catalog │ │ │ │ │ └── refs │ │ │ │ │ ├── 1d39235ee9235d7d52d4025a8e59cb8bda04306a │ │ │ │ │ └── packs │ │ │ │ │ │ ├── javascript-selenium │ │ │ │ │ │ └── .lighthouse │ │ │ │ │ │ │ └── jenkins-x │ │ │ │ │ │ │ └── pullrequest.yaml │ │ │ │ │ │ └── javascript │ │ │ │ │ │ └── .lighthouse │ │ │ │ │ │ └── jenkins-x │ │ │ │ │ │ └── pullrequest.yaml │ │ │ │ │ └── myversionstreamref │ │ │ │ │ ├── packs │ │ │ │ │ └── javascript │ │ │ │ │ │ └── .lighthouse │ │ │ │ │ │ └── jenkins-x │ │ │ │ │ │ └── pullrequest.yaml │ │ │ │ │ └── tasks │ │ │ │ │ ├── git-clone │ │ │ │ │ └── git-clone.yaml │ │ │ │ │ ├── kubevirt │ │ │ │ │ ├── params-task.yaml │ │ │ │ │ └── params.yaml │ │ │ │ │ └── maven-java11 │ │ │ │ │ └── release.yaml │ │ │ ├── load_pipelinerun │ │ │ │ ├── pipeline-finally-params │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── pipeline-finally-uses │ │ │ │ │ ├── README.md │ │ │ │ │ ├── common.yaml │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── pipeline-load-refs-sub-dir │ │ │ │ │ ├── demo-deploy-kubectl.yaml │ │ │ │ │ ├── expected.yaml │ │ │ │ │ ├── kaniko.yaml │ │ │ │ │ ├── mydir │ │ │ │ │ │ └── git-clone.yaml │ │ │ │ │ ├── source.yaml │ │ │ │ │ └── unit-tests.yaml │ │ │ │ ├── pipeline-load-refs │ │ │ │ │ ├── demo-deploy-kubectl.yaml │ │ │ │ │ ├── expected.yaml │ │ │ │ │ ├── git-clone.yaml │ │ │ │ │ ├── kaniko.yaml │ │ │ │ │ ├── source.yaml │ │ │ │ │ └── unit-tests.yaml │ │ │ │ ├── pipeline-missing-refs-fails │ │ │ │ │ └── source.yaml │ │ │ │ ├── pipeline-params-from-tasks-results │ │ │ │ │ ├── expected.yaml │ │ │ │ │ ├── save-results-task.yaml │ │ │ │ │ ├── show-results-task.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── pipeline-tekton-git-resolver │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── pipeline │ │ │ │ │ ├── demo-deploy-kubectl.yaml │ │ │ │ │ ├── expected.yaml │ │ │ │ │ ├── git-clone.yaml │ │ │ │ │ ├── kaniko.yaml │ │ │ │ │ ├── source.yaml │ │ │ │ │ └── unit-tests.yaml │ │ │ │ ├── pr-load-refs │ │ │ │ │ ├── add-params.yaml │ │ │ │ │ ├── expected.yaml │ │ │ │ │ ├── pipeline-with-extra-params.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── pr │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── task-append-steps │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── task-disable-params │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── task-prepend-steps │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── task-without-params │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── task │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── taskrun │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-all-steps │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-custom-param-task │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-custom-param │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-issue-1234 │ │ │ │ │ ├── README.md │ │ │ │ │ ├── common.yaml │ │ │ │ │ ├── expected.yaml │ │ │ │ │ ├── expected2.yaml │ │ │ │ │ ├── source.yaml │ │ │ │ │ └── source2.yaml │ │ │ │ ├── uses-steps-add-custom-explict │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-add-custom │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-custom-git │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-explicit │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-inherit-sidecar │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-multiple-copies │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-override-resources │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-override-script │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-override │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-version-stream │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-with-sidecar-ws │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps-with-sidecar │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ ├── uses-steps │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ │ └── uses-task-and-steps │ │ │ │ │ ├── README.md │ │ │ │ │ ├── expected.yaml │ │ │ │ │ └── source.yaml │ │ │ ├── load_url │ │ │ │ └── foo.yaml │ │ │ └── myorg │ │ │ │ ├── branchtest │ │ │ │ └── refs │ │ │ │ │ ├── master │ │ │ │ │ └── .lighthouse │ │ │ │ │ │ └── triggers │ │ │ │ │ │ └── triggers.yaml │ │ │ │ │ └── mybranch │ │ │ │ │ └── .lighthouse │ │ │ │ │ └── triggers │ │ │ │ │ └── triggers.yaml │ │ │ │ ├── duplicate-postsubmit │ │ │ │ └── .lighthouse │ │ │ │ │ ├── duplicate-lint │ │ │ │ │ └── triggers.yaml │ │ │ │ │ └── linter │ │ │ │ │ └── triggers.yaml │ │ │ │ ├── duplicate-presubmit │ │ │ │ └── .lighthouse │ │ │ │ │ ├── duplicate-lint │ │ │ │ │ └── triggers.yaml │ │ │ │ │ └── linter │ │ │ │ │ └── triggers.yaml │ │ │ │ ├── issue-1306 │ │ │ │ └── refs │ │ │ │ │ ├── master │ │ │ │ │ └── .lighthouse │ │ │ │ │ │ └── jenkins-x │ │ │ │ │ │ ├── pullrequest.yaml │ │ │ │ │ │ ├── shared-task.yaml │ │ │ │ │ │ └── triggers.yaml │ │ │ │ │ └── pr1 │ │ │ │ │ └── .lighthouse │ │ │ │ │ └── jenkins-x │ │ │ │ │ ├── pullrequest.yaml │ │ │ │ │ ├── shared-task.yaml │ │ │ │ │ └── triggers.yaml │ │ │ │ ├── loadtest │ │ │ │ └── .lighthouse │ │ │ │ │ ├── dummy │ │ │ │ │ └── README.md │ │ │ │ │ ├── jenkins-x │ │ │ │ │ └── triggers.yaml │ │ │ │ │ └── linter │ │ │ │ │ └── triggers.yaml │ │ │ │ └── myrepo │ │ │ │ └── .lighthouse │ │ │ │ ├── dummy │ │ │ │ └── README.md │ │ │ │ ├── jenkins-x │ │ │ │ ├── release.yaml │ │ │ │ ├── test.yaml │ │ │ │ └── triggers.yaml │ │ │ │ └── linter │ │ │ │ ├── lint.yaml │ │ │ │ └── triggers.yaml │ │ └── uses_resolver.go │ ├── merge │ │ ├── combine.go │ │ ├── combine_test.go │ │ ├── helpers.go │ │ ├── merge.go │ │ ├── merge_test.go │ │ └── test_data │ │ │ └── simple │ │ │ ├── expected-config.yaml │ │ │ ├── expected-plugins.yaml │ │ │ ├── source-config.yaml │ │ │ ├── source-plugins.yaml │ │ │ └── triggers.yaml │ ├── scmload │ │ └── test_data │ │ │ └── myorg │ │ │ ├── duplicate-postsubmit │ │ │ └── .lighthouse │ │ │ │ ├── duplicate-lint │ │ │ │ └── triggers.yaml │ │ │ │ └── linter │ │ │ │ └── triggers.yaml │ │ │ └── duplicate-presubmit │ │ │ └── .lighthouse │ │ │ ├── duplicate-lint │ │ │ └── triggers.yaml │ │ │ └── linter │ │ │ └── triggers.yaml │ └── types.go ├── util │ ├── constants.go │ ├── error_markdown.go │ ├── error_markdown_test.go │ ├── externalplugins.go │ ├── externalplugins_test.go │ ├── files.go │ ├── githubapp.go │ ├── go_mod_tidy_hack.go │ ├── hmac.go │ ├── hmac_test.go │ ├── naming.go │ ├── owner_tokens_dir.go │ ├── owner_tokens_dir_test.go │ ├── scmclient.go │ ├── scmclient_test.go │ ├── stopper.go │ ├── strings.go │ └── test_data │ │ └── secret_dir │ │ ├── git-token │ │ ├── github-app-github-github-aps-shoulderthunder-0 │ │ ├── hmac-token │ │ └── username ├── version │ └── info.go ├── watcher │ └── configmap_watcher.go └── webhook │ ├── create_agent.go │ ├── create_agent_integration_test.go │ ├── events.go │ ├── metrics.go │ ├── plugins.go │ ├── test_data │ ├── test_config.yaml │ └── test_plugins.yaml │ ├── webhook.go │ └── webhook_test.go └── test └── e2e ├── helpers.go ├── jenkins ├── helper.go ├── jenkins_test.go └── test_data │ ├── example-config.tmpl.yml │ ├── example-plugins.tmpl.yml │ ├── jenkins │ └── config.xml │ ├── main.go.failing │ └── repo │ ├── Jenkinsfile.template │ ├── build-pod.yaml │ └── main.go ├── tekton ├── tekton_test.go └── test_data │ ├── example-config.tmpl.yml │ ├── example-plugins.tmpl.yml │ ├── failingRepoScript.sh │ ├── passingRepoScript.sh │ ├── repo │ └── script.sh │ └── tekton │ └── pipelineAndTask.tmpl.yaml └── util └── copy.go /.dockerignore: -------------------------------------------------------------------------------- 1 | draft.toml 2 | target/classes 3 | target/generated-sources 4 | target/generated-test-sources 5 | target/maven-archiver 6 | target/maven-status 7 | target/surefire-reports 8 | target/test-classes 9 | target/*.original 10 | charts/ 11 | NOTICE 12 | LICENSE 13 | README.md -------------------------------------------------------------------------------- /.github/workflows/.mlc_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "ignorePatterns": [ 3 | { 4 | "pattern": "^http://127.0.0.1" 5 | }, 6 | { 7 | "pattern": "^http://localhost" 8 | }, 9 | { 10 | "pattern": "^https://api.github" 11 | }, 12 | { 13 | "pattern": "^https://github" 14 | }, 15 | { 16 | "pattern": "^https://git.k8s.io/" 17 | }, 18 | { 19 | "pattern": "^https://prow.k8s.io/" 20 | } 21 | ] 22 | } -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | name: "CodeQL" 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | schedule: 9 | # At 23:30 on Sunday 10 | - cron: '30 23 * * 0' 11 | 12 | jobs: 13 | analyze: 14 | name: Analyze 15 | runs-on: ubuntu-latest 16 | permissions: 17 | actions: read 18 | contents: read 19 | security-events: write 20 | 21 | strategy: 22 | fail-fast: false 23 | matrix: 24 | language: [ 'go' ] 25 | 26 | steps: 27 | - name: Checkout repository 28 | uses: actions/checkout@v3 29 | 30 | # Initializes the CodeQL tools for scanning. 31 | - name: Initialize CodeQL 32 | uses: github/codeql-action/init@v2 33 | with: 34 | languages: ${{ matrix.language }} 35 | 36 | - run: | 37 | make linux 38 | 39 | - name: Perform CodeQL Analysis 40 | uses: github/codeql-action/analyze@v2 41 | -------------------------------------------------------------------------------- /.github/workflows/pull-request.yml: -------------------------------------------------------------------------------- 1 | name: Pull Request Build 2 | 3 | on: 4 | pull_request: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | MarkdownLinkCheck: 10 | name: MarkdownLinkCheck 11 | runs-on: ubuntu-20.04 12 | steps: 13 | - uses: actions/checkout@master 14 | - uses: gaurav-nelson/github-action-markdown-link-check@v1 15 | with: 16 | use-quiet-mode: 'yes' 17 | config-file: '.github/workflows/.mlc_config.json' 18 | continue-on-error: true -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Binaries for programs and plugins 2 | *.exe 3 | *.dll 4 | *.so 5 | *.dylib 6 | 7 | # Test binary, build with `go test -c` 8 | *.test 9 | 10 | # Output of the go coverage tool, specifically when used with LiteIDE 11 | *.out 12 | 13 | debug 14 | 15 | # Project-local glide cache, RE: https://github.com/Masterminds/glide/issues/736 16 | .glide/ 17 | 18 | .idea/ 19 | *.iml 20 | 21 | .vscode/ 22 | 23 | #Various temporary created while building/running lighthose 24 | build/ 25 | bin/ 26 | test/e2e/build 27 | lighthouse-values.yaml 28 | jenkins-values.yaml 29 | 30 | # vim swap files 31 | *.swp 32 | 33 | #OSX system files. 34 | **/.DS_Store 35 | .history 36 | -------------------------------------------------------------------------------- /.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | *.png 23 | 24 | # known compile time folders 25 | target/ 26 | node_modules/ 27 | vendor/ -------------------------------------------------------------------------------- /.jx/updatebot.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: updatebot.jenkins-x.io/v1alpha1 2 | kind: UpdateConfig 3 | spec: 4 | rules: 5 | - urls: 6 | - https://github.com/jenkins-x/jx3-versions 7 | changes: 8 | - regex: 9 | pattern: | 10 | version: (.*) 11 | files: 12 | - "charts/jxgh/lighthouse/defaults.yaml" 13 | -------------------------------------------------------------------------------- /.lighthouse/jenkins-x/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: pr 6 | context: "pr" 7 | always_run: true 8 | optional: false 9 | trigger: "/test" 10 | rerun_command: "/retest" 11 | source: "pullrequest.yaml" 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | source: "release.yaml" 16 | branches: 17 | - ^main$ 18 | - ^master$ 19 | -------------------------------------------------------------------------------- /OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - maintainers 3 | reviewers: 4 | - maintainers -------------------------------------------------------------------------------- /OWNERS_ALIASES: -------------------------------------------------------------------------------- 1 | foreignAliases: 2 | - name: jx-community 3 | org: jenkins-x 4 | -------------------------------------------------------------------------------- /bdd/bbs/README.md: -------------------------------------------------------------------------------- 1 | ## BDD test using JX Boot with Lighthouse, long term storage and BitBucket Server -------------------------------------------------------------------------------- /bdd/bbs/cluster.yaml: -------------------------------------------------------------------------------- 1 | clusters: 2 | - name: lh-bdd-bbs 3 | args: 4 | - create 5 | - cluster 6 | - gke 7 | - --project-id=jenkins-x-bdd3 8 | - -m=n1-standard-2 9 | - --min-num-nodes=3 10 | - --max-num-nodes=5 11 | - -z=europe-west1-c 12 | - --skip-login 13 | - --skip-installation 14 | commands: 15 | - command: jx 16 | args: 17 | - boot 18 | - -b 19 | -------------------------------------------------------------------------------- /bdd/bbs/jx-requirements.yml: -------------------------------------------------------------------------------- 1 | cluster: 2 | clusterName: lh-bdd-bbs 3 | project: jenkins-x-bdd3 4 | provider: gke 5 | zone: europe-west1-c 6 | environmentGitOwner: jxbdd 7 | gitKind: bitbucketserver 8 | gitName: bs 9 | gitServer: https://bitbucket.beescloud.com 10 | environments: 11 | - key: dev 12 | owner: "" 13 | repository: "" 14 | - key: staging 15 | owner: "" 16 | repository: "" 17 | - key: production 18 | owner: "" 19 | repository: "" 20 | gitops: true 21 | ingress: 22 | domain: "" 23 | externalDNS: false 24 | tls: 25 | email: "" 26 | enabled: false 27 | production: false 28 | kaniko: true 29 | repository: nexus 30 | secretStorage: vault 31 | storage: 32 | logs: 33 | enabled: false 34 | url: "" 35 | reports: 36 | enabled: false 37 | url: "" 38 | vault: 39 | disableURLDiscovery: true 40 | webhook: lighthouse 41 | 42 | -------------------------------------------------------------------------------- /bdd/bbs/parameters.yaml: -------------------------------------------------------------------------------- 1 | adminUser: 2 | username: admin 3 | enableDocker: false 4 | gpg: {} 5 | pipelineUser: 6 | username: jenkins-x-bdd 7 | email: jenkins-x@googlegroups.com 8 | -------------------------------------------------------------------------------- /bdd/capture-failed-pod-logs.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | set -x 4 | 5 | mkdir -p extra-logs 6 | kubectl logs --tail=-1 "$(kubectl get pod -l app=lighthouse-keeper -o jsonpath='{.items[*].metadata.name}')" > extra-logs/keeper.log 7 | kubectl logs --tail=-1 "$(kubectl get pod -l app=lighthouse-foghorn -o jsonpath='{.items[*].metadata.name}')" > extra-logs/foghorn.log 8 | 9 | # Capture the appropriate optional controllers 10 | for controller in "$@"; do 11 | kubectl logs --tail=-1 "$(kubectl get pod -l "app=lighthouse-${controller}-controller" -o jsonpath='{.items[*].metadata.name}')" > "extra-logs/${controller}-controller.log" 12 | done 13 | lh_cnt=0 14 | for lh_pod in $(kubectl get pod -l app=lighthouse-webhooks -o jsonpath='{.items[*].metadata.name}'); do 15 | ((lh_cnt=lh_cnt+1)) 16 | kubectl logs --tail=-1 "${lh_pod}" > extra-logs/lh.${lh_cnt}.log 17 | done 18 | 19 | jx step stash -c lighthouse-tests -p "extra-logs/*.log" --bucket-url gs://jx-prod-logs 20 | -------------------------------------------------------------------------------- /bdd/ghe/README.md: -------------------------------------------------------------------------------- 1 | ## BDD test using JX Boot with Lighthouse, long term storage and GitHub Enterprise -------------------------------------------------------------------------------- /bdd/ghe/cluster.yaml: -------------------------------------------------------------------------------- 1 | clusters: 2 | - name: lh-bdd-ghe 3 | args: 4 | - create 5 | - cluster 6 | - gke 7 | - --project-id=jenkins-x-bdd3 8 | - -m=n1-standard-2 9 | - --min-num-nodes=3 10 | - --max-num-nodes=5 11 | - -z=europe-west1-c 12 | - --skip-login 13 | - --skip-installation 14 | commands: 15 | - command: jx 16 | args: 17 | - boot 18 | - -b 19 | -------------------------------------------------------------------------------- /bdd/ghe/jx-requirements.yml: -------------------------------------------------------------------------------- 1 | cluster: 2 | clusterName: lh-bdd-ghe 3 | devEnvApprovers: 4 | - dev2 5 | project: jenkins-x-bdd3 6 | provider: gke 7 | zone: europe-west1-c 8 | environmentGitOwner: dev1 9 | gitKind: github 10 | gitName: ghe 11 | gitServer: https://github.beescloud.com 12 | environments: 13 | - key: dev 14 | owner: "" 15 | repository: "" 16 | - key: staging 17 | owner: "" 18 | repository: "" 19 | - key: production 20 | owner: "" 21 | repository: "" 22 | gitops: true 23 | ingress: 24 | domain: "" 25 | externalDNS: false 26 | tls: 27 | email: "" 28 | enabled: false 29 | production: false 30 | kaniko: true 31 | repository: nexus 32 | secretStorage: vault 33 | storage: 34 | logs: 35 | enabled: false 36 | url: "" 37 | reports: 38 | enabled: false 39 | url: "" 40 | vault: 41 | disableURLDiscovery: true 42 | webhook: lighthouse 43 | 44 | -------------------------------------------------------------------------------- /bdd/ghe/parameters.yaml: -------------------------------------------------------------------------------- 1 | adminUser: 2 | username: admin 3 | enableDocker: false 4 | gpg: {} 5 | pipelineUser: 6 | username: dev1 7 | email: jenkins-x@googlegroups.com 8 | -------------------------------------------------------------------------------- /bdd/gitea/gitea.values.yaml.template: -------------------------------------------------------------------------------- 1 | ingress: 2 | enabled: true 3 | annotations: 4 | kubernetes.io/ingress.class: nginx 5 | hosts: 6 | - gitea.EXTERNAL_IP.nip.io 7 | 8 | gitea: 9 | admin: 10 | password: abcdEFGH 11 | 12 | config: 13 | service: 14 | DISABLE_REGISTRATION: true 15 | 16 | image: 17 | version: 1.13.0 18 | -------------------------------------------------------------------------------- /bdd/gitea/user.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "admin": true, 3 | "email": "USERNAME@example.com", 4 | "full_name": "USERNAME", 5 | "login_name": "USERNAME", 6 | "must_change_password": false, 7 | "password": "ab_d1234HIJKL", 8 | "send_notify": false, 9 | "source_id": 0, 10 | "username": "USERNAME" 11 | } 12 | -------------------------------------------------------------------------------- /bdd/gitea/values.yaml.template: -------------------------------------------------------------------------------- 1 | git: 2 | kind: {{ .Env.E2E_GIT_KIND }} 3 | name: {{ .Env.E2E_GIT_KIND }} 4 | server: {{ .Env.E2E_GIT_SERVER }} 5 | 6 | # the secret used for webhooks 7 | hmacToken: {{ .Env.E2E_HMAC_TOKEN }} 8 | 9 | # Default values for Go projects. 10 | # This is a YAML-formatted file. 11 | # Declare variables to be passed into your templates. 12 | image: 13 | tag: {{ .Env.VERSION }} 14 | 15 | user: {{ .Env.E2E_PRIMARY_SCM_USER }} 16 | 17 | oauthToken: {{ .Env.E2E_PRIMARY_SCM_TOKEN }} 18 | 19 | engines: 20 | jx: false 21 | tekton: true 22 | 23 | webhooks: 24 | ingress: 25 | enabled: true 26 | annotations: 27 | kubernetes.io/ingress.class: nginx 28 | hosts: 29 | - hook.{{ .Env.EXTERNAL_IP }}.nip.io 30 | 31 | # we need this for the tests 32 | serviceName: hook 33 | -------------------------------------------------------------------------------- /bdd/github/README.md: -------------------------------------------------------------------------------- 1 | ## BDD test using JX Boot with Vault, Lighthouse and long term storage -------------------------------------------------------------------------------- /bdd/github/cluster.yaml: -------------------------------------------------------------------------------- 1 | clusters: 2 | - name: lh-bdd-github 3 | args: 4 | - create 5 | - cluster 6 | - gke 7 | - --project-id=jenkins-x-bdd3 8 | - -m=n1-standard-2 9 | - --min-num-nodes=3 10 | - --max-num-nodes=5 11 | - -z=europe-west1-c 12 | - --skip-login 13 | - --skip-installation 14 | commands: 15 | - command: jx 16 | args: 17 | - boot 18 | - -b 19 | -------------------------------------------------------------------------------- /bdd/github/jx-requirements.yml: -------------------------------------------------------------------------------- 1 | cluster: 2 | clusterName: lh-bdd-github 3 | devEnvApprovers: 4 | - jenkins-x-bot-test 5 | environmentGitOwner: lighthouse-bot-test 6 | project: jenkins-x-bdd3 7 | provider: gke 8 | zone: europe-west1-c 9 | environments: 10 | - key: dev 11 | owner: "" 12 | repository: "" 13 | - key: staging 14 | owner: "" 15 | repository: "" 16 | - key: production 17 | owner: "" 18 | repository: "" 19 | gitops: true 20 | ingress: 21 | domain: "" 22 | externalDNS: false 23 | tls: 24 | email: "" 25 | enabled: false 26 | production: false 27 | kaniko: true 28 | repository: nexus 29 | secretStorage: vault 30 | storage: 31 | logs: 32 | enabled: false 33 | url: "" 34 | reports: 35 | enabled: false 36 | url: "" 37 | vault: 38 | disableURLDiscovery: true 39 | webhook: lighthouse 40 | 41 | -------------------------------------------------------------------------------- /bdd/github/parameters.yaml: -------------------------------------------------------------------------------- 1 | adminUser: 2 | username: admin 3 | enableDocker: false 4 | gitProvider: github 5 | gpg: {} 6 | pipelineUser: 7 | github: 8 | host: github.com 9 | username: jenkins-x-versions-bot-test 10 | email: jenkins-x@googlegroups.com 11 | -------------------------------------------------------------------------------- /bdd/gitlab/README.md: -------------------------------------------------------------------------------- 1 | ## BDD test using JX Boot with Lighthouse, long term storage and GitLab -------------------------------------------------------------------------------- /bdd/gitlab/cluster.yaml: -------------------------------------------------------------------------------- 1 | clusters: 2 | - name: lh-bdd-gl 3 | args: 4 | - create 5 | - cluster 6 | - gke 7 | - --project-id=jenkins-x-bdd3 8 | - -m=n1-standard-2 9 | - --min-num-nodes=3 10 | - --max-num-nodes=5 11 | - -z=europe-west1-c 12 | - --skip-login 13 | - --skip-installation 14 | commands: 15 | - command: jx 16 | args: 17 | - boot 18 | - -b 19 | -------------------------------------------------------------------------------- /bdd/gitlab/jx-requirements.yml: -------------------------------------------------------------------------------- 1 | cluster: 2 | clusterName: lh-bdd-gl 3 | devEnvApprovers: 4 | - jenkins-x-bot-1 5 | project: jenkins-x-bdd3 6 | provider: gke 7 | zone: europe-west1-c 8 | environmentGitOwner: jxbdd 9 | gitKind: gitlab 10 | gitName: gl 11 | gitServer: https://gitlab.com 12 | environments: 13 | - key: dev 14 | owner: "" 15 | repository: "" 16 | - key: staging 17 | owner: "" 18 | repository: "" 19 | - key: production 20 | owner: "" 21 | repository: "" 22 | gitops: true 23 | ingress: 24 | domain: "" 25 | externalDNS: false 26 | tls: 27 | email: "" 28 | enabled: false 29 | production: false 30 | kaniko: true 31 | repository: nexus 32 | secretStorage: vault 33 | storage: 34 | logs: 35 | enabled: false 36 | url: "" 37 | reports: 38 | enabled: false 39 | url: "" 40 | vault: 41 | disableURLDiscovery: true 42 | webhook: lighthouse 43 | 44 | -------------------------------------------------------------------------------- /bdd/gitlab/parameters.yaml: -------------------------------------------------------------------------------- 1 | adminUser: 2 | username: admin 3 | enableDocker: false 4 | gpg: {} 5 | pipelineUser: 6 | username: jenkins-x-bot-test 7 | email: jenkins-x@googlegroups.com 8 | -------------------------------------------------------------------------------- /bdd/helm-requirements.yaml.template: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - name: jxboot-resources 3 | repository: http://chartmuseum.jenkins-x.io 4 | - alias: tekton 5 | name: tekton 6 | repository: http://chartmuseum.jenkins-x.io 7 | - alias: prow 8 | condition: prow.enabled 9 | name: prow 10 | repository: http://chartmuseum.jenkins-x.io 11 | - alias: lighthouse 12 | condition: lighthouse.enabled 13 | name: lighthouse 14 | repository: https://chartmuseum.jenkins-x.io 15 | version: $VERSION 16 | - alias: lighthouse-jx 17 | condition: lighthouse.enabled 18 | name: lighthouse-jx 19 | repository: http://chartmuseum.jenkins-x.io 20 | - alias: bucketrepo 21 | condition: bucketrepo.enabled 22 | name: bucketrepo 23 | repository: http://chartmuseum.jenkins-x.io 24 | - name: jenkins-x-platform 25 | repository: http://chartmuseum.jenkins-x.io 26 | -------------------------------------------------------------------------------- /bdd/jenkins/jenkins-values.yaml.template: -------------------------------------------------------------------------------- 1 | master: 2 | JCasC: 3 | configScripts: 4 | security: | 5 | jenkins: 6 | securityRealm: 7 | local: 8 | allowsSignup: false 9 | users: 10 | - id: "{{ .Env.E2E_JENKINS_USER }}" 11 | password: "{{ .Env.E2E_JENKINS_PASSWORD }}" 12 | authorizationStrategy: loggedInUsersCanDoAnything 13 | ingress: 14 | enabled: true 15 | path: "/" 16 | annotations: 17 | kubernetes.io/ingress.class: nginx 18 | hostName: "{{ .Env.E2E_JENKINS_HOSTNAME }}.{{ .Env.EXTERNAL_IP }}.nip.io" 19 | -------------------------------------------------------------------------------- /bdd/jenkins/lighthouse-values.yaml.template: -------------------------------------------------------------------------------- 1 | git: 2 | kind: {{ .Env.E2E_GIT_KIND }} 3 | name: {{ .Env.E2E_GIT_KIND }} 4 | server: {{ .Env.E2E_GIT_SERVER }} 5 | 6 | # the secret used for webhooks 7 | hmacToken: {{ .Env.E2E_HMAC_TOKEN }} 8 | 9 | # Default values for Go projects. 10 | # This is a YAML-formatted file. 11 | # Declare variables to be passed into your templates. 12 | image: 13 | tag: {{ .Env.VERSION }} 14 | 15 | user: {{ .Env.E2E_PRIMARY_SCM_USER }} 16 | oauthToken: {{ .Env.E2E_PRIMARY_SCM_TOKEN }} 17 | 18 | engines: 19 | jx: false 20 | tekton: false 21 | jenkins: true 22 | 23 | jenkinscontroller: 24 | jenkinsURL: "{{ .Env.E2E_JENKINS_URL }}" 25 | jenkinsUser: "{{ .Env.E2E_JENKINS_USER }}" 26 | jenkinsToken: "{{ .Env.E2E_JENKINS_API_TOKEN }}" 27 | 28 | webhooks: 29 | ingress: 30 | enabled: true 31 | annotations: 32 | kubernetes.io/ingress.class: nginx 33 | hosts: 34 | - lh-test-hook.{{ .Env.EXTERNAL_IP }}.nip.io 35 | serviceName: hook 36 | 37 | cluster: 38 | crds: 39 | create: {{ .Env.E2E_CREATE_LIGHTHOUSE_CRD }} 40 | 41 | configMaps: 42 | create: true 43 | -------------------------------------------------------------------------------- /bdd/lh-jx-values.yaml: -------------------------------------------------------------------------------- 1 | # Specifying environment variable for link to build reports 2 | env: 3 | JX_DEFAULT_IMAGE: "" 4 | LIGHTHOUSE_REPORT_URL_BASE: "https://example.com" 5 | -------------------------------------------------------------------------------- /bdd/tekton/values.yaml.template: -------------------------------------------------------------------------------- 1 | git: 2 | kind: {{ .Env.E2E_GIT_KIND }} 3 | name: {{ .Env.E2E_GIT_KIND }} 4 | server: {{ .Env.E2E_GIT_SERVER }} 5 | 6 | # the secret used for webhooks 7 | hmacToken: {{ .Env.E2E_HMAC_TOKEN }} 8 | 9 | # Default values for Go projects. 10 | # This is a YAML-formatted file. 11 | # Declare variables to be passed into your templates. 12 | image: 13 | tag: {{ .Env.VERSION }} 14 | 15 | user: {{ .Env.E2E_PRIMARY_SCM_USER }} 16 | 17 | oauthToken: {{ .Env.E2E_PRIMARY_SCM_TOKEN }} 18 | 19 | engines: 20 | jx: false 21 | tekton: true 22 | 23 | webhooks: 24 | ingress: 25 | enabled: true 26 | annotations: 27 | kubernetes.io/ingress.class: nginx 28 | hosts: 29 | - hook.{{ .Env.EXTERNAL_IP }}.nip.io 30 | 31 | # we need this for the tests 32 | serviceName: hook 33 | -------------------------------------------------------------------------------- /bdd/values.yaml.template: -------------------------------------------------------------------------------- 1 | # Override the lighthouse image tag 2 | image: 3 | tag: $VERSION 4 | pullPolicy: IfNotPresent 5 | 6 | # Override the tide image tag 7 | tide: 8 | image: 9 | tag: $VERSION 10 | pullPolicy: IfNotPresent 11 | 12 | vault: 13 | {{- if eq .Requirements.secretStorage "vault" }} 14 | enabled: true 15 | {{- else }} 16 | enabled: false 17 | {{- end }} 18 | 19 | clusterName: {{ .Requirements.cluster.clusterName }} 20 | 21 | user: "{{ .Parameters.pipelineUser.username }}" 22 | 23 | oauthToken: "{{ .Parameters.pipelineUser.token }}" 24 | 25 | # Specifying environment variable for link to build reports 26 | env: 27 | JX_DEFAULT_IMAGE: "" 28 | LIGHTHOUSE_REPORT_URL_BASE: "https://example.com" 29 | -------------------------------------------------------------------------------- /charts/lighthouse/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | # Project files 23 | Makefile 24 | OWNERS 25 | README.md.gotmpl 26 | -------------------------------------------------------------------------------- /charts/lighthouse/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | description: | 3 | This chart bootstraps installation of [Lighthouse](https://github.com/jenkins-x/lighthouse). 4 | icon: https://raw.githubusercontent.com/jenkins-x/jenkins-x-website/master/images/logo/jenkinsx-icon-color.svg 5 | name: lighthouse 6 | version: 0.1.0-SNAPSHOT 7 | home: https://github.com/jenkins-x/lighthouse 8 | 9 | -------------------------------------------------------------------------------- /charts/lighthouse/config/lighthousebreakpoints.lighthouse.jenkins.io-v1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: 4 | name: lighthousebreakpoints.lighthouse.jenkins.io 5 | spec: 6 | group: lighthouse.jenkins.io 7 | versions: 8 | - name: v1alpha1 9 | served: true 10 | storage: true 11 | subresources: 12 | status: {} 13 | schema: 14 | openAPIV3Schema: 15 | type: object 16 | # One can use x-kubernetes-preserve-unknown-fields: true 17 | # at the root of the schema (and inside any properties, additionalProperties) 18 | # to get the traditional CRD behaviour that nothing is pruned, despite 19 | # setting spec.preserveUnknownProperties: false. 20 | # 21 | # See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/ 22 | # See issue: https://github.com/knative/serving/issues/912 23 | x-kubernetes-preserve-unknown-fields: true 24 | names: 25 | kind: LighthouseBreakpoint 26 | singular: lighthousebreakpoint 27 | plural: lighthousebreakpoints 28 | shortNames: 29 | - lhbp 30 | scope: Namespaced 31 | 32 | -------------------------------------------------------------------------------- /charts/lighthouse/config/lighthousebreakpoints.lighthouse.jenkins.io.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1beta1 2 | kind: CustomResourceDefinition 3 | metadata: 4 | name: lighthousebreakpoints.lighthouse.jenkins.io 5 | spec: 6 | group: lighthouse.jenkins.io 7 | names: 8 | kind: LighthouseBreakpoint 9 | singular: lighthousebreakpoint 10 | plural: lighthousebreakpoints 11 | shortNames: 12 | - lhbp 13 | scope: Namespaced 14 | subresources: 15 | status: {} 16 | version: v1alpha1 17 | -------------------------------------------------------------------------------- /charts/lighthouse/config/lighthousejobs.lighthouse.jenkins.io-v1.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: 4 | name: lighthousejobs.lighthouse.jenkins.io 5 | spec: 6 | group: lighthouse.jenkins.io 7 | versions: 8 | - name: v1alpha1 9 | served: true 10 | storage: true 11 | subresources: 12 | status: {} 13 | schema: 14 | openAPIV3Schema: 15 | type: object 16 | # One can use x-kubernetes-preserve-unknown-fields: true 17 | # at the root of the schema (and inside any properties, additionalProperties) 18 | # to get the traditional CRD behaviour that nothing is pruned, despite 19 | # setting spec.preserveUnknownProperties: false. 20 | # 21 | # See https://kubernetes.io/blog/2019/06/20/crd-structural-schema/ 22 | # See issue: https://github.com/knative/serving/issues/912 23 | x-kubernetes-preserve-unknown-fields: true 24 | names: 25 | kind: LighthouseJob 26 | singular: lighthousejob 27 | plural: lighthousejobs 28 | shortNames: 29 | - lhjob 30 | scope: Namespaced 31 | 32 | -------------------------------------------------------------------------------- /charts/lighthouse/config/lighthousejobs.lighthouse.jenkins.io.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1beta1 2 | kind: CustomResourceDefinition 3 | metadata: 4 | name: lighthousejobs.lighthouse.jenkins.io 5 | spec: 6 | group: lighthouse.jenkins.io 7 | names: 8 | kind: LighthouseJob 9 | singular: lighthousejob 10 | plural: lighthousejobs 11 | shortNames: 12 | - lhjob 13 | scope: Namespaced 14 | subresources: 15 | status: {} 16 | version: v1alpha1 17 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Lighthouse has been installed successfully. 2 | 3 | To verify pods have started, run: 4 | 5 | kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "foghorn.name" . }}" 6 | kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "keeper.name" . }}" 7 | kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "webhooks.name" . }}" 8 | {{- if .Values.engines.tekton }} 9 | kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "tektoncontroller.name" . }}" 10 | {{- end }} 11 | {{- if .Values.engines.jenkins }} 12 | kubectl --namespace={{ .Release.Namespace }} get pods -l "app={{ template "jenkinscontroller.name" . }}" 13 | {{- end }} 14 | 15 | {{- if .Values.createIngress }} 16 | To get the application URL, run: 17 | 18 | kubectl get ingress {{ template "fullname" . }} 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/config-external-plugins.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: lighthouse-external-plugins 5 | labels: 6 | app: {{ template "fullname" . }} 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 8 | release: "{{ .Release.Name }}" 9 | data: 10 | config.yaml: |- 11 | {{ toYaml .Values.externalPlugins | indent 4 }} 12 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/foghorn-rb.yaml: -------------------------------------------------------------------------------- 1 | kind: RoleBinding 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: {{ template "foghorn.name" . }} 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: {{ template "foghorn.name" . }} 9 | subjects: 10 | - kind: ServiceAccount 11 | name: {{ template "foghorn.name" . }} 12 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/foghorn-role.yaml: -------------------------------------------------------------------------------- 1 | kind: Role 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: {{ template "foghorn.name" . }} 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - namespaces 10 | - configmaps 11 | - secrets 12 | verbs: 13 | - get 14 | - list 15 | - watch 16 | - apiGroups: 17 | - lighthouse.jenkins.io 18 | resources: 19 | - lighthousejobs 20 | verbs: 21 | - create 22 | - delete 23 | - list 24 | - update 25 | - get 26 | - watch 27 | - patch 28 | - apiGroups: 29 | - lighthouse.jenkins.io 30 | resources: 31 | - lighthousejobs/status 32 | verbs: 33 | - create 34 | - delete 35 | - list 36 | - update 37 | - get 38 | - watch 39 | - patch 40 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/foghorn-sa.yaml: -------------------------------------------------------------------------------- 1 | kind: ServiceAccount 2 | apiVersion: v1 3 | metadata: 4 | name: {{ template "foghorn.name" . }} 5 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/gc-jobs-rb.yaml: -------------------------------------------------------------------------------- 1 | kind: RoleBinding 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: {{ template "gcJobs.name" . }} 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: {{ template "gcJobs.name" . }} 9 | subjects: 10 | - kind: ServiceAccount 11 | name: {{ template "gcJobs.name" . }} 12 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/gc-jobs-role.yaml: -------------------------------------------------------------------------------- 1 | kind: Role 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: {{ template "gcJobs.name" . }} 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - namespaces 10 | - configmaps 11 | - secrets 12 | verbs: 13 | - get 14 | - list 15 | - watch 16 | - apiGroups: 17 | - lighthouse.jenkins.io 18 | resources: 19 | - lighthousejobs 20 | verbs: 21 | - create 22 | - delete 23 | - list 24 | - update 25 | - get 26 | - watch 27 | - patch 28 | - apiGroups: 29 | - lighthouse.jenkins.io 30 | resources: 31 | - lighthousejobs/status 32 | verbs: 33 | - create 34 | - delete 35 | - list 36 | - update 37 | - get 38 | - watch 39 | - patch 40 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/gc-jobs-sa.yaml: -------------------------------------------------------------------------------- 1 | kind: ServiceAccount 2 | apiVersion: v1 3 | metadata: 4 | name: {{ template "gcJobs.name" . }} 5 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/hmacsecret.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.hmacTokenEnabled (not .Values.hmacSecretName) }} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: lighthouse-hmac-token 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | type: Opaque 12 | data: 13 | hmac: {{ default "" .Values.hmacToken | b64enc | quote }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/jenkins-controller-rb.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.jenkins }} 2 | kind: RoleBinding 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: {{ template "jenkinscontroller.name" . }} 6 | roleRef: 7 | apiGroup: rbac.authorization.k8s.io 8 | kind: Role 9 | name: {{ template "jenkinscontroller.name" . }} 10 | subjects: 11 | - kind: ServiceAccount 12 | name: {{ template "jenkinscontroller.name" . }} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/jenkins-controller-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.jenkins }} 2 | kind: Role 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: {{ template "jenkinscontroller.name" . }} 6 | rules: 7 | - apiGroups: 8 | - "" 9 | resources: 10 | - namespaces 11 | - configmaps 12 | - secrets 13 | verbs: 14 | - get 15 | - update 16 | - create 17 | - list 18 | - watch 19 | - apiGroups: 20 | - lighthouse.jenkins.io 21 | resources: 22 | - lighthousejobs 23 | verbs: 24 | - get 25 | - update 26 | - list 27 | - watch 28 | - apiGroups: 29 | - lighthouse.jenkins.io 30 | resources: 31 | - lighthousejobs/status 32 | verbs: 33 | - update 34 | - get 35 | - watch 36 | - patch 37 | {{- end }} 38 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/jenkins-controller-sa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.jenkins }} 2 | kind: ServiceAccount 3 | apiVersion: v1 4 | metadata: 5 | name: {{ template "jenkinscontroller.name" . }} 6 | {{- end }} 7 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/jenkins-controller-secret.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.jenkins }} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: lighthouse-jenkins-token 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | type: Opaque 12 | data: 13 | token: {{ default "" .Values.jenkinscontroller.jenkinsToken | b64enc | quote }} 14 | {{- end }} -------------------------------------------------------------------------------- /charts/lighthouse/templates/jenkins-controller-service.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.jenkins }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ template "jenkinscontroller.name" . }} 6 | labels: 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" 8 | {{- with .Values.jenkinscontroller.service.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | spec: 13 | type: ClusterIP 14 | ports: 15 | - port: 8080 16 | targetPort: logs 17 | protocol: TCP 18 | name: logs 19 | selector: 20 | app: {{ template "jenkinscontroller.name" . }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/keeper-rb.yaml: -------------------------------------------------------------------------------- 1 | kind: RoleBinding 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: {{ template "keeper.name" . }} 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: {{ template "keeper.name" . }} 9 | subjects: 10 | - kind: ServiceAccount 11 | name: {{ template "keeper.name" . }} 12 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/keeper-role.yaml: -------------------------------------------------------------------------------- 1 | kind: Role 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: {{ template "keeper.name" . }} 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | - namespaces 10 | - configmaps 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | {{- if .Values.engines.tekton }} 16 | - apiGroups: 17 | - tekton.dev 18 | resources: 19 | - pipelineresources 20 | - tasks 21 | - pipelines 22 | - pipelineruns 23 | verbs: 24 | - create 25 | - list 26 | - get 27 | - update 28 | - watch 29 | - patch 30 | - delete 31 | {{- end }} 32 | - apiGroups: 33 | - lighthouse.jenkins.io 34 | resources: 35 | - lighthousejobs 36 | verbs: 37 | - create 38 | - delete 39 | - list 40 | - update 41 | - get 42 | - watch 43 | - patch 44 | - apiGroups: 45 | - lighthouse.jenkins.io 46 | resources: 47 | - lighthousejobs/status 48 | verbs: 49 | - create 50 | - delete 51 | - list 52 | - update 53 | - get 54 | - watch 55 | - patch 56 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/keeper-sa.yaml: -------------------------------------------------------------------------------- 1 | kind: ServiceAccount 2 | apiVersion: v1 3 | metadata: 4 | name: {{ template "keeper.name" . }} 5 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/keeper-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ template "keeper.name" . }} 5 | {{- if .Values.keeper.service.annotations }} 6 | annotations: 7 | {{ toYaml .Values.keeper.service.annotations | indent 4 }} 8 | {{- end }} 9 | spec: 10 | type: {{ .Values.keeper.service.type }} 11 | selector: 12 | app: {{ template "keeper.name" . }} 13 | ports: 14 | - port: {{ .Values.keeper.service.externalPort }} 15 | targetPort: {{ .Values.keeper.service.internalPort }} 16 | protocol: TCP 17 | name: http 18 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/lighthousebreakpoints-crd.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.cluster.crds.create }} 2 | {{- if .Capabilities.APIVersions.Has "apiextensions.k8s.io/v1" }} 3 | {{ .Files.Get "config/lighthousebreakpoints.lighthouse.jenkins.io-v1.yaml" }} 4 | {{- else }} 5 | {{ .Files.Get "config/lighthousebreakpoints.lighthouse.jenkins.io.yaml" }} 6 | {{- end }} 7 | 8 | {{- end -}} 9 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/lighthousejobs-crd.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.cluster.crds.create }} 2 | {{- if .Capabilities.APIVersions.Has "apiextensions.k8s.io/v1" }} 3 | {{ .Files.Get "config/lighthousejobs.lighthouse.jenkins.io-v1.yaml" }} 4 | {{- else }} 5 | {{ .Files.Get "config/lighthousejobs.lighthouse.jenkins.io.yaml" }} 6 | {{- end }} 7 | 8 | {{- end -}} 9 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/oauthsecret.yaml: -------------------------------------------------------------------------------- 1 | {{- if not .Values.oauthSecretName }} 2 | apiVersion: v1 3 | kind: Secret 4 | metadata: 5 | name: lighthouse-oauth-token 6 | labels: 7 | app: {{ template "fullname" . }} 8 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 9 | release: "{{ .Release.Name }}" 10 | heritage: "{{ .Release.Service }}" 11 | type: Opaque 12 | data: 13 | oauth: {{ default "" .Values.oauthToken | b64enc | quote }} 14 | {{- end }} -------------------------------------------------------------------------------- /charts/lighthouse/templates/poller-rb.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.poller.enabled }} 2 | kind: RoleBinding 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: {{ template "poller.name" . }} 6 | roleRef: 7 | apiGroup: rbac.authorization.k8s.io 8 | kind: Role 9 | name: {{ template "poller.name" . }} 10 | subjects: 11 | - kind: ServiceAccount 12 | name: {{ template "poller.name" . }} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/poller-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.poller.enabled }} 2 | kind: Role 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: {{ template "poller.name" . }} 6 | rules: 7 | - apiGroups: 8 | - "" 9 | resources: 10 | - namespaces 11 | - configmaps 12 | verbs: 13 | - get 14 | - list 15 | - watch 16 | {{- end }} 17 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/poller-sa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.poller.enabled }} 2 | kind: ServiceAccount 3 | apiVersion: v1 4 | metadata: 5 | name: {{ template "poller.name" . }} 6 | {{- end }} 7 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/tekton-controller-rb.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.tekton }} 2 | kind: RoleBinding 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: {{ template "tektoncontroller.name" . }} 6 | roleRef: 7 | apiGroup: rbac.authorization.k8s.io 8 | kind: Role 9 | name: {{ template "tektoncontroller.name" . }} 10 | subjects: 11 | - kind: ServiceAccount 12 | name: {{ template "tektoncontroller.name" . }} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/tekton-controller-role.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.tekton }} 2 | kind: Role 3 | apiVersion: rbac.authorization.k8s.io/v1 4 | metadata: 5 | name: {{ template "tektoncontroller.name" . }} 6 | rules: 7 | - apiGroups: 8 | - tekton.dev 9 | resources: 10 | - pipelines 11 | - taskruns 12 | verbs: 13 | - get 14 | - apiGroups: 15 | - tekton.dev 16 | resources: 17 | - pipelineruns 18 | verbs: 19 | - create 20 | - list 21 | - get 22 | - watch 23 | {{- if .Values.tektoncontroller.enableRerunStatusUpdate }} 24 | - update 25 | {{- end }} 26 | - apiGroups: 27 | - lighthouse.jenkins.io 28 | resources: 29 | - lighthousebreakpoints 30 | - lighthousejobs 31 | verbs: 32 | {{- if .Values.tektoncontroller.enableRerunStatusUpdate }} 33 | - create 34 | {{- end }} 35 | - get 36 | - update 37 | - list 38 | - watch 39 | - apiGroups: 40 | - lighthouse.jenkins.io 41 | resources: 42 | - lighthousejobs/status 43 | verbs: 44 | - update 45 | - get 46 | - watch 47 | - patch 48 | {{- end }} 49 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/tekton-controller-sa.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.tekton }} 2 | kind: ServiceAccount 3 | apiVersion: v1 4 | metadata: 5 | name: {{ template "tektoncontroller.name" . }} 6 | {{- end }} 7 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/tekton-controller-service.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.engines.tekton }} 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: {{ template "tektoncontroller.name" . }} 6 | labels: 7 | chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" 8 | {{- with .Values.tektoncontroller.service.annotations }} 9 | annotations: 10 | {{- toYaml . | nindent 4 }} 11 | {{- end }} 12 | spec: 13 | type: ClusterIP 14 | ports: 15 | - port: 8080 16 | targetPort: metrics 17 | protocol: TCP 18 | name: metrics 19 | selector: 20 | app: {{ template "tektoncontroller.name" . }} 21 | {{- end }} 22 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/tide-githubapp-secrets.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.githubApp.enabled }} 2 | apiVersion: v1 3 | kind: Secret 4 | type: Opaque 5 | metadata: 6 | name: tide-githubapp-tokens 7 | labels: 8 | app: {{ template "fullname" . }} 9 | chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" 10 | release: "{{ .Release.Name }}" 11 | heritage: "{{ .Release.Service }}" 12 | data: 13 | username: {{ default "jenkins-x[bot]" .Values.githubApp.username | b64enc | quote }} 14 | {{- end }} 15 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/webhooks-rb.yaml: -------------------------------------------------------------------------------- 1 | kind: RoleBinding 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: {{ template "webhooks.name" . }} 5 | roleRef: 6 | apiGroup: rbac.authorization.k8s.io 7 | kind: Role 8 | name: {{ template "webhooks.name" . }} 9 | subjects: 10 | - kind: ServiceAccount 11 | name: {{ template "webhooks.name" . }} 12 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/webhooks-role.yaml: -------------------------------------------------------------------------------- 1 | kind: Role 2 | apiVersion: rbac.authorization.k8s.io/v1 3 | metadata: 4 | name: {{ template "webhooks.name" . }} 5 | rules: 6 | - apiGroups: 7 | - "" 8 | resources: 9 | {{- if eq .Values.scope "cluster" }} 10 | - namespaces 11 | {{- end }} 12 | - configmaps 13 | - secrets 14 | verbs: 15 | - get 16 | - update 17 | - create 18 | - list 19 | - watch 20 | - patch 21 | - delete 22 | - apiGroups: 23 | - "" 24 | resources: 25 | - services 26 | verbs: 27 | - get 28 | - list 29 | - watch 30 | - apiGroups: 31 | - batch 32 | resources: 33 | - cronjobs 34 | verbs: 35 | - get 36 | - update 37 | - create 38 | - list 39 | - watch 40 | - patch 41 | - delete 42 | - apiGroups: 43 | - lighthouse.jenkins.io 44 | resources: 45 | - lighthousejobs 46 | verbs: 47 | - create 48 | - delete 49 | - list 50 | - update 51 | - get 52 | - watch 53 | - patch 54 | - apiGroups: 55 | - lighthouse.jenkins.io 56 | resources: 57 | - lighthousejobs/status 58 | verbs: 59 | - create 60 | - delete 61 | - list 62 | - update 63 | - get 64 | - watch 65 | - patch 66 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/webhooks-sa.yaml: -------------------------------------------------------------------------------- 1 | kind: ServiceAccount 2 | apiVersion: v1 3 | metadata: 4 | name: {{ template "webhooks.name" . }} 5 | -------------------------------------------------------------------------------- /charts/lighthouse/templates/webhooks-service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: {{ default (include "webhooks.name" .) .Values.webhooks.serviceName }} 5 | labels: 6 | chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" 7 | annotations: 8 | {{- toYaml .Values.webhooks.service.annotations | nindent 4 }} 9 | spec: 10 | type: {{ .Values.webhooks.service.type }} 11 | ports: 12 | - port: {{ .Values.webhooks.service.externalPort }} 13 | targetPort: {{ .Values.webhooks.service.internalPort }} 14 | protocol: TCP 15 | name: http 16 | selector: 17 | app: {{ template "webhooks.name" . }} 18 | {{ with .Values.webhooks.service.loadBalancerSourceRanges }} 19 | loadBalancerSourceRanges: {{ toYaml . | nindent 2 }} 20 | {{ end }} 21 | -------------------------------------------------------------------------------- /cmd/keeper/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs at https://go.k8s.io/owners 2 | 3 | labels: 4 | - area/prow/tide 5 | -------------------------------------------------------------------------------- /cmd/keeper/status-context.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/lighthouse/2cf34fe624e653952216588ea35efaa26f155861/cmd/keeper/status-context.png -------------------------------------------------------------------------------- /dependency-matrix/matrix.md: -------------------------------------------------------------------------------- 1 | # Dependency Matrix 2 | 3 | Dependency | Sources | Version | Mismatched versions 4 | ---------- | ------- | ------- | ------------------- 5 | [jenkins-x/go-scm](https://github.com/jenkins-x/go-scm) | | [1.5.223]() | 6 | -------------------------------------------------------------------------------- /dependency-matrix/matrix.yaml: -------------------------------------------------------------------------------- 1 | dependencies: 2 | - host: github.com 3 | owner: jenkins-x 4 | repo: go-scm 5 | url: https://github.com/jenkins-x/go-scm 6 | version: 1.5.223 7 | versionURL: "" 8 | -------------------------------------------------------------------------------- /docker/foghorn/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17 2 | 3 | RUN apk add --update --no-cache ca-certificates git \ 4 | && adduser -D -u 1000 jx 5 | 6 | ENV JX_HOME /home/jx 7 | USER 1000 8 | 9 | COPY ./bin/foghorn /home/jx/ 10 | ENTRYPOINT ["/home/jx/foghorn"] 11 | -------------------------------------------------------------------------------- /docker/gc/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17 2 | 3 | RUN apk add --update --no-cache ca-certificates git \ 4 | && adduser -D -u 1000 jx 5 | 6 | ENV JX_HOME /home/jx 7 | USER 1000 8 | 9 | COPY ./bin/gc-jobs /home/jx/ 10 | ENTRYPOINT ["/home/jx/gc-jobs"] 11 | -------------------------------------------------------------------------------- /docker/jenkins/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17 2 | 3 | RUN apk add --update --no-cache ca-certificates git \ 4 | && adduser -D -u 1000 jx 5 | 6 | USER 1000 7 | 8 | COPY ./bin/jenkins-controller /home/jx/ 9 | ENTRYPOINT ["/home/jx/jenkins-controller"] 10 | -------------------------------------------------------------------------------- /docker/keeper/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17 2 | 3 | RUN apk add --update --no-cache ca-certificates git \ 4 | && adduser -D -u 1000 jx 5 | 6 | USER 1000 7 | 8 | COPY ./bin/keeper /home/jx/ 9 | ENTRYPOINT ["/home/jx/keeper"] 10 | -------------------------------------------------------------------------------- /docker/poller/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17 2 | 3 | RUN apk add --update --no-cache ca-certificates git \ 4 | && adduser -D -u 1000 jx 5 | 6 | ENV JX_HOME /home/jx 7 | USER 1000 8 | 9 | COPY ./bin/poller /home/jx/ 10 | ENTRYPOINT ["/home/jx/poller"] 11 | -------------------------------------------------------------------------------- /docker/tekton/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17 2 | 3 | RUN apk add --update --no-cache ca-certificates git \ 4 | && adduser -D -u 1000 jx 5 | 6 | USER 1000 7 | 8 | COPY ./bin/lighthouse-tekton-controller /home/jx/ 9 | ENTRYPOINT ["/home/jx/lighthouse-tekton-controller"] 10 | -------------------------------------------------------------------------------- /docker/webhooks/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM alpine:3.17 2 | 3 | RUN apk add --update --no-cache ca-certificates git \ 4 | && adduser -D -u 1000 jx 5 | 6 | ENV JX_HOME /home/jx 7 | USER 1000 8 | 9 | COPY ./bin/webhooks /home/jx/ 10 | ENTRYPOINT ["/home/jx/webhooks"] 11 | -------------------------------------------------------------------------------- /docs/config/README.md: -------------------------------------------------------------------------------- 1 | # Configuration docs 2 | 3 | Here you will find docs for the Lighthouse configuration main elements: 4 | - [Lighthouse configuration](./lighthouse/github-com-jenkins-x-lighthouse-pkg-config-lighthouse.md) 5 | - [Lighthouse jobs](./jobs/github-com-jenkins-x-lighthouse-pkg-config-job.md) 6 | - [Lighthouse plugins](./plugins/github-com-jenkins-x-lighthouse-pkg-plugins.md) -------------------------------------------------------------------------------- /docs/config/jobs/k8s-io-apimachinery-pkg-types.md: -------------------------------------------------------------------------------- 1 | # Package k8s.io/apimachinery/pkg/types 2 | 3 | - [UID](#UID) 4 | 5 | 6 | ## UID 7 | 8 | UID is a type that holds unique ID values, including UUIDs. Because we
don't ONLY use UUIDs, this is an alias to string. Being a type captures
intent and helps make sure that UIDs and names do not get conflated. 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/config/jobs/k8s-io-apimachinery-pkg-util-intstr.md: -------------------------------------------------------------------------------- 1 | # Package k8s.io/apimachinery/pkg/util/intstr 2 | 3 | - [IntOrString](#IntOrString) 4 | 5 | 6 | ## IntOrString 7 | 8 | IntOrString is a type that can hold an int32 or a string. When used in
JSON or YAML marshalling and unmarshalling, it produces or consumes the
inner type. This allows you to have, for example, a JSON field that can
accept a name or number.
TODO: Rename to Int32OrString

+protobuf=true
+protobuf.options.(gogoproto.goproto_stringer)=false
+k8s:openapi-gen=true 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/crds/github-com-jenkins-x-lighthouse-pkg-config-job.md: -------------------------------------------------------------------------------- 1 | # Package github.com/jenkins-x/lighthouse/pkg/config/job 2 | 3 | - [PipelineKind](#PipelineKind) 4 | - [PipelineRunParam](#PipelineRunParam) 5 | 6 | 7 | ## PipelineKind 8 | 9 | PipelineKind specifies how the job is triggered. 10 | 11 | 12 | 13 | ## PipelineRunParam 14 | 15 | PipelineRunParam represents a param used by the pipeline run 16 | 17 | | Stanza | Type | Required | Description | 18 | |---|---|---|---| 19 | | `name` | string | No | Name is the name of the param | 20 | | `value_template` | string | No | ValueTemplate is the template used to build the value from well know variables | 21 | 22 | 23 | -------------------------------------------------------------------------------- /docs/crds/k8s-io-apimachinery-pkg-types.md: -------------------------------------------------------------------------------- 1 | # Package k8s.io/apimachinery/pkg/types 2 | 3 | - [UID](#UID) 4 | 5 | 6 | ## UID 7 | 8 | UID is a type that holds unique ID values, including UUIDs. Because we
don't ONLY use UUIDs, this is an alias to string. Being a type captures
intent and helps make sure that UIDs and names do not get conflated. 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/crds/k8s-io-apimachinery-pkg-util-intstr.md: -------------------------------------------------------------------------------- 1 | # Package k8s.io/apimachinery/pkg/util/intstr 2 | 3 | - [IntOrString](#IntOrString) 4 | 5 | 6 | ## IntOrString 7 | 8 | IntOrString is a type that can hold an int32 or a string. When used in
JSON or YAML marshalling and unmarshalling, it produces or consumes the
inner type. This allows you to have, for example, a JSON field that can
accept a name or number.
TODO: Rename to Int32OrString

+protobuf=true
+protobuf.options.(gogoproto.goproto_stringer)=false
+k8s:openapi-gen=true 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/plugins/hold.md: -------------------------------------------------------------------------------- 1 | # hold 2 | 3 | `hold` plugin documentation: 4 | - [Description](#description) 5 | - [Commands](#commands) 6 | - [Configuration](#configuration) 7 | - [Compatibility matrix](#compatibility-matrix) 8 | 9 | ## Description 10 | 11 | The hold plugin allows anyone to add or remove the `do-not-merge/hold` Label from a pull request. 12 | 13 | This label is typically used to temporarily prevent the pull request from merging without withholding approval. 14 | 15 | ## Commands 16 | 17 | ### /hold or /lh-hold 18 | 19 | The `/hold` or `/lh-hold` commands add the `do-not-merge/hold` label to a pull request. 20 | 21 | ### /hold cancel or /lh-hold cancel 22 | 23 | The `/hold cancel` or `/lh-hold cancel` commands remove the `do-not-merge/hold` label to a pull request. 24 | 25 | ## Configuration 26 | 27 | This plugin has no configuration option. 28 | 29 | ## Compatibility matrix 30 | 31 | | | GitHub | GitHub Enterprise | BitBucket Server | GitLab | 32 | | ------------- | ------ | ----------------- | ---------------- | ------ | 33 | | Pull requests | Yes | Yes | Yes | Yes | 34 | | Commits | No | No | No | No | 35 | -------------------------------------------------------------------------------- /docs/plugins/shrug.md: -------------------------------------------------------------------------------- 1 | # shrug 2 | 3 | `shrug` plugin documentation: 4 | - [Description](#description) 5 | - [Commands](#commands) 6 | - [Configuration](#configuration) 7 | - [Compatibility matrix](#compatibility-matrix) 8 | 9 | ## Description 10 | 11 | The shrug plugin applies the `¯\_(ツ)_/¯` label to pull requests. 12 | 13 | ## Commands 14 | 15 | ### /shrug or /lh-shrug 16 | 17 | The `/shrug` or `/lh-shrug` commands add the `¯\_(ツ)_/¯` label to a pull request. 18 | 19 | ### /unshrug or /lh-unshrug 20 | 21 | The `/unshrug` or `/lh-unshrug` commands remove the `¯\_(ツ)_/¯` label to a pull request. 22 | 23 | ## Configuration 24 | 25 | This plugin has no configuration option. 26 | 27 | ## Compatibility matrix 28 | 29 | | | GitHub | GitHub Enterprise | BitBucket Server | GitLab | 30 | | ------------- | ------ | ----------------- | ---------------- | ------ | 31 | | Pull requests | Yes | Yes | Yes | Yes | 32 | | Commits | No | No | No | No | 33 | -------------------------------------------------------------------------------- /docs/plugins/wip.md: -------------------------------------------------------------------------------- 1 | # wip 2 | 3 | `wip` plugin documentation: 4 | - [Description](#description) 5 | - [Commands](#commands) 6 | - [Configuration](#configuration) 7 | - [Compatibility matrix](#compatibility-matrix) 8 | 9 | ## Description 10 | 11 | The wip (work in progress) plugin applies the `do-not-merge/work-in-progress` label to pull requests. 12 | 13 | Pull requests whose title starts with 'WIP' or are in the 'Draft' stage also get the `do-not-merge/work-in-progress` label applied. 14 | The label is removed when the 'WIP' title prefix is removed or the pull request becomes ready for review. 15 | 16 | The `do-not-merge/work-in-progress` label is typically used to block a pull request from merging while it is still in progress. 17 | 18 | ## Commands 19 | 20 | This plugin has no commands. 21 | 22 | ## Configuration 23 | 24 | This plugin has no configuration option. 25 | 26 | ## Compatibility matrix 27 | 28 | | | GitHub | GitHub Enterprise | BitBucket Server | GitLab | 29 | | ------------- | ------ | ----------------- | ---------------- | ------ | 30 | | Pull requests | Yes | Yes | Yes | Yes | 31 | | Commits | No | No | No | No | 32 | -------------------------------------------------------------------------------- /docs/plugins/yuks.md: -------------------------------------------------------------------------------- 1 | # yuks 2 | 3 | `yuks` plugin documentation: 4 | - [Description](#description) 5 | - [Commands](#commands) 6 | - [Configuration](#configuration) 7 | - [Compatibility matrix](#compatibility-matrix) 8 | 9 | ## Description 10 | 11 | The yuks plugin comments with jokes. 12 | 13 | ## Commands 14 | 15 | ### /joke or /lh-joke 16 | 17 | Posts comments with jokes in response to the `/joke` or `/lh-joke` commands. 18 | 19 | ## Configuration 20 | 21 | This plugin has no configuration option. 22 | 23 | ## Compatibility matrix 24 | 25 | | | GitHub | GitHub Enterprise | BitBucket Server | GitLab | 26 | | ------------- | ------ | ----------------- | ---------------- | ------ | 27 | | Pull requests | Yes | Yes | Yes | Yes | 28 | | Commits | Yes | Yes | Yes | Yes | 29 | -------------------------------------------------------------------------------- /docs/trigger/k8s-io-apimachinery-pkg-types.md: -------------------------------------------------------------------------------- 1 | # Package k8s.io/apimachinery/pkg/types 2 | 3 | - [UID](#UID) 4 | 5 | 6 | ## UID 7 | 8 | UID is a type that holds unique ID values, including UUIDs. Because we
don't ONLY use UUIDs, this is an alias to string. Being a type captures
intent and helps make sure that UIDs and names do not get conflated. 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/trigger/k8s-io-apimachinery-pkg-util-intstr.md: -------------------------------------------------------------------------------- 1 | # Package k8s.io/apimachinery/pkg/util/intstr 2 | 3 | - [IntOrString](#IntOrString) 4 | 5 | 6 | ## IntOrString 7 | 8 | IntOrString is a type that can hold an int32 or a string. When used in
JSON or YAML marshalling and unmarshalling, it produces or consumes the
inner type. This allows you to have, for example, a JSON field that can
accept a name or number.
TODO: Rename to Int32OrString

+protobuf=true
+protobuf.options.(gogoproto.goproto_stringer)=false
+k8s:openapi-gen=true 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /hack/changelog-header.md: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /hack/gofmt.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | files=$(find . -name "*.go" | grep -v vendor/ | grep -v ./pkg/client/openapi/all | grep -v Dockerfile | xargs gofmt -l -s) 4 | if [[ $files ]]; then 5 | echo "Gofmt errors in files:" 6 | echo "$files" 7 | diff=$(find . -name "*.go" | grep -v vendor/ | grep -v ./pkg/client/openapi/all | grep -v Dockerfile | xargs gofmt -d -s) 8 | echo "$diff" 9 | exit 1 10 | fi 11 | -------------------------------------------------------------------------------- /hack/linter.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e -o pipefail 4 | 5 | if [ "$DISABLE_LINTER" == "true" ] 6 | then 7 | exit 0 8 | fi 9 | 10 | linterVersion="$(golangci-lint --version | awk '{print $4}')" 11 | 12 | if [[ ! "${linterVersion}" =~ ^1\.5[89] ]]; then 13 | echo "Install GolangCI-Lint version 1.58 or 1.59" 14 | exit 1 15 | fi 16 | 17 | export GO111MODULE=on 18 | golangci-lint run \ 19 | --verbose \ 20 | --build-tags build 21 | -------------------------------------------------------------------------------- /hack/tools.go: -------------------------------------------------------------------------------- 1 | //go:build tools 2 | // +build tools 3 | 4 | package tools 5 | 6 | import ( 7 | _ "k8s.io/code-generator/cmd/client-gen" 8 | _ "k8s.io/code-generator/cmd/deepcopy-gen" 9 | _ "k8s.io/code-generator/cmd/defaulter-gen" 10 | _ "k8s.io/code-generator/cmd/informer-gen" 11 | _ "k8s.io/code-generator/cmd/lister-gen" 12 | _ "k8s.io/kube-openapi/cmd/openapi-gen" 13 | ) 14 | -------------------------------------------------------------------------------- /init-helm.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | helm init --client-only --skip-refresh --stable-repo-url https://charts.helm.sh/stable 4 | #helm repo rm stable 5 | #helm repo add stable https://charts.helm.sh/stable 6 | -------------------------------------------------------------------------------- /pkg/apis/lighthouse/register.go: -------------------------------------------------------------------------------- 1 | package lighthouse 2 | 3 | const ( 4 | // GroupName defines the API group identifier for Lighthouse types. 5 | GroupName = "lighthouse.jenkins.io" 6 | 7 | // Version is the Lighthouse API group version 8 | Version = "v1" 9 | 10 | // GroupAndVersion is the Lighthouse API Group and version 11 | GroupAndVersion = GroupName + "/" + Version 12 | ) 13 | -------------------------------------------------------------------------------- /pkg/apis/lighthouse/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // Package v1alpha1 contains LighthouseJob 2 | // +k8s:openapi-gen=true 3 | // +k8s:deepcopy-gen=package,register 4 | // +k8s:conversion-gen=github.com/jenkins-x/lighthouse/pkg/apis/lighthouse 5 | // +k8s:defaulter-gen=TypeMeta 6 | // +groupName=lighthouse.jenkins.io 7 | package v1alpha1 8 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/doc.go: -------------------------------------------------------------------------------- 1 | // Code generated by client-gen. DO NOT EDIT. 2 | 3 | // This package has the automatically generated clientset. 4 | package versioned 5 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/fake/doc.go: -------------------------------------------------------------------------------- 1 | // Code generated by client-gen. DO NOT EDIT. 2 | 3 | // This package has the automatically generated fake clientset. 4 | package fake 5 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/scheme/doc.go: -------------------------------------------------------------------------------- 1 | // Code generated by client-gen. DO NOT EDIT. 2 | 3 | // This package contains the scheme of the automatically generated clientset. 4 | package scheme 5 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/lighthouse/v1alpha1/doc.go: -------------------------------------------------------------------------------- 1 | // Code generated by client-gen. DO NOT EDIT. 2 | 3 | // This package has the automatically generated typed clients. 4 | package v1alpha1 5 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/lighthouse/v1alpha1/fake/doc.go: -------------------------------------------------------------------------------- 1 | // Code generated by client-gen. DO NOT EDIT. 2 | 3 | // Package fake has the automatically generated clients. 4 | package fake 5 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/lighthouse/v1alpha1/fake/fake_lighthouse_client.go: -------------------------------------------------------------------------------- 1 | // Code generated by client-gen. DO NOT EDIT. 2 | 3 | package fake 4 | 5 | import ( 6 | v1alpha1 "github.com/jenkins-x/lighthouse/pkg/client/clientset/versioned/typed/lighthouse/v1alpha1" 7 | rest "k8s.io/client-go/rest" 8 | testing "k8s.io/client-go/testing" 9 | ) 10 | 11 | type FakeLighthouseV1alpha1 struct { 12 | *testing.Fake 13 | } 14 | 15 | func (c *FakeLighthouseV1alpha1) LighthouseBreakpoints(namespace string) v1alpha1.LighthouseBreakpointInterface { 16 | return &FakeLighthouseBreakpoints{c, namespace} 17 | } 18 | 19 | func (c *FakeLighthouseV1alpha1) LighthouseJobs(namespace string) v1alpha1.LighthouseJobInterface { 20 | return &FakeLighthouseJobs{c, namespace} 21 | } 22 | 23 | // RESTClient returns a RESTClient that is used to communicate 24 | // with API server by this client implementation. 25 | func (c *FakeLighthouseV1alpha1) RESTClient() rest.Interface { 26 | var ret *rest.RESTClient 27 | return ret 28 | } 29 | -------------------------------------------------------------------------------- /pkg/client/clientset/versioned/typed/lighthouse/v1alpha1/generated_expansion.go: -------------------------------------------------------------------------------- 1 | // Code generated by client-gen. DO NOT EDIT. 2 | 3 | package v1alpha1 4 | 5 | type LighthouseBreakpointExpansion interface{} 6 | 7 | type LighthouseJobExpansion interface{} 8 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/internalinterfaces/factory_interfaces.go: -------------------------------------------------------------------------------- 1 | // Code generated by informer-gen. DO NOT EDIT. 2 | 3 | package internalinterfaces 4 | 5 | import ( 6 | time "time" 7 | 8 | versioned "github.com/jenkins-x/lighthouse/pkg/client/clientset/versioned" 9 | v1 "k8s.io/apimachinery/pkg/apis/meta/v1" 10 | runtime "k8s.io/apimachinery/pkg/runtime" 11 | cache "k8s.io/client-go/tools/cache" 12 | ) 13 | 14 | // NewInformerFunc takes versioned.Interface and time.Duration to return a SharedIndexInformer. 15 | type NewInformerFunc func(versioned.Interface, time.Duration) cache.SharedIndexInformer 16 | 17 | // SharedInformerFactory a small interface to allow for adding an informer without an import cycle 18 | type SharedInformerFactory interface { 19 | Start(stopCh <-chan struct{}) 20 | InformerFor(obj runtime.Object, newFunc NewInformerFunc) cache.SharedIndexInformer 21 | } 22 | 23 | // TweakListOptionsFunc is a function that transforms a v1.ListOptions. 24 | type TweakListOptionsFunc func(*v1.ListOptions) 25 | -------------------------------------------------------------------------------- /pkg/client/informers/externalversions/lighthouse/interface.go: -------------------------------------------------------------------------------- 1 | // Code generated by informer-gen. DO NOT EDIT. 2 | 3 | package lighthouse 4 | 5 | import ( 6 | internalinterfaces "github.com/jenkins-x/lighthouse/pkg/client/informers/externalversions/internalinterfaces" 7 | v1alpha1 "github.com/jenkins-x/lighthouse/pkg/client/informers/externalversions/lighthouse/v1alpha1" 8 | ) 9 | 10 | // Interface provides access to each of this group's versions. 11 | type Interface interface { 12 | // V1alpha1 provides access to shared informers for resources in V1alpha1. 13 | V1alpha1() v1alpha1.Interface 14 | } 15 | 16 | type group struct { 17 | factory internalinterfaces.SharedInformerFactory 18 | namespace string 19 | tweakListOptions internalinterfaces.TweakListOptionsFunc 20 | } 21 | 22 | // New returns a new Interface. 23 | func New(f internalinterfaces.SharedInformerFactory, namespace string, tweakListOptions internalinterfaces.TweakListOptionsFunc) Interface { 24 | return &group{factory: f, namespace: namespace, tweakListOptions: tweakListOptions} 25 | } 26 | 27 | // V1alpha1 returns a new v1alpha1.Interface. 28 | func (g *group) V1alpha1() v1alpha1.Interface { 29 | return v1alpha1.New(g.factory, g.namespace, g.tweakListOptions) 30 | } 31 | -------------------------------------------------------------------------------- /pkg/client/listers/lighthouse/v1alpha1/expansion_generated.go: -------------------------------------------------------------------------------- 1 | // Code generated by lister-gen. DO NOT EDIT. 2 | 3 | package v1alpha1 4 | 5 | // LighthouseBreakpointListerExpansion allows custom methods to be added to 6 | // LighthouseBreakpointLister. 7 | type LighthouseBreakpointListerExpansion interface{} 8 | 9 | // LighthouseBreakpointNamespaceListerExpansion allows custom methods to be added to 10 | // LighthouseBreakpointNamespaceLister. 11 | type LighthouseBreakpointNamespaceListerExpansion interface{} 12 | 13 | // LighthouseJobListerExpansion allows custom methods to be added to 14 | // LighthouseJobLister. 15 | type LighthouseJobListerExpansion interface{} 16 | 17 | // LighthouseJobNamespaceListerExpansion allows custom methods to be added to 18 | // LighthouseJobNamespaceLister. 19 | type LighthouseJobNamespaceListerExpansion interface{} 20 | -------------------------------------------------------------------------------- /pkg/config/branchprotection/branch.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package branchprotection 18 | 19 | // Branch holds protection policy overrides for a particular branch. 20 | type Branch struct { 21 | Policy 22 | } 23 | -------------------------------------------------------------------------------- /pkg/config/branchprotection/org.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package branchprotection 18 | 19 | // Org holds the default protection policy for an entire org, as well as any repo overrides. 20 | type Org struct { 21 | Policy 22 | Repos map[string]Repo `json:"repos,omitempty"` 23 | } 24 | 25 | // GetRepo returns the repo config after merging in any org policies. 26 | func (o Org) GetRepo(name string) *Repo { 27 | r, ok := o.Repos[name] 28 | if ok { 29 | r.Policy = o.Apply(r.Policy) 30 | } else { 31 | r.Policy = o.Policy 32 | } 33 | return &r 34 | } 35 | -------------------------------------------------------------------------------- /pkg/config/branchprotection/restrictions.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package branchprotection 18 | 19 | // Restrictions limits who can merge 20 | // Users and Teams items are appended to parent lists. 21 | type Restrictions struct { 22 | Users []string `json:"users"` 23 | Teams []string `json:"teams"` 24 | } 25 | 26 | func mergeRestrictions(parent, child *Restrictions) *Restrictions { 27 | if child == nil { 28 | return parent 29 | } 30 | if parent == nil { 31 | return child 32 | } 33 | return &Restrictions{ 34 | Users: unionStrings(parent.Users, child.Users), 35 | Teams: unionStrings(parent.Teams, child.Teams), 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /pkg/config/job/deployment.go: -------------------------------------------------------------------------------- 1 | package job 2 | 3 | type Deployment struct { 4 | Base 5 | Reporter 6 | // The deployment state that trigger this pipeline 7 | // Can be one of: error, failure, inactive, in_progress, queued, pending, success 8 | // If not set all deployment state event triggers 9 | State string `json:"state,omitempty"` 10 | // Deployment for this environment trigger this pipeline 11 | // If not set deployments for all environments trigger 12 | Environment string `json:"environment,omitempty"` 13 | } 14 | -------------------------------------------------------------------------------- /pkg/config/job/periodic.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package job 18 | 19 | // Periodic runs on a timer. 20 | type Periodic struct { 21 | Base 22 | Reporter 23 | // Cron representation of job trigger time 24 | Cron string `json:"cron"` 25 | // Branch to run job on. If not set default branch for repository is used 26 | Branch string `json:"branch,omitempty"` 27 | } 28 | 29 | // SetDefaults initializes default values 30 | func (p *Periodic) SetDefaults(namespace string) { 31 | p.Base.SetDefaults(namespace) 32 | } 33 | -------------------------------------------------------------------------------- /pkg/config/job/pipelinerunparam.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package job 18 | 19 | // PipelineRunParam represents a param used by the pipeline run 20 | type PipelineRunParam struct { 21 | // Name is the name of the param 22 | Name string `json:"name,omitempty"` 23 | // ValueTemplate is the template used to build the value from well know variables 24 | ValueTemplate string `json:"value_template,omitempty"` 25 | } 26 | -------------------------------------------------------------------------------- /pkg/config/job/reporter.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package job 18 | 19 | // Reporter keeps various details for status reporting 20 | type Reporter struct { 21 | // Context is the name of the GitHub status context for the job. 22 | // Defaults: the same as the name of the job. 23 | Context string `json:"context,omitempty"` 24 | // SkipReport skips commenting and setting status on GitHub. 25 | SkipReport bool `json:"skip_report,omitempty"` 26 | } 27 | -------------------------------------------------------------------------------- /pkg/config/keeper/mergecommittemplate.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package keeper 18 | 19 | import ( 20 | "text/template" 21 | ) 22 | 23 | // MergeCommitTemplate holds templates to use for merge commits. 24 | type MergeCommitTemplate struct { 25 | TitleTemplate string `json:"title,omitempty"` 26 | BodyTemplate string `json:"body,omitempty"` 27 | 28 | Title *template.Template `json:"-"` 29 | Body *template.Template `json:"-"` 30 | } 31 | -------------------------------------------------------------------------------- /pkg/config/keeper/orgcontextpolicy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package keeper 18 | 19 | // OrgContextPolicy overrides the policy for an org, and any repo overrides. 20 | type OrgContextPolicy struct { 21 | ContextPolicy 22 | Repos map[string]RepoContextPolicy `json:"repos,omitempty"` 23 | } 24 | -------------------------------------------------------------------------------- /pkg/config/keeper/repocontextpolicy.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package keeper 18 | 19 | // RepoContextPolicy overrides the policy for repo, and any branch overrides. 20 | type RepoContextPolicy struct { 21 | ContextPolicy 22 | Branches map[string]ContextPolicy `json:"branches,omitempty"` 23 | } 24 | -------------------------------------------------------------------------------- /pkg/config/lighthouse/ownersdirexclude.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package lighthouse 18 | 19 | // OwnersDirExcludes is used to configure which directories to ignore when 20 | // searching for OWNERS{,_ALIAS} files in a repo. 21 | type OwnersDirExcludes struct { 22 | // Repos configures a directory blacklist per repo (or org) 23 | Repos map[string][]string `json:"repos"` 24 | // Default configures a default blacklist for repos (or orgs) not 25 | // specifically configured 26 | Default []string `json:"default"` 27 | } 28 | -------------------------------------------------------------------------------- /pkg/config/lighthouse/providerconfig.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package lighthouse 18 | 19 | // ProviderConfig is optionally used to configure information about the SCM provider being used. These values will be 20 | // used as fallbacks if environment variables aren't set. 21 | type ProviderConfig struct { 22 | // Kind is the go-scm driver name 23 | Kind string `json:"kind,omitempty"` 24 | // Server is the base URL for the provider, like https://github.com 25 | Server string `json:"server,omitempty"` 26 | // BotUser is the username on the provider the bot will use 27 | BotUser string `json:"botUser,omitempty"` 28 | } 29 | -------------------------------------------------------------------------------- /pkg/config/lighthouse/pubsubsubscriptions.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | package lighthouse 18 | 19 | // PubsubSubscriptions maps GCP projects to a list of Topics. 20 | type PubsubSubscriptions map[string][]string 21 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Project Configs 2 | 3 | This is a central place for Kubernetes-project specific configs for other tools in this repo. 4 | 5 | ## Directory structure: 6 | 7 | [jobs/](jobs) : job configs for Kubernetes Prow deployment, potentially testgrid configs as well 8 | [tests](./tests) : validation tests for the configs 9 | 10 | ## Adding new jobs to Prow: 11 | 12 | 1. Find or create an org/repo directory under config/jobs, eg: config/jobs/kubernetes-sigs/kustomize for jobs related to https://github.com/kubernetes-sigs/kustomize. 13 | 14 | 1. Create an OWNERS file and add appropriate approver/reviewer for your job. 15 | 16 | 1. Add a *.yaml file (the base name has to be unique), and follow https://github.com/kubernetes/test-infra/tree/master/prow#how-to-add-new-jobs for adding new prowjobs. 17 | 18 | Also please read [`create-a-new-job`] 19 | 20 | [`create-a-new-job`]: /README.md#create-a-new-job 21 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/GoogleCloudPlatform/k8s-multicluster-ingress/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - nikhiljindal 3 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/README.md: -------------------------------------------------------------------------------- 1 | # Kubernetes Prow Job Configs 2 | 3 | Here are prow job configs for the Kubernetes prow deployment. 4 | 5 | Please add jobs per org|repo/sig subdir. 6 | 7 | The file basename will be used as a configmap key so they need to be unique across this directory. 8 | 9 | Questions? Contact @krzyzacy! -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/apache-spark-on-k8s/spark-integration/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - foxish 3 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/bazelbuild/rules_k8s/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - fejta 3 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/bazelbuild/rules_k8s/rules_k8s_config.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | bazelbuild/rules_k8s: 3 | - name: pull-rules-k8s-e2e 4 | cluster: gke_rules-k8s_us-central1-f_testing 5 | max_concurrency: 1 # TODO(fejta): increase this 6 | always_run: true 7 | decorate: true 8 | spec: 9 | containers: 10 | - image: gcr.io/rules-k8s/gcloud-bazel:v20181017-3f8359f 11 | args: 12 | - bash 13 | - -c 14 | - | 15 | gcloud auth activate-service-account --key-file=/etc/gcp/service-account.json \ 16 | && gcloud container clusters get-credentials testing --zone=us-central1-f --project=rules-k8s \ 17 | && echo "startup --host_jvm_args=-Duser.name=prow" > /root/.bazelrc \ 18 | && ./test-e2e.sh 19 | env: 20 | - name: USER 21 | value: prow 22 | volumeMounts: 23 | - name: service-account 24 | mountPath: /etc/gcp 25 | volumes: 26 | - name: service-account 27 | secret: 28 | secretName: service-account 29 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/cadvisor/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - dashpole 3 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/containerd/cri/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - yujuhong 3 | - Random-Liu 4 | - dchen1107 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/gke/containerd/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - Random-Liu 3 | - yujuhong 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/helm/charts/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - foxish 3 | - mattfarina 4 | - prydonius 5 | - unguiculus 6 | - viglesiasce 7 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubeflow/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - jlewi 3 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-csi/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - msau42 3 | - saad-ali 4 | reviewers: 5 | - pohly 6 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-csi/csi-lib-utils/csi-lib-utils-config.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes-csi/csi-lib-utils: 3 | - name: pull-sig-storage-csi-lib-utils 4 | always_run: true 5 | decorate: true 6 | skip_report: false 7 | spec: 8 | containers: 9 | # This image was chosen over the more often used kubekins-e2e because 10 | # it is smaller and has everything we need (basically just a Go environment). 11 | - image: gcr.io/k8s-testimages/gcloud-in-go:v20180927-6b4facbe6 12 | command: 13 | - make 14 | args: 15 | - -k # report as many failures as possible (if any) before finally failing 16 | - all # build... 17 | - test # ... and test 18 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-incubator/service-catalog/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - carolynvs 3 | - duglin 4 | - jboyd01 5 | - jeremyrickard 6 | - MHBauer 7 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/aws-alb-ingress-controller/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - bigkraig 3 | - M00nF1sh 4 | - gyuho 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/aws-alb-ingress-controller/aws-alb-ingress-controller-presubmits.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes-sigs/aws-alb-ingress-controller: 3 | - name: pull-aws-alb-ingress-controller-lint 4 | always_run: true 5 | decorate: true 6 | labels: 7 | preset-service-account: "true" 8 | spec: 9 | containers: 10 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 11 | command: 12 | - runner.sh 13 | args: 14 | - make 15 | - lint 16 | - name: pull-aws-alb-ingress-controller-test 17 | always_run: true 18 | decorate: true 19 | labels: 20 | preset-service-account: "true" 21 | spec: 22 | containers: 23 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 24 | command: 25 | - runner.sh 26 | args: 27 | - make 28 | - test 29 | volumeMounts: 30 | - name: coveralls 31 | mountPath: /etc/coveralls-token 32 | readOnly: true 33 | volumes: 34 | - name: coveralls 35 | secret: 36 | secretName: k8s-aws-alb-ingress-coveralls-token 37 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/aws-ebs-csi-driver/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - leakingtapan 3 | - gyuho 4 | - bertinatto 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api-provider-aws/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - detiber 3 | - chuckha 4 | - davidewatson 5 | - d-nishi 6 | - enxebre 7 | - ingvagabund 8 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api-provider-aws/cluster-api-provider-aws-ci.yaml: -------------------------------------------------------------------------------- 1 | periodics: 2 | - interval: 4h 3 | name: periodic-cluster-api-provider-aws-test-creds 4 | decorate: true 5 | labels: 6 | preset-service-account: "true" 7 | preset-aws-ssh: "true" 8 | preset-aws-credential: "true" 9 | extra_refs: 10 | - org: kubernetes-sigs 11 | repo: cluster-api-provider-aws 12 | base_ref: master 13 | path_alias: "sigs.k8s.io/cluster-api-provider-aws" 14 | spec: 15 | containers: 16 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-1.12 17 | command: 18 | - "./scripts/ci-aws-cred-test.sh" -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api-provider-azure/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - andyzhangx 3 | - brendandburns 4 | - feiskyer 5 | - justaugustus 6 | - karataliu 7 | - khenidak 8 | - soggiest 9 | - tariq1890 10 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api-provider-digitalocean/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - andrewsykim 3 | - alvaroaleman 4 | - nikhita 5 | - xmudrii 6 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api-provider-gcp/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - roberthbailey 3 | - krousey 4 | - maisem 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api-provider-gcp/cluster-api-provider-gcp-ci.yaml: -------------------------------------------------------------------------------- 1 | periodics: 2 | - name: ci-cluster-api-provider-gcp-build 3 | interval: 1h 4 | labels: 5 | preset-service-account: "true" 6 | spec: 7 | containers: 8 | - image: gcr.io/k8s-testimages/gcloud-in-go:v20180927-6b4facbe6 9 | args: 10 | - "--repo=sigs.k8s.io/cluster-api-provider-gcp" 11 | - "--root=/go/src" 12 | - "--upload=gs://kubernetes-jenkins/logs" 13 | - "--scenario=execute" 14 | - "--" 15 | - "./scripts/ci-build.sh" 16 | - name: ci-cluster-api-provider-gcp-test 17 | interval: 1h 18 | labels: 19 | preset-service-account: "true" 20 | spec: 21 | containers: 22 | - image: gcr.io/k8s-testimages/cluster-api:v20180720-d52d72975 23 | args: 24 | - "--repo=sigs.k8s.io/cluster-api-provider-gcp" 25 | - "--root=/go/src" 26 | - "--upload=gs://kubernetes-jenkins/logs" 27 | - "--scenario=execute" 28 | - "--" 29 | - "./scripts/ci-test.sh" 30 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api-provider-openstack/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - flaper87 3 | - Lion-Wei 4 | - chaosaffe 5 | - m1093782566 6 | - dims 7 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api-provider-vsphere/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - sig-cluster-lifecycle-leads 3 | - sig-vmware-leads 4 | - cluster-api-admins 5 | - cluster-api-vsphere-maintainers 6 | - figo 7 | - akutz 8 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - jessicaochen 3 | - k4leung4 4 | - karan 5 | - kris-nova 6 | - krousey 7 | - mkjelland 8 | - roberthbailey 9 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/cluster-api/cluster-api-ci.yaml: -------------------------------------------------------------------------------- 1 | periodics: 2 | - name: ci-cluster-api-build 3 | interval: 1h 4 | labels: 5 | preset-service-account: "true" 6 | spec: 7 | containers: 8 | - image: gcr.io/k8s-testimages/cluster-api:v20180927-f09bc3b1b 9 | args: 10 | - "--repo=sigs.k8s.io/cluster-api" 11 | - "--root=/go/src" 12 | - "--upload=gs://kubernetes-jenkins/logs" 13 | - "--scenario=execute" 14 | - "--" 15 | - "./scripts/ci-build.sh" 16 | - name: ci-cluster-api-test 17 | interval: 1h 18 | labels: 19 | preset-service-account: "true" 20 | spec: 21 | containers: 22 | - image: gcr.io/k8s-testimages/cluster-api:v20180720-d52d72975 23 | args: 24 | - "--repo=sigs.k8s.io/cluster-api" 25 | - "--root=/go/src" 26 | - "--upload=gs://kubernetes-jenkins/logs" 27 | - "--scenario=execute" 28 | - "--" 29 | - "./scripts/ci-test.sh" 30 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - davidz627 3 | - msau42 4 | - saad-ali 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/gcp-compute-persistent-disk-csi-driver/gcp-compute-persistent-disk-csi-driver-postsubmits.yaml: -------------------------------------------------------------------------------- 1 | periodics: 2 | - name: ci-gcp-compute-persistent-disk-csi-driver-k8s-integration-stable 3 | interval: 4h 4 | labels: 5 | preset-service-account: "true" 6 | preset-dind-enabled: "true" 7 | spec: 8 | containers: 9 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 10 | args: 11 | - "--repo=sigs.k8s.io/gcp-compute-persistent-disk-csi-driver" 12 | - "--root=/go/src" 13 | - "--upload=gs://kubernetes-jenkins/logs" 14 | - "--clean" 15 | - "--timeout=60" # Minutes 16 | - "--scenario=execute" 17 | - "--" # end bootstrap args, scenario args below 18 | - "test/run-k8s-integration.sh" 19 | env: 20 | - name: GCE_PD_OVERLAY_NAME 21 | value: "stable" 22 | - name: GCE_PD_DO_DRIVER_BUILD 23 | value: "false" 24 | # docker-in-docker needs privileged mode 25 | securityContext: 26 | privileged: true 27 | 28 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/gcp-filestore-csi-driver/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - davidz627 3 | - msau42 4 | - saad-ali 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/kind/kind-postsubmits.yaml: -------------------------------------------------------------------------------- 1 | # sigs.k8s.io/kind postsubmits 2 | postsubmits: 3 | kubernetes-sigs/kind: 4 | - name: ci-kind-build 5 | decorate: true 6 | path_alias: sigs.k8s.io/kind 7 | spec: 8 | containers: 9 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 10 | command: 11 | - "./hack/ci/build-all.sh" 12 | # trialing this on kind jobs, we are using FQDN for in-cluster services, now 13 | # so use ndots 1 to improve dns performance 14 | # TODO(bentheelder): consider setting this at the cluster level instead 15 | dnsConfig: 16 | options: 17 | - name: ndots 18 | value: "1" 19 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/kube-storage-version-migrator/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - caesarxuchao 3 | - deads2k 4 | - lavalamp 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/kustomize/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - grodrigues3 3 | - droot 4 | - justinsb 5 | - liujingfang1 6 | - mengqiy 7 | - monopole 8 | - pwittrock 9 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/kustomize/kustomize-config.yaml: -------------------------------------------------------------------------------- 1 | periodics: 2 | - interval: 2h 3 | name: ci-kustomize-periodic-default-gke 4 | labels: 5 | preset-service-account: "true" 6 | preset-k8s-ssh: "true" 7 | spec: 8 | containers: 9 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 10 | args: 11 | - "--job=$(JOB_NAME)" 12 | - "--root=/go/src" 13 | - "--repo=sigs.k8s.io/kustomize" 14 | - "--upload=gs://kubernetes-jenkins/logs/" 15 | - "--timeout=150" 16 | - --scenario=kubernetes_e2e 17 | - -- 18 | - --check-leaked-resources 19 | - --cluster= 20 | - --deployment=gke 21 | - --extract=gke 22 | - --gcp-node-image=gci 23 | - --gcp-zone=us-central1-f 24 | - --gke-environment=prod 25 | - --provider=gke 26 | - --test=false 27 | - --test-cmd=../examples/integration_tests.sh 28 | - --test-cmd-name=kustomize-integration 29 | - --timeout=120m 30 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/poseidon/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - ICGog 3 | - ms705 4 | - shivramsrivastava 5 | - m1093782566 6 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/sig-storage-local-static-provisioner/OWNERS: -------------------------------------------------------------------------------- 1 | # See the OWNERS docs: https://git.k8s.io/community/contributors/guide/owners.md 2 | 3 | approvers: 4 | - msau42 5 | - saad-ali 6 | - wongma7 7 | - jsafrane 8 | - dhirajh 9 | - cofyc 10 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/sig-windows/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - PatrickLang 3 | - adelina-t 4 | - bclau 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/structured-merge-diff/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - lavalamp 3 | - apelisse 4 | - jennybuckley -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/structured-merge-diff/structured-merge-diff-ci.yaml: -------------------------------------------------------------------------------- 1 | periodics: 2 | - name: ci-structured-merge-diff-test 3 | interval: 12h 4 | labels: 5 | preset-service-account: "true" 6 | decorate: true 7 | extra_refs: 8 | - org: kubernetes-sigs 9 | repo: structured-merge-diff 10 | base_ref: master 11 | path_alias: sigs.k8s.io/structured-merge-diff 12 | spec: 13 | containers: 14 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 15 | command: 16 | - go 17 | args: 18 | - test 19 | - ./... -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/structured-merge-diff/structured-merge-diff-presubmits.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes-sigs/structured-merge-diff: 3 | - name: pull-structured-merge-diff-test 4 | labels: 5 | preset-service-account: "true" 6 | always_run: true 7 | decorate: true 8 | path_alias: sigs.k8s.io/structured-merge-diff 9 | spec: 10 | containers: 11 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 12 | command: 13 | - go 14 | args: 15 | - test 16 | - ./... 17 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/testing_frameworks/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - apelisse 3 | - hoegaarden 4 | - totherme 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes-sigs/testing_frameworks/testing-frameworks-config.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes-sigs/testing_frameworks: 3 | - name: pull-frameworks-test 4 | branches: 5 | - master 6 | always_run: true 7 | skip_report: false 8 | labels: 9 | preset-service-account: "true" 10 | spec: 11 | containers: 12 | - image: gcr.io/k8s-testimages/gcloud-in-go:v20171113-192bec25 13 | args: 14 | - "--repo=sigs.k8s.io/$(REPO_NAME)=$(PULL_REFS)" 15 | - "--root=/go/src" 16 | - "--upload=gs://kubernetes-jenkins/pr-logs" 17 | - --scenario=execute 18 | - -- 19 | - ./bin/test-on-prow.sh 20 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-aws/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - mcrute 3 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-aws/cloud-provider-aws-config.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/cloud-provider-aws: 3 | - name: pull-cloud-provider-aws-check 4 | always_run: true 5 | decorate: true 6 | labels: 7 | preset-service-account: "true" 8 | spec: 9 | containers: 10 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 11 | command: 12 | - runner.sh 13 | args: 14 | - make 15 | - check 16 | 17 | - name: pull-cloud-provider-aws-test 18 | always_run: true 19 | decorate: true 20 | labels: 21 | preset-service-account: "true" 22 | spec: 23 | containers: 24 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 25 | command: 26 | - runner.sh 27 | args: 28 | - make 29 | - test 30 | 31 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-azure/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - andyzhangx 3 | - brendandburns 4 | - feiskyer 5 | - justaugustus 6 | - karataliu 7 | - khenidak 8 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-gcp/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - awly 3 | - mikedanese 4 | - calebmiles 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-gcp/cloud-provider-gcp-presubmits.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/cloud-provider-gcp: 3 | - name: cloud-provider-gcp-tests 4 | max_concurrency: 5 5 | always_run: true 6 | decorate: true 7 | spec: 8 | containers: 9 | - image: gcr.io/cloud-builders/bazel 10 | command: ["bash"] 11 | args: 12 | - -c 13 | - | 14 | bazel --output_base=/tmp build -- //... -//vendor/... && \ 15 | bazel --output_base=/tmp test --test_output=errors -- //... -//vendor/... 16 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-openstack/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - dims 3 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-openstack/cloud-provider-openstack-config.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/cloud-provider-openstack: 3 | - name: pull-cloud-provider-openstack-check 4 | always_run: true 5 | branches: 6 | - master 7 | labels: 8 | preset-service-account: "true" 9 | spec: 10 | containers: 11 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 12 | args: 13 | - "--repo=k8s.io/$(REPO_NAME)=$(PULL_REFS)" 14 | - "--root=/go/src" 15 | - "--upload=gs://kubernetes-jenkins/pr-logs" 16 | - --scenario=execute 17 | - -- 18 | - make 19 | - check 20 | 21 | - name: pull-cloud-provider-openstack-test 22 | always_run: true 23 | branches: 24 | - master 25 | labels: 26 | preset-service-account: "true" 27 | spec: 28 | containers: 29 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 30 | args: 31 | - "--repo=k8s.io/$(REPO_NAME)=$(PULL_REFS)" 32 | - "--root=/go/src" 33 | - "--upload=gs://kubernetes-jenkins/pr-logs" 34 | - --scenario=execute 35 | - -- 36 | - make 37 | - test 38 | 39 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-vsphere/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - abrarshivani 3 | - baludontu 4 | - divyenpatel 5 | - imkin 6 | - kerneltime 7 | - luomiao 8 | - frapposelli 9 | - dougm 10 | - figo 11 | - akutz 12 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cloud-provider-vsphere/cloud-provider-vsphere-presubmits.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/cloud-provider-vsphere: 3 | - name: pull-cloud-provider-vsphere-test 4 | branches: 5 | - master 6 | always_run: true 7 | labels: 8 | preset-service-account: "true" 9 | spec: 10 | containers: 11 | - image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 12 | args: 13 | - "--job=$(JOB_NAME)" 14 | - "--repo=k8s.io/$(REPO_NAME)=$(PULL_REFS)" 15 | - "--root=/go/src" 16 | - "--service-account=/etc/service-account/service-account.json" 17 | - "--upload=gs://kubernetes-jenkins/pr-logs" 18 | - "--scenario=execute" 19 | - "--timeout=30" 20 | - "--" # end bootstrap args, scenario args below 21 | - "make" 22 | - "test" 23 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/cluster-registry/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - font 3 | - madhusudancs 4 | - perotinus 5 | - pmorie 6 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/community/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - calebamiles 3 | - castrojo 4 | - cblecker 5 | - grodrigues3 6 | - idvoretskyi 7 | - jdumars 8 | - parispittman 9 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/community/community-presubmit.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/community: 3 | - name: pull-community-verify 4 | branches: 5 | - master 6 | always_run: true 7 | labels: 8 | preset-service-account: "true" 9 | spec: 10 | containers: 11 | - image: gcr.io/k8s-testimages/gcloud-in-go:v20171113-192bec25 12 | args: 13 | - "--repo=k8s.io/$(REPO_NAME)=$(PULL_REFS)" 14 | - "--root=/go/src" 15 | - "--upload=gs://kubernetes-jenkins/pr-logs" 16 | - --scenario=execute 17 | - -- 18 | - make 19 | - verify 20 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/generated/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - krzyzacy 3 | - yguo0905 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/kops/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - justinsb 3 | - chrislovecnm 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/minikube/minikube.yaml: -------------------------------------------------------------------------------- 1 | presets: 2 | - labels: 3 | preset-minikube-e2e-creds: "true" 4 | env: 5 | - name: GCS_CREDS 6 | value: /root/.config/gcloud/k8s-minikube-build-gcs.json 7 | volumes: 8 | - name: k8s-minikube-build-gcs 9 | secret: 10 | secretName: k8s-minikube-build-gcs 11 | volumeMounts: 12 | - name: k8s-minikube-build-gcs 13 | mountPath: /root/.config/gcloud 14 | readOnly: true 15 | 16 | presubmits: 17 | kubernetes/minikube: 18 | - name: pull-minikube-linux-kvm 19 | labels: 20 | preset-minikube-e2e-creds: "true" 21 | preset-k8s-ssh: "true" 22 | always_run: false 23 | optional: true 24 | decorate: true 25 | spec: 26 | containers: 27 | - image: gcr.io/k8s-minikube/minikube-e2e:v20181022-a850455f-experimental 28 | command: 29 | - make 30 | args: 31 | - "test-linux-kvm" 32 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/org/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - calebamiles 3 | - cblecker 4 | - fejta 5 | - grodrigues3 6 | - idvoretskyi 7 | - spiffxp 8 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/org/kubernetes-org-jobs.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/org: 3 | - name: pull-org-test-all 4 | always_run: true 5 | decorate: true 6 | spec: 7 | containers: 8 | - image: launcher.gcr.io/google/bazel 9 | command: 10 | - bazel 11 | args: 12 | - test 13 | - //... 14 | - name: pull-org-verify-all 15 | always_run: true 16 | decorate: true 17 | spec: 18 | containers: 19 | - image: launcher.gcr.io/google/bazel 20 | command: 21 | - ./hack/verify-all.sh 22 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/publishing-bot/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - caesarxuchao 3 | - mfojtik 4 | - nikhita 5 | - sttts 6 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/publishing-bot/publishing-bot-presubmits.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/publishing-bot: 3 | - name: pull-publishing-bot-build 4 | always_run: true 5 | decorate: true 6 | path_alias: k8s.io/publishing-bot 7 | spec: 8 | containers: 9 | - image: golang:1.11 10 | command: 11 | - make 12 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-api-machinery/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - lavalamp 3 | - deads2k 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-api-machinery/sig-api-machinery-config.yaml: -------------------------------------------------------------------------------- 1 | periodics: 2 | - interval: 30m 3 | name: ci-kubernetes-e2e-gci-gce-proto 4 | labels: 5 | preset-service-account: "true" 6 | preset-k8s-ssh: "true" 7 | spec: 8 | containers: 9 | - args: 10 | - --timeout=70 11 | - --bare 12 | - --scenario=kubernetes_e2e 13 | - -- 14 | - --check-leaked-resources 15 | - --env=STORAGE_MEDIA_TYPE=application/vnd.kubernetes.protobuf 16 | - --extract=ci/latest 17 | - --gcp-node-image=gci 18 | - --gcp-zone=us-west1-b 19 | - --ginkgo-parallel=25 20 | - --provider=gce 21 | - --test_args=--ginkgo.skip=\[Slow\]|\[Serial\]|\[Disruptive\]|\[Flaky\]|\[Feature:.+\] --minStartupPods=8 22 | - --timeout=50m 23 | image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 24 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-apps/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - mattfarina 3 | - prydonius 4 | - kow3ns 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-autoscaling/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - directxman12 3 | - mwielgus 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-aws/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - chrislovecnm 3 | - justinsb 4 | - shyamjvs 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-aws/eks/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - gyuho 3 | - shyamjvs 4 | reviewers: 5 | - gyuho 6 | - shyamjvs 7 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-aws/kops/kops-presets.yaml: -------------------------------------------------------------------------------- 1 | presets: 2 | - labels: 3 | preset-e2e-platform-aws: "true" 4 | env: 5 | # TODO(zmerlynn): Eliminate the other uses of this env variable 6 | - name: KUBE_SSH_USER 7 | value: admin 8 | # Log dump for kops (relies on kops-e2e-runner.sh support) 9 | - name: LOG_DUMP_SSH_KEY 10 | value: /workspace/.ssh/kube_aws_rsa 11 | - name: LOG_DUMP_SSH_USER 12 | value: admin 13 | - name: LOG_DUMP_SAVE_LOGS 14 | value: cloud-init-output 15 | - name: LOG_DUMP_SAVE_SERVICES 16 | value: protokube 17 | # kops testing only ever uses Cloud SDK for status and uploads 18 | - name: CLOUDSDK_COMPONENT_MANAGER_DISABLE_UPDATE_CHECK 19 | value: "true" 20 | - name: CLOUDSDK_EXPERIMENTAL_FAST_COMPONENT_UPDATE 21 | value: "false" 22 | # Ignore version-we-pass vs version-kops-expects 23 | - name: KOPS_RUN_OBSOLETE_VERSION 24 | value: "true" 25 | # Except for the updown job itself, use a version of kops that's 26 | # passed updown. 27 | - name: KOPS_LATEST 28 | value: latest-ci-updown-green.txt 29 | - name: KOPS_DEPLOY_LATEST_KUBE 30 | value: "y" 31 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-aws/sig-aws-credentials.yaml: -------------------------------------------------------------------------------- 1 | presets: 2 | # Credentials for using AWS test account 768319786644. Used for kops CNCF tests. 3 | - labels: 4 | preset-aws-credential: "true" 5 | env: 6 | - name: AWS_SHARED_CREDENTIALS_FILE 7 | value: /etc/aws-cred/credentials 8 | volumeMounts: 9 | - name: aws-cred 10 | mountPath: /etc/aws-cred 11 | readOnly: true 12 | volumes: 13 | - name: aws-cred 14 | secret: 15 | secretName: aws-credentials-768319786644 16 | 17 | # Credentials for using AWS test account 607362164682. Used for kops/eks tests. 18 | - labels: 19 | preset-aws-credential-aws-oss-testing: "true" 20 | env: 21 | - name: AWS_SHARED_CREDENTIALS_FILE 22 | value: /etc/aws-cred/credentials 23 | volumeMounts: 24 | - name: aws-cred 25 | mountPath: /etc/aws-cred 26 | readOnly: true 27 | volumes: 28 | - name: aws-cred 29 | secret: 30 | secretName: aws-credentials-607362164682 31 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-cli/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - AdoHe 3 | - pwittrock 4 | - soltysh 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-cluster-lifecycle/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - krousey 3 | - luxas 4 | - roberthbailey 5 | - timothysc 6 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-cluster-lifecycle/manifests.yaml: -------------------------------------------------------------------------------- 1 | # manifest list tests 2 | periodics: 3 | - name: periodic-kubernetes-e2e-manifest-lists 4 | interval: 24h 5 | labels: 6 | preset-service-account: "true" 7 | preset-k8s-ssh: "true" 8 | spec: 9 | containers: 10 | - args: 11 | - --timeout=60 12 | - --repo=k8s.io/kubeadm=master 13 | - --scenario=execute 14 | - -- 15 | - ./tests/e2e/manifests/verify_manifest_lists.sh 16 | image: gcr.io/k8s-testimages/kubekins-e2e:latest-master 17 | imagePullPolicy: Always 18 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-cluster-lifecycle/packages.yaml: -------------------------------------------------------------------------------- 1 | # package tests 2 | periodics: 3 | - name: periodic-kubernetes-e2e-packages-pushed 4 | interval: 24h 5 | labels: 6 | preset-service-account: "true" 7 | preset-k8s-ssh: "true" 8 | spec: 9 | containers: 10 | - args: 11 | - --timeout=60 12 | - --repo=k8s.io/kubeadm=master 13 | - --scenario=execute 14 | - -- 15 | - ./tests/e2e/packages/verify_packages_published.sh 16 | image: gcr.io/k8s-testimages/kubekins-e2e:latest-master 17 | imagePullPolicy: Always 18 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-gcp/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - abgworrall 3 | - dashpole 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-gcp/gpu/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - jiayingz 3 | - mindprince 4 | - vishh 5 | - yguo0905 6 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-instrumentation/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - piosz 3 | - brancz 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-network/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - bowei 3 | - cadmuxe 4 | - jingax10 5 | - rramkumar1 6 | - mrhohn 7 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-node/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - yujuhong 3 | - Random-Liu 4 | - dchen1107 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-release/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - ixdy 3 | - calebamiles 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-scalability/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - mborsz 3 | - shyamjvs 4 | - wojtek-t 5 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-scheduling/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - bsalamat 3 | - k82cn 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-scheduling/sig-scheduling-config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/lighthouse/2cf34fe624e653952216588ea35efaa26f155861/pkg/config/test_data/config/jobs/kubernetes/sig-scheduling/sig-scheduling-config.yaml -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-storage/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - saad-ali 3 | - msau42 4 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/sig-testing/godeps.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/kubernetes: 3 | - name: pull-kubernetes-godeps 4 | run_if_changed: '^((build\/|Godeps\/|vendor\/|hack\/lib\/|hack\/.*godep|staging\/).*)$' 5 | path_alias: "k8s.io/kubernetes" 6 | decorate: true 7 | always_run: false 8 | skip_report: false 9 | labels: 10 | preset-service-account: "true" 11 | preset-dind-enabled: "true" 12 | spec: 13 | containers: 14 | - name: main 15 | command: 16 | - runner.sh 17 | image: gcr.io/k8s-testimages/kubekins-e2e:v20190125-3d9554697e-master 18 | args: 19 | - make 20 | - verify 21 | # docker-in-docker needs privileged mode 22 | securityContext: 23 | privileged: true 24 | env: 25 | # Force checks to run; we don't have remotes so we can't rely on the 26 | # bash/git checks to work. 27 | - name: KUBE_FORCE_VERIFY_CHECKS 28 | value: "Y" 29 | # Space separated list of the checks to run 30 | - name: WHAT 31 | value: "godeps staging-godeps godep-licenses" 32 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/kubernetes/test-infra/test-infra-canaries.yaml: -------------------------------------------------------------------------------- 1 | presubmits: 2 | kubernetes/test-infra: 3 | - name: pull-test-infra-bazel-canary 4 | always_run: false 5 | labels: 6 | preset-service-account: "true" 7 | preset-bazel-scratch-dir: "true" 8 | preset-bazel-remote-cache-enabled: "true" 9 | spec: 10 | containers: 11 | - image: gcr.io/k8s-testimages/kubekins-e2e:latest-experimental 12 | imagePullPolicy: Always 13 | args: 14 | - "--job=$(JOB_NAME)" 15 | - "--repo=k8s.io/$(REPO_NAME)=$(PULL_REFS)" 16 | - "--service-account=/etc/service-account/service-account.json" 17 | - "--upload=gs://kubernetes-jenkins/pr-logs" 18 | - "--scenario=kubernetes_execute_bazel" 19 | - "--timeout=15" 20 | - "--" # end bootstrap args, scenario args below 21 | - "hack/build-then-unit.sh" 22 | # Bazel needs privileged mode in order to sandbox builds. 23 | securityContext: 24 | privileged: true 25 | volumeMounts: 26 | resources: 27 | requests: 28 | memory: "2Gi" 29 | -------------------------------------------------------------------------------- /pkg/config/test_data/config/jobs/tensorflow/minigo/OWNERS: -------------------------------------------------------------------------------- 1 | approvers: 2 | - cjwagner 3 | - Kashomon 4 | -------------------------------------------------------------------------------- /pkg/engines/jenkins/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2017 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package jenkins includes a client and the operational logic for 18 | // managing Jenkins masters in prow. It has been used with the 19 | // following versions of Jenkins: 20 | // 21 | // * 2.60.3 22 | // * 2.73.2 23 | // 24 | // It should most likely work for all versions but use at your own 25 | // risk with a different version. 26 | package jenkins 27 | -------------------------------------------------------------------------------- /pkg/errorutil/doc.go: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2018 The Kubernetes Authors. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | // Package errorutil provides utilities for errors 18 | package errorutil 19 | -------------------------------------------------------------------------------- /pkg/externalplugincfg/types.go: -------------------------------------------------------------------------------- 1 | package externalplugincfg 2 | 3 | const ( 4 | // ConfigMapName name of the config map for external plugins 5 | ConfigMapName = "lighthouse-external-plugins" 6 | ) 7 | 8 | // ExternalPlugin holds configuration for registering an external 9 | // plugin in prow. 10 | type ExternalPlugin struct { 11 | // Name of the plugin. 12 | Name string `json:"name"` 13 | // RequiredResources the kubernetes resources required to enable this external plugin 14 | RequiredResources []Resource `json:"requiredResources,omitempty"` 15 | } 16 | 17 | // Resource represents a kubernetes resource 18 | type Resource struct { 19 | // Kind of the resource. 20 | Kind string `json:"kind"` 21 | // Name of the resource. 22 | Name string `json:"name"` 23 | // Namespace of the resource. 24 | Namespace string `json:"namespace"` 25 | } 26 | 27 | func (r *Resource) String() string { 28 | if r.Namespace != "" { 29 | return r.Kind + "/" + r.Namespace + "/" + r.Name 30 | } 31 | return r.Kind + "/" + r.Name 32 | } 33 | -------------------------------------------------------------------------------- /pkg/filebrowser/fetch_cache.go: -------------------------------------------------------------------------------- 1 | package filebrowser 2 | 3 | import "sync" 4 | 5 | // FetchCache whether or not we should fetch the given repo ref 6 | // we only need to fetch a given repo ref once per webhook request 7 | type FetchCache interface { 8 | // ShouldFetch returns true if we should fetch for the given owner, repo and ref 9 | ShouldFetch(fullName, ref string) bool 10 | } 11 | 12 | // NewFetchCache creates a default fetch cache 13 | func NewFetchCache() FetchCache { 14 | return &defaultFetchCache{fetched: map[string]bool{}} 15 | } 16 | 17 | type defaultFetchCache struct { 18 | lock sync.RWMutex 19 | fetched map[string]bool 20 | } 21 | 22 | // ShouldFetch returns true if we should fetch for the given owner, repo and ref 23 | func (f *defaultFetchCache) ShouldFetch(fullName, ref string) bool { 24 | key := fullName + "@" + ref 25 | 26 | f.lock.Lock() 27 | 28 | answer := false 29 | if !f.fetched[key] { 30 | answer = true 31 | f.fetched[key] = true 32 | } 33 | f.lock.Unlock() 34 | return answer 35 | } 36 | -------------------------------------------------------------------------------- /pkg/filebrowser/fetch_cache_test.go: -------------------------------------------------------------------------------- 1 | package filebrowser_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/jenkins-x/go-scm/scm" 7 | "github.com/jenkins-x/lighthouse/pkg/filebrowser" 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | func TestFetchCache(t *testing.T) { 12 | c := filebrowser.NewFetchCache() 13 | 14 | testCases := []struct { 15 | owner, repo, sha string 16 | expected bool 17 | }{ 18 | { 19 | owner: "myowner", 20 | repo: "myrepo", 21 | sha: "main", 22 | expected: true, 23 | }, 24 | { 25 | owner: "myowner", 26 | repo: "myrepo", 27 | sha: "main", 28 | expected: false, 29 | }, 30 | { 31 | owner: "myowner", 32 | repo: "myrepo", 33 | sha: "a1234", 34 | expected: true, 35 | }, 36 | } 37 | 38 | for _, tc := range testCases { 39 | fullName := scm.Join(tc.owner, tc.repo) 40 | got := c.ShouldFetch(fullName, tc.sha) 41 | assert.Equal(t, tc.expected, got, "for repo %s and sha %s", fullName, tc.sha) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /pkg/filebrowser/file_browsers_test.go: -------------------------------------------------------------------------------- 1 | package filebrowser_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/jenkins-x/lighthouse/pkg/filebrowser" 7 | "github.com/jenkins-x/lighthouse/pkg/git/v2" 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func TestFileBrowsers(t *testing.T) { 12 | cf, err := git.NewClientFactory() 13 | require.NoError(t, err, "failed to create git client factory") 14 | 15 | testCases := []struct { 16 | serverURL string 17 | }{ 18 | { 19 | serverURL: "https://something.com", 20 | }, 21 | { 22 | serverURL: "https://github.com", 23 | }, 24 | { 25 | serverURL: "http://gitlab.something.com", 26 | }, 27 | } 28 | 29 | for _, tc := range testCases { 30 | fb, err := filebrowser.NewFileBrowsers(tc.serverURL, filebrowser.NewFileBrowserFromGitClient(cf)) 31 | require.NoError(t, err, "failed to create file browser for %s", tc.serverURL) 32 | require.NotNil(t, fb.LighthouseGitFileBrowser(), "failed to get default file browser for server %s", tc.serverURL) 33 | 34 | names := []string{filebrowser.Lighthouse, filebrowser.GitHub} 35 | for _, name := range names { 36 | require.NotNil(t, fb.GetFileBrowser(name), "failed to get file browser for server name %s", name) 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /pkg/filebrowser/interface.go: -------------------------------------------------------------------------------- 1 | package filebrowser 2 | 3 | import "github.com/jenkins-x/go-scm/scm" 4 | 5 | // Interface an interface to represent browsing files in a repository 6 | type Interface interface { 7 | // GetMainAndCurrentBranchRefs returns the main branch then the ref value if its different 8 | GetMainAndCurrentBranchRefs(owner, repo, ref string) ([]string, error) 9 | 10 | // GetFile returns a file from the given path in the repository with the given sha 11 | GetFile(owner, repo, path, ref string, fc FetchCache) ([]byte, error) 12 | 13 | // ListFiles returns the file and directory entries in the given path in the repository with the given sha 14 | ListFiles(owner, repo, path, ref string, fc FetchCache) ([]*scm.FileEntry, error) 15 | 16 | // WithDir processes the given repository and reference at the given directory 17 | WithDir(owner, repo, ref string, fc FetchCache, sparseCheckoutPatterns []string, f func(dir string) error) error 18 | } 19 | -------------------------------------------------------------------------------- /pkg/gittest/helpers.go: -------------------------------------------------------------------------------- 1 | package gittest 2 | 3 | import ( 4 | "strings" 5 | "testing" 6 | 7 | "github.com/jenkins-x/lighthouse/pkg/git/v2" 8 | "github.com/stretchr/testify/require" 9 | 10 | "github.com/sirupsen/logrus" 11 | ) 12 | 13 | // GetDefaultBranch gets the default branch name for tests 14 | func GetDefaultBranch(t *testing.T) string { 15 | logger := logrus.WithField("client", "git") 16 | censor := func(content []byte) []byte { return content } 17 | 18 | executor, err := git.NewCensoringExecutor(".", censor, logger) 19 | require.NoError(t, err, "failed to find git binary") 20 | 21 | defaultBranch := "master" 22 | out, err := executor.Run("config", "--global", "--get", "init.defaultBranch") 23 | if err == nil { 24 | text := strings.TrimSpace(string(out)) 25 | if text != "" { 26 | defaultBranch = text 27 | } 28 | } 29 | t.Logf("using default branch: %s\n", defaultBranch) 30 | return defaultBranch 31 | } 32 | -------------------------------------------------------------------------------- /pkg/keeper/githubapp/owner_query.go: -------------------------------------------------------------------------------- 1 | package githubapp 2 | 3 | import ( 4 | "strings" 5 | 6 | "github.com/jenkins-x/lighthouse/pkg/config/keeper" 7 | "github.com/sirupsen/logrus" 8 | ) 9 | 10 | // OwnerQueries separates keeper queries by the owner 11 | type OwnerQueries struct { 12 | Owner string 13 | Queries keeper.Queries 14 | } 15 | 16 | // SplitKeeperQueries splits the keeper queries into a sequence of owner queries 17 | func SplitKeeperQueries(queries keeper.Queries) map[string]keeper.Queries { 18 | answer := map[string]keeper.Queries{} 19 | for _, q1 := range queries { 20 | for org, repos := range SplitRepositories(q1.Repos) { 21 | q := q1 22 | q.Repos = repos 23 | answer[org] = append(answer[org], q) 24 | } 25 | } 26 | return answer 27 | } 28 | 29 | // SplitRepositories splits the list of repositories into a map indexed by owner 30 | func SplitRepositories(repos []string) map[string][]string { 31 | answer := map[string][]string{} 32 | 33 | for _, r := range repos { 34 | paths := strings.SplitN(r, "/", 2) 35 | if len(paths) < 2 { 36 | logrus.Warnf("ignoring invalid repo without an owner: %s", r) 37 | continue 38 | } 39 | owner := paths[0] 40 | answer[owner] = append(answer[owner], r) 41 | } 42 | return answer 43 | } 44 | -------------------------------------------------------------------------------- /pkg/keeper/githubapp/test_data/config.yaml: -------------------------------------------------------------------------------- 1 | tide: 2 | context_options: 3 | from-branch-protection: true 4 | required-if-present-contexts: null 5 | skip-unknown-contexts: false 6 | merge_method: 7 | jstrachan/demo292: merge 8 | jstrachan/environment-jstrachan-cb2-production: merge 9 | jstrachan/environment-jstrachan-cb2-staging: merge 10 | rawlingsj/nodey238: merge 11 | queries: 12 | - labels: 13 | - approved 14 | missingLabels: 15 | - do-not-merge 16 | - do-not-merge/hold 17 | - do-not-merge/work-in-progress 18 | - needs-ok-to-test 19 | - needs-rebase 20 | repos: 21 | - jstrachan/demo292 22 | - jstrachan/environment-jstrachan-cb2-production 23 | - jstrachan/environment-jstrachan-cb2-staging 24 | - rawlingsj/nodey238 25 | - labels: 26 | - updatebot 27 | missingLabels: 28 | - do-not-merge 29 | - do-not-merge/hold 30 | - do-not-merge/work-in-progress 31 | - needs-ok-to-test 32 | - needs-rebase 33 | repos: 34 | - jstrachan/demo292 35 | - jstrachan/environment-jstrachan-cb2-production 36 | - jstrachan/environment-jstrachan-cb2-staging 37 | - rawlingsj/nodey238 38 | target_url: http://deck-jx.35.205.166.161.nip.io -------------------------------------------------------------------------------- /pkg/keeper/interface.go: -------------------------------------------------------------------------------- 1 | package keeper 2 | 3 | import ( 4 | "net/http" 5 | 6 | "github.com/jenkins-x/lighthouse/pkg/keeper/history" 7 | ) 8 | 9 | // Controller the interface for all keeper controllers 10 | // whether regular or the GitHub App flavour which has to handle tokens differently 11 | type Controller interface { 12 | Sync() error 13 | Shutdown() 14 | GetPools() []Pool 15 | ServeHTTP(w http.ResponseWriter, r *http.Request) 16 | GetHistory() *history.History 17 | } 18 | -------------------------------------------------------------------------------- /pkg/launcher/interface.go: -------------------------------------------------------------------------------- 1 | package launcher 2 | 3 | import ( 4 | "github.com/jenkins-x/lighthouse/pkg/apis/lighthouse/v1alpha1" 5 | ) 6 | 7 | // PipelineLauncher the interface is the service which creates Pipelines 8 | type PipelineLauncher interface { 9 | // Launch creates new pipelines 10 | Launch(*v1alpha1.LighthouseJob) (*v1alpha1.LighthouseJob, error) 11 | } 12 | -------------------------------------------------------------------------------- /pkg/logrusutil/logrusutil_test.go: -------------------------------------------------------------------------------- 1 | package logrusutil 2 | 3 | import ( 4 | "os" 5 | "testing" 6 | 7 | "github.com/jenkins-x/lighthouse/pkg/logrusutil/stackdriver" 8 | "github.com/sirupsen/logrus" 9 | "github.com/stretchr/testify/require" 10 | ) 11 | 12 | func TestCreateDefaultFormatter(t *testing.T) { 13 | envKey := "LOGRUS_FORMAT" 14 | origEnvValue, exist := os.LookupEnv(envKey) 15 | defer resetEnvValue(t, envKey, origEnvValue, exist) 16 | for _, tt := range createFormatterTests { 17 | err := os.Setenv("LOGRUS_FORMAT", tt.format) 18 | require.NoError(t, err) 19 | 20 | formatter := CreateDefaultFormatter() 21 | require.IsType(t, tt.expectedFormatter, formatter) 22 | } 23 | } 24 | 25 | func resetEnvValue(t *testing.T, envKey string, origEnvValue string, wasSet bool) { 26 | if wasSet { 27 | err := os.Setenv(envKey, origEnvValue) 28 | require.NoError(t, err) 29 | } 30 | } 31 | 32 | var createFormatterTests = []struct { 33 | format string 34 | expectedFormatter interface{} 35 | }{ 36 | { 37 | format: "text", 38 | expectedFormatter: &logrus.TextFormatter{}, 39 | }, 40 | { 41 | format: "stackdriver", 42 | expectedFormatter: &stackdriver.Formatter{}, 43 | }, 44 | } 45 | -------------------------------------------------------------------------------- /pkg/plugins/approve/approvers/images/bot_notification_for_approval_selection_mechanism.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/lighthouse/2cf34fe624e653952216588ea35efaa26f155861/pkg/plugins/approve/approvers/images/bot_notification_for_approval_selection_mechanism.png -------------------------------------------------------------------------------- /pkg/plugins/approve/approvers/images/directory_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenkins-x/lighthouse/2cf34fe624e653952216588ea35efaa26f155861/pkg/plugins/approve/approvers/images/directory_structure.png -------------------------------------------------------------------------------- /pkg/plugins/branchcleaner/README.md: -------------------------------------------------------------------------------- 1 | # Branchcleaner 2 | 3 | The `branchcleaner` plugin automatically deletes source branches for merged PRs between two branches 4 | on the same repository. This is helpful to keep repos that don't allow forking clean. 5 | 6 | ## Usage 7 | 8 | Enable the `branchcleaner` in the desired repos via the `plugins.yaml`: 9 | 10 | ``` 11 | plugins: 12 | org/repo: 13 | - branchcleaner 14 | ``` 15 | -------------------------------------------------------------------------------- /pkg/plugins/cat/.gitignore: -------------------------------------------------------------------------------- 1 | api-key 2 | -------------------------------------------------------------------------------- /pkg/plugins/trigger/test_data/testorg/myapp/.lighthouse/jenkins-x/dailyjob.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: dailyjob 5 | spec: 6 | pipelineSpec: 7 | params: 8 | - name: GREETINGS 9 | description: "morning greetings, default is Good Morning!" 10 | type: string 11 | default: "Good Morning!" 12 | tasks: 13 | - name: echo-greeting 14 | taskRef: 15 | name: task-echo-message 16 | params: 17 | - name: MESSAGE 18 | value: $(params.GREETINGS) 19 | -------------------------------------------------------------------------------- /pkg/plugins/trigger/test_data/testorg/myapp/.lighthouse/jenkins-x/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | periodics: 5 | - name: dailyjob 6 | cron: "0 4 * * MON-FRI" 7 | source: dailyjob.yaml 8 | pipeline_run_params: 9 | - name: GREETINGS 10 | valueTemplate: 'Howdy!' 11 | -------------------------------------------------------------------------------- /pkg/plugins/updateconfig/test_data/invalid-config.yaml: -------------------------------------------------------------------------------- 1 | boguskey 2 | -------------------------------------------------------------------------------- /pkg/plugins/updateconfig/test_data/invalid-yaml.yaml: -------------------------------------------------------------------------------- 1 | option_settings: 2 | aws: elasticbeanstalk:container:nodejs: 3 | NodeCommand: "node server.compiled.js" 4 | -------------------------------------------------------------------------------- /pkg/poller/pollstate/interface.go: -------------------------------------------------------------------------------- 1 | package pollstate 2 | 3 | type Interface interface { 4 | IsNew(repository, operation, values string) (bool, error) 5 | Invalidate(repository, operation, invalidValue string) 6 | } 7 | -------------------------------------------------------------------------------- /pkg/poller/pollstate/memory.go: -------------------------------------------------------------------------------- 1 | package pollstate 2 | 3 | import "sync" 4 | 5 | type memoryPollstate struct { 6 | cache map[string]string 7 | lock sync.RWMutex 8 | } 9 | 10 | // NewMemoryPollState creates a new poll state 11 | func NewMemoryPollState() Interface { 12 | return &memoryPollstate{ 13 | cache: map[string]string{}, 14 | } 15 | } 16 | 17 | func (p *memoryPollstate) IsNew(repository, operation, newValue string) (bool, error) { 18 | key := repository + ":" + operation 19 | 20 | p.lock.Lock() 21 | 22 | old := p.cache[key] 23 | p.cache[key] = newValue 24 | 25 | p.lock.Unlock() 26 | return old != newValue, nil 27 | } 28 | 29 | func (p *memoryPollstate) Invalidate(repository, operation, invalidValue string) { 30 | key := repository + ":" + operation 31 | 32 | p.lock.Lock() 33 | 34 | currentValue := p.cache[key] 35 | if currentValue == invalidValue { 36 | delete(p.cache, key) 37 | } 38 | 39 | p.lock.Unlock() 40 | } 41 | -------------------------------------------------------------------------------- /pkg/poller/test_data/myorg/myrepo/README.md: -------------------------------------------------------------------------------- 1 | dummy content in git -------------------------------------------------------------------------------- /pkg/scmprovider/content.go: -------------------------------------------------------------------------------- 1 | package scmprovider 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/jenkins-x/go-scm/scm" 7 | ) 8 | 9 | // GetFile returns the file from git 10 | func (c *Client) GetFile(owner, repo, filepath, commit string) ([]byte, error) { 11 | ctx := context.Background() 12 | fullName := c.repositoryName(owner, repo) 13 | answer, r, err := c.client.Contents.Find(ctx, fullName, filepath, commit) 14 | // handle files not existing nicely 15 | if r != nil && r.Status == 404 { 16 | return nil, nil 17 | } 18 | var data []byte 19 | if answer != nil { 20 | data = answer.Data 21 | } 22 | return data, err 23 | } 24 | 25 | // ListFiles returns the files from git 26 | func (c *Client) ListFiles(owner, repo, filepath, commit string) ([]*scm.FileEntry, error) { 27 | ctx := context.Background() 28 | fullName := c.repositoryName(owner, repo) 29 | answer, _, err := c.client.Contents.List(ctx, fullName, filepath, commit, &scm.ListOptions{}) 30 | return answer, err 31 | } 32 | -------------------------------------------------------------------------------- /pkg/scmprovider/git.go: -------------------------------------------------------------------------------- 1 | package scmprovider 2 | 3 | import ( 4 | "context" 5 | 6 | "github.com/jenkins-x/go-scm/scm" 7 | ) 8 | 9 | // GetRef returns the ref from repository 10 | func (c *Client) GetRef(owner, repo, ref string) (string, error) { 11 | ctx := context.Background() 12 | fullName := c.repositoryName(owner, repo) 13 | answer, res, err := c.client.Git.FindRef(ctx, fullName, ref) 14 | if err != nil { 15 | return "", connectErrorHandle(res, err) 16 | } 17 | return answer, nil 18 | } 19 | 20 | // DeleteRef deletes the ref from repository 21 | func (c *Client) DeleteRef(owner, repo, ref string) error { 22 | ctx := context.Background() 23 | fullName := c.repositoryName(owner, repo) 24 | _, err := c.client.Git.DeleteRef(ctx, fullName, ref) 25 | return err 26 | } 27 | 28 | // GetSingleCommit returns a single commit 29 | func (c *Client) GetSingleCommit(owner, repo, SHA string) (*scm.Commit, error) { 30 | ctx := context.Background() 31 | fullName := c.repositoryName(owner, repo) 32 | commit, _, err := c.client.Git.FindCommit(ctx, fullName, SHA) 33 | return commit, err 34 | } 35 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/empty_dir/README.md: -------------------------------------------------------------------------------- 1 | # this dir has no .lighthouse folder -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/jenkins-x/jx3-pipeline-catalog/refs/myversionstreamref/tasks/git-clone/git-clone.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: git-clone 5 | spec: 6 | workspaces: 7 | - name: output 8 | description: The git repo will be cloned onto the volume backing this workspace 9 | mountPath: /workspace 10 | steps: 11 | - script: | 12 | #!/bin/sh 13 | export SUBDIR="source" 14 | echo "git cloning url: $REPO_URL version $PULL_BASE_SHA to dir: $SUBDIR" 15 | git config --global --add user.name ${GIT_AUTHOR_NAME:-jenkins-x-bot} 16 | git config --global --add user.email ${GIT_AUTHOR_EMAIL:-jenkins-x@googlegroups.com} 17 | git config --global credential.helper store 18 | git clone $REPO_URL $SUBDIR 19 | cd $SUBDIR 20 | git checkout $PULL_BASE_SHA 21 | echo "checked out revision: $PULL_BASE_SHA to dir: $SUBDIR" 22 | image: gcr.io/tekton-releases/github.com/tektoncd/pipeline/cmd/git-init:v0.19.0 23 | name: git-clone 24 | resources: { } 25 | workingDir: /workspace 26 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/jenkins-x/jx3-pipeline-catalog/refs/myversionstreamref/tasks/kubevirt/params-task.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | creationTimestamp: null 5 | name: test-params 6 | spec: 7 | params: 8 | - name: FOO 9 | type: string 10 | default: "BAR-CATALOG" 11 | resources: 12 | requests: 13 | cpu: 400m 14 | memory: 512Mi 15 | stepTemplate: 16 | name: "" 17 | annotations: 18 | steps: 19 | - name: test-echo 20 | image: gcr.io/cloud-builders/kubectl@sha256:8ab94be8b2b4f3d117f02d868b39540fddd225447abf4014f7ba4765cb39f753 21 | script: | 22 | #!/usr/bin/env bash 23 | echo "FOO: $(params.FOO)" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/jenkins-x/jx3-pipeline-catalog/refs/myversionstreamref/tasks/kubevirt/params.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | creationTimestamp: null 5 | name: test-params 6 | spec: 7 | pipelineSpec: 8 | params: 9 | - name: FOO 10 | type: string 11 | default: "BAR-CATALOG" 12 | tasks: 13 | - name: test-params 14 | resources: { } 15 | params: 16 | - name: FOO 17 | value: $(params.FOO) 18 | taskSpec: 19 | metadata: { } 20 | params: 21 | - name: FOO 22 | type: string 23 | default: "BAR-CATALOG" 24 | resources: 25 | requests: 26 | cpu: 400m 27 | memory: 512Mi 28 | stepTemplate: 29 | name: "" 30 | annotations: 31 | steps: 32 | - name: test-echo 33 | image: gcr.io/cloud-builders/kubectl@sha256:8ab94be8b2b4f3d117f02d868b39540fddd225447abf4014f7ba4765cb39f753 34 | script: | 35 | #!/usr/bin/env bash 36 | echo "FOO: $(params.FOO)" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-finally-params/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task inherit a 'finally' block 2 | 3 | This example shows how we can inherit the default jenkins-x pipeline parameters in a tekton 'finally' block -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-finally-params/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | steps: 11 | - image: common-image 12 | name: common-build 13 | env: 14 | - name: FOO 15 | value: one 16 | finally: 17 | - name: lint-pr-comment 18 | taskSpec: 19 | metadata: {} 20 | stepTemplate: 21 | name: "" 22 | steps: 23 | - name: lint-pr-comment 24 | image: ghcr.io/jenkins-x/jx-gitops:0.3.1 25 | script: | 26 | #!/bin/sh 27 | set -x 28 | . .jx/variables.sh 29 | jx gitops pr comment -c "$(cat issues.md)" 30 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-finally-uses/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task inherit a 'finally' block 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individually the steps in task 4 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-finally-uses/common.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: common 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: common 9 | taskSpec: 10 | steps: 11 | - image: common-image 12 | name: common-build 13 | env: 14 | - name: FOO 15 | value: foo 16 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-finally-uses/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | steps: 11 | - image: uses:./test_data/load_pipelinerun/pipeline-finally-uses/common.yaml 12 | name: common-build 13 | finally: 14 | - name: from-build-pack-finally 15 | taskSpec: 16 | steps: 17 | - image: uses:./test_data/load_pipelinerun/pipeline-finally-uses/common.yaml 18 | name: common-build 19 | env: 20 | - name: FOO 21 | value: finally 22 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-load-refs-sub-dir/demo-deploy-kubectl.yaml: -------------------------------------------------------------------------------- 1 | # This task deploys with kubectl apply -f 2 | apiVersion: tekton.dev/v1beta1 3 | kind: Task 4 | metadata: 5 | name: demo-deploy-kubectl 6 | spec: 7 | params: 8 | - name: path 9 | description: Path to the manifest to apply 10 | - name: yqArg 11 | description: Okay this is a hack, but I didn't feel right hard-coding `-d1` down below 12 | - name: yamlPathToImage 13 | description: The path to the image to replace in the yaml manifest (arg to yq) 14 | - name: imageURL 15 | description: The URL of the image to deploy 16 | workspaces: 17 | - name: source 18 | steps: 19 | - name: replace-image 20 | image: mikefarah/yq 21 | command: ['yq'] 22 | args: 23 | - "w" 24 | - "-i" 25 | - "$(params.yqArg)" 26 | - "$(params.path)" 27 | - "$(params.yamlPathToImage)" 28 | - "$(params.imageURL)" 29 | - name: run-kubectl 30 | image: lachlanevenson/k8s-kubectl 31 | command: ['kubectl'] 32 | args: 33 | - 'apply' 34 | - '-f' 35 | - '$(params.path)' -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-load-refs-sub-dir/unit-tests.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: unit-tests 5 | spec: 6 | workspaces: 7 | - name: source 8 | mountPath: /workspace/source/go/src/github.com/GoogleContainerTools/skaffold 9 | steps: 10 | - name: run-tests 11 | image: golang 12 | env: 13 | - name: GOPATH 14 | value: /workspace/go 15 | workingDir: $(workspaces.source.path) 16 | script: | 17 | # The intention behind this example Task is to run unit test, however we 18 | # currently do nothing to ensure that a unit test issue doesn't cause this example 19 | # to fail unnecessarily. In the future we could re-introduce the unit tests (since 20 | # we are now pinning the version of Skaffold we pull) or use Tekton Pipelines unit tests. 21 | echo "pass" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-load-refs/demo-deploy-kubectl.yaml: -------------------------------------------------------------------------------- 1 | # This task deploys with kubectl apply -f 2 | apiVersion: tekton.dev/v1beta1 3 | kind: Task 4 | metadata: 5 | name: demo-deploy-kubectl 6 | spec: 7 | params: 8 | - name: path 9 | description: Path to the manifest to apply 10 | - name: yqArg 11 | description: Okay this is a hack, but I didn't feel right hard-coding `-d1` down below 12 | - name: yamlPathToImage 13 | description: The path to the image to replace in the yaml manifest (arg to yq) 14 | - name: imageURL 15 | description: The URL of the image to deploy 16 | workspaces: 17 | - name: source 18 | steps: 19 | - name: replace-image 20 | image: mikefarah/yq 21 | command: ['yq'] 22 | args: 23 | - "w" 24 | - "-i" 25 | - "$(params.yqArg)" 26 | - "$(params.path)" 27 | - "$(params.yamlPathToImage)" 28 | - "$(params.imageURL)" 29 | - name: run-kubectl 30 | image: lachlanevenson/k8s-kubectl 31 | command: ['kubectl'] 32 | args: 33 | - 'apply' 34 | - '-f' 35 | - '$(params.path)' -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-load-refs/unit-tests.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: unit-tests 5 | spec: 6 | workspaces: 7 | - name: source 8 | mountPath: /workspace/source/go/src/github.com/GoogleContainerTools/skaffold 9 | steps: 10 | - name: run-tests 11 | image: golang 12 | env: 13 | - name: GOPATH 14 | value: /workspace/go 15 | workingDir: $(workspaces.source.path) 16 | script: | 17 | # The intention behind this example Task is to run unit test, however we 18 | # currently do nothing to ensure that a unit test issue doesn't cause this example 19 | # to fail unnecessarily. In the future we could re-introduce the unit tests (since 20 | # we are now pinning the version of Skaffold we pull) or use Tekton Pipelines unit tests. 21 | echo "pass" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-params-from-tasks-results/save-results-task.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: save-results 5 | labels: 6 | app.kubernetes.io/version: "0.1" 7 | spec: 8 | params: 9 | - name: value_to_save 10 | type: string 11 | default: "" 12 | results: 13 | - name: "result_value" 14 | description: "result_value" 15 | stepTemplate: 16 | imagePullPolicy: IfNotPresent 17 | resources: 18 | # override limits for all containers here 19 | limits: {} 20 | workingDir: /workspace/source 21 | steps: 22 | - name: save-result 23 | image: ubuntu:jammy 24 | script: | 25 | #!/usr/bin/env sh 26 | set -ex 27 | result_value="$(params.value_to_save)" 28 | echo "results.result_value.path is $(results.result_value.path)" 29 | echo -n "${result_value}" > $(results.result_value.path) 30 | echo "result_value is ${result_value}" 31 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline-params-from-tasks-results/show-results-task.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: show-results 5 | labels: 6 | app.kubernetes.io/version: "0.1" 7 | spec: 8 | params: 9 | - name: value_to_show 10 | type: string 11 | default: "" 12 | stepTemplate: 13 | imagePullPolicy: IfNotPresent 14 | resources: 15 | # override limits for all containers here 16 | limits: {} 17 | workingDir: /workspace/source 18 | steps: 19 | - name: show-result 20 | image: ubuntu:jammy 21 | script: | 22 | #!/usr/bin/env sh 23 | set -ex 24 | value_to_show="$(params.value_to_show)" 25 | echo "value_to_show is ${value_to_show}" 26 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline/demo-deploy-kubectl.yaml: -------------------------------------------------------------------------------- 1 | # This task deploys with kubectl apply -f 2 | apiVersion: tekton.dev/v1beta1 3 | kind: Task 4 | metadata: 5 | name: demo-deploy-kubectl 6 | spec: 7 | params: 8 | - name: path 9 | description: Path to the manifest to apply 10 | - name: yqArg 11 | description: Okay this is a hack, but I didn't feel right hard-coding `-d1` down below 12 | - name: yamlPathToImage 13 | description: The path to the image to replace in the yaml manifest (arg to yq) 14 | - name: imageURL 15 | description: The URL of the image to deploy 16 | workspaces: 17 | - name: source 18 | steps: 19 | - name: replace-image 20 | image: mikefarah/yq 21 | command: ['yq'] 22 | args: 23 | - "w" 24 | - "-i" 25 | - "$(params.yqArg)" 26 | - "$(params.path)" 27 | - "$(params.yamlPathToImage)" 28 | - "$(params.imageURL)" 29 | - name: run-kubectl 30 | image: lachlanevenson/k8s-kubectl 31 | command: ['kubectl'] 32 | args: 33 | - 'apply' 34 | - '-f' 35 | - '$(params.path)' -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pipeline/unit-tests.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: unit-tests 5 | spec: 6 | workspaces: 7 | - name: source 8 | mountPath: /workspace/source/go/src/github.com/GoogleContainerTools/skaffold 9 | steps: 10 | - name: run-tests 11 | image: golang 12 | env: 13 | - name: GOPATH 14 | value: /workspace/go 15 | workingDir: $(workspaces.source.path) 16 | script: | 17 | # The intention behind this example Task is to run unit test, however we 18 | # currently do nothing to ensure that a unit test issue doesn't cause this example 19 | # to fail unnecessarily. In the future we could re-introduce the unit tests (since 20 | # we are now pinning the version of Skaffold we pull) or use Tekton Pipelines unit tests. 21 | echo "pass" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pr-load-refs/add-params.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: add-params 5 | annotations: 6 | description: | 7 | A simple task that sums the two provided integers 8 | spec: 9 | params: 10 | - name: a 11 | type: string 12 | description: The first integer 13 | - name: b 14 | type: string 15 | description: The second integer 16 | steps: 17 | - name: sum 18 | image: bash:latest 19 | script: | 20 | #!/usr/bin/env bash 21 | echo -n $(( "$(inputs.params.a)" + "$(inputs.params.b)" )) -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pr-load-refs/pipeline-with-extra-params.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Pipeline 3 | metadata: 4 | name: pipeline-with-extra-params 5 | spec: 6 | params: 7 | - name: pl-param-x 8 | type: string 9 | - name: pl-param-y 10 | type: string 11 | tasks: 12 | - name: add-params 13 | taskRef: 14 | name: add-params 15 | params: 16 | - name: a 17 | value: "$(params.pl-param-x)" 18 | - name: b 19 | value: "$(params.pl-param-y)" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/pr-load-refs/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: pipelinerun-with-extra-params 5 | annotations: 6 | lighthouse.jenkins-x.io/loadFileRefs: ".*" 7 | spec: 8 | params: 9 | - name: pl-param-x 10 | value: "100" 11 | - name: pl-param-y 12 | value: "200" 13 | # the extra parameter 14 | - name: pl-param-z 15 | value: "300" 16 | pipelineRef: 17 | name: pipeline-with-extra-params -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/task-append-steps/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: cheese 5 | annotations: 6 | "lighthouse.jenkins-x.io/appendStepsURL": "https://gist.githubusercontent.com/jstrachan/1937a809fd4223f3588db32cbb3a034f/raw/3bb56dd20cae2795e0ec4788d79e18d9486da9d9/sample-git-clone-task.yaml" 7 | spec: 8 | steps: 9 | - image: some/linter:1.2.3 10 | name: lint 11 | workingDir: /workspace/source 12 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/task-prepend-steps/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: cheese 5 | annotations: 6 | "lighthouse.jenkins-x.io/prependStepsURL": "https://gist.githubusercontent.com/jstrachan/1937a809fd4223f3588db32cbb3a034f/raw/3bb56dd20cae2795e0ec4788d79e18d9486da9d9/sample-git-clone-task.yaml" 7 | spec: 8 | steps: 9 | - image: some/linter:1.2.3 10 | name: lint 11 | workingDir: /workspace/source 12 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-all-steps/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse all steps in a task 2 | 3 | This example shows how we can use `image: uses:sourceURI` to include all the steps in task -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-all-steps/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | steps: 11 | - image: uses:https://raw.githubusercontent.com/jenkins-x/jx3-pipeline-catalog/1d39235ee9235d7d52d4025a8e59cb8bda04306a/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml 12 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-custom-param-task/README.md: -------------------------------------------------------------------------------- 1 | ## Shows using custom parameters -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-custom-param-task/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | creationTimestamp: null 5 | name: params 6 | spec: 7 | pipelineSpec: 8 | tasks: 9 | - name: test-params 10 | params: 11 | - name: FOO 12 | value: $(params.FOO) 13 | resources: { } 14 | taskSpec: 15 | metadata: { } 16 | params: 17 | - name: FOO 18 | value: $(params.FOO) 19 | stepTemplate: 20 | image: uses:jenkins-x/jx3-pipeline-catalog/tasks/kubevirt/params.yaml@versionStream 21 | name: "" 22 | resources: 23 | requests: 24 | cpu: 400m 25 | memory: 512Mi 26 | steps: 27 | - name: test-echo 28 | resources: { } 29 | podTemplate: { } 30 | serviceAccountName: tekton-bot -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-custom-param/README.md: -------------------------------------------------------------------------------- 1 | ## Shows using custom parameters -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-custom-param/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | creationTimestamp: null 5 | name: params 6 | spec: 7 | pipelineSpec: 8 | tasks: 9 | - name: test-params 10 | params: 11 | - name: FOO 12 | value: $(params.FOO) 13 | resources: { } 14 | taskSpec: 15 | metadata: { } 16 | params: 17 | - name: FOO 18 | value: $(params.FOO) 19 | stepTemplate: 20 | image: uses:jenkins-x/jx3-pipeline-catalog/tasks/kubevirt/params-task.yaml@versionStream 21 | name: "" 22 | resources: 23 | requests: 24 | cpu: 400m 25 | memory: 512Mi 26 | steps: 27 | - name: test-echo 28 | resources: { } 29 | podTemplate: { } 30 | serviceAccountName: tekton-bot -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-issue-1234/README.md: -------------------------------------------------------------------------------- 1 | ## Replication of a issue 1234 2 | 3 | https://github.com/jenkins-x/lighthouse/issues/1234 -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-issue-1234/common.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: common 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: common 9 | taskSpec: 10 | steps: 11 | - image: common-image 12 | name: common-build 13 | env: 14 | - name: FOO 15 | value: foo 16 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-issue-1234/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | steps: 11 | - image: uses:./test_data/load_pipelinerun/uses-issue-1234/common.yaml 12 | name: common-build 13 | env: 14 | - name: FOO 15 | value: one 16 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-issue-1234/source2.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | steps: 11 | - image: uses:./test_data/load_pipelinerun/uses-issue-1234/common.yaml 12 | name: common-build -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-add-custom-explict/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task mixed with custom tasks 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task and mix them with custom local steps (which don't use `uses:`) 4 | 5 | This example uses the verbose syntax where each step always has an image (rather than inheriting from `stepTemplate.image`) -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-add-custom/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task mixed with custom tasks 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task and mix them with custom local steps (which don't use `uses:`) 4 | 5 | This example uses the concise syntax; where empty `image:` values get inherited from the `stepTemplate.image` 6 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-add-custom/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | stepTemplate: 11 | image: uses:https://raw.githubusercontent.com/jenkins-x/jx3-pipeline-catalog/1d39235ee9235d7d52d4025a8e59cb8bda04306a/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml 12 | steps: 13 | - image: node:12-slim 14 | name: my-first-step 15 | script: | 16 | #!/bin/sh 17 | npm first thing 18 | - name: jx-variables 19 | - name: build-npm-install 20 | - name: build-npm-test 21 | - image: node:12-slim 22 | name: my-pre-build-container 23 | script: | 24 | #!/bin/sh 25 | npm pre build container 26 | - name: build-container-build 27 | - name: promote-jx-preview 28 | - image: node:12-slim 29 | name: my-final-step 30 | script: | 31 | #!/bin/sh 32 | npm final thing 33 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-custom-git/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task using both both github repository and the local lighthouse git server -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-custom-git/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | workspaces: 11 | - name: output 12 | persistentVolumeClaim: 13 | claimName: "cheese" 14 | stepTemplate: 15 | image: uses:lighthouse:jenkins-x/jx3-pipeline-catalog/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml@1d39235ee9235d7d52d4025a8e59cb8bda04306a 16 | steps: 17 | - name: clone 18 | image: uses:tektoncd/catalog/task/git-clone/0.2/git-clone.yaml@HEAD 19 | - name: jx-variables 20 | - name: build-npm-install 21 | - name: build-npm-test 22 | - name: build-container-build 23 | - name: promote-jx-preview 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-explicit/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task 4 | 5 | This example uses the verbose syntax where each step always has an image (rather than inheriting from `stepTemplate.image`) -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-inherit-sidecar/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task inherit a sidecar 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-inherit-sidecar/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | stepTemplate: 11 | image: uses:jenkins-x/jx3-pipeline-catalog/packs/javascript-selenium/.lighthouse/jenkins-x/pullrequest.yaml@1d39235ee9235d7d52d4025a8e59cb8bda04306a 12 | steps: 13 | - name: jx-variables 14 | - image: uses:https://raw.githubusercontent.com/jenkins-x/jx3-pipeline-catalog/1d39235ee9235d7d52d4025a8e59cb8bda04306a/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml 15 | name: build-npm-install 16 | - name: build-npm-test 17 | - name: build-container-build 18 | - name: promote-jx-preview 19 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-multiple-copies/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task 2 | 3 | This example shows how we can reuse the same step multiple times by using the `name:` syntax of `reuseStepName:uniqueSuffix` -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-multiple-copies/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | stepTemplate: 11 | image: uses:jenkins-x/jx3-pipeline-catalog/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml@1d39235ee9235d7d52d4025a8e59cb8bda04306a 12 | steps: 13 | - name: jx-variables 14 | - image: uses:https://raw.githubusercontent.com/jenkins-x/jx3-pipeline-catalog/1d39235ee9235d7d52d4025a8e59cb8bda04306a/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml 15 | name: build-npm-install 16 | - name: build-npm-test 17 | - name: build-container-build 18 | - name: build-container-build:cheese 19 | env: 20 | - name: IMAGE 21 | value: gcr.io/myproject/myimage 22 | - name: build-container-build:wine 23 | env: 24 | - name: IMAGE 25 | value: gcr.io/myproject/wine 26 | - name: promote-jx-preview 27 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-override-resources/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task 2 | 3 | This example shows how we can use `image: uses:sourceURI` to reuse all the steps from a task including using reusing shared volume mounts and resource limits on the `stepTemplate` while being able to locally override them -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-override-resources/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | stepTemplate: 11 | resources: 12 | requests: 13 | cpu: 600m 14 | volumeMounts: 15 | - mountPath: /tekton/home/npm-something-else 16 | name: npmrc 17 | workingDir: /workspace/my-source 18 | steps: 19 | - image: uses:jenkins-x/jx3-pipeline-catalog/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml@1d39235ee9235d7d52d4025a8e59cb8bda04306a 20 | 21 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-override-script/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task and override them 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task and then override (add/replace) properties: 4 | 5 | * command to run (either via `script` or `command` and optionally `args`) 6 | * working directory via `workingDir:` 7 | * environment variables via `env:` or `envFrom:` 8 | * volume mounts via `volumeMounts:` -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-override-script/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | stepTemplate: 11 | image: uses:jenkins-x/jx3-pipeline-catalog/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml@1d39235ee9235d7d52d4025a8e59cb8bda04306a 12 | steps: 13 | - name: jx-variables 14 | - image: uses:https://raw.githubusercontent.com/jenkins-x/jx3-pipeline-catalog/1d39235ee9235d7d52d4025a8e59cb8bda04306a/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml 15 | name: build-npm-install 16 | - name: build-npm-test 17 | - name: build-container-build 18 | - name: promote-jx-preview 19 | - name: promote-release 20 | script: | 21 | #!/usr/bin/env sh 22 | source .jx/variables.sh 23 | jx updatebot argo promote --target-git-url https://github.com/myorg/my-staging-repo 24 | 25 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-override/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task and override them 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task and then override (add/replace) properties: 4 | 5 | * command to run (either via `script` or `command` and optionally `args`) 6 | * working directory via `workingDir:` 7 | * environment variables via `env:` or `envFrom:` 8 | * volume mounts via `volumeMounts:` -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-version-stream/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task - and using the `@versionStream` which is resolved with the version stream to find the actual git tag to use. -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-version-stream/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | stepTemplate: 11 | image: uses:jenkins-x/jx3-pipeline-catalog/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml@versionStream 12 | steps: 13 | - name: jx-variables 14 | - name: build-npm-install 15 | - name: build-npm-test 16 | - name: build-container-build 17 | - name: promote-jx-preview 18 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-with-sidecar-ws/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task with sidecars and workspaces 2 | 3 | This requires alpha support to pass validation -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-with-sidecar/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task with sidecars 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps-with-sidecar/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | stepTemplate: 11 | image: uses:jenkins-x/jx3-pipeline-catalog/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml@1d39235ee9235d7d52d4025a8e59cb8bda04306a 12 | steps: 13 | - name: jx-variables 14 | - image: uses:https://raw.githubusercontent.com/jenkins-x/jx3-pipeline-catalog/1d39235ee9235d7d52d4025a8e59cb8bda04306a/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml 15 | name: build-npm-install 16 | - name: build-npm-test 17 | - name: build-container-build 18 | - name: promote-jx-preview 19 | sidecars: 20 | - image: selenium/standalone-chrome 21 | name: selenium 22 | env: 23 | - name: START_XVFB 24 | value: 'false' 25 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-steps/source.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: cheese 5 | spec: 6 | pipelineSpec: 7 | tasks: 8 | - name: from-build-pack 9 | taskSpec: 10 | stepTemplate: 11 | image: uses:jenkins-x/jx3-pipeline-catalog/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml@1d39235ee9235d7d52d4025a8e59cb8bda04306a 12 | steps: 13 | - name: jx-variables 14 | - image: uses:https://raw.githubusercontent.com/jenkins-x/jx3-pipeline-catalog/1d39235ee9235d7d52d4025a8e59cb8bda04306a/packs/javascript/.lighthouse/jenkins-x/pullrequest.yaml 15 | name: build-npm-install 16 | - name: build-npm-test 17 | - name: build-container-build 18 | - name: promote-jx-preview 19 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_pipelinerun/uses-task-and-steps/README.md: -------------------------------------------------------------------------------- 1 | ## Reuse steps in a task 2 | 3 | This example shows how we can use `image: uses:sourceURI` and a `name: mystep` to include individual the steps in task -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/load_url/foo.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | labels: 5 | jenkins.io/pipelineType: build 6 | name: jx-kh-chuck 7 | spec: 8 | pipelineSpec: 9 | tasks: 10 | - name: chuck-it 11 | taskSpec: 12 | steps: 13 | - image: jenkinsxio/chuck:0.0.1 14 | name: chuck 15 | resources: 16 | requests: 17 | cpu: 100m 18 | memory: 200Mi 19 | workingDir: /workspace/source 20 | serviceAccountName: tekton-bot 21 | timeout: 0h20m0s -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/branchtest/refs/master/.lighthouse/triggers/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "lint" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/lint|/relint)" 10 | rerun_command: "/relint" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline 16 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/branchtest/refs/mybranch/.lighthouse/triggers/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "lint" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/lint|/relint)" 10 | rerun_command: "/relint" 11 | agent: tekton-pipeline 12 | - name: newthingy 13 | context: "newthingy" 14 | always_run: true 15 | optional: false 16 | trigger: "(?:/newthingy|/renewthingy)" 17 | rerun_command: "/renewthingy" 18 | agent: tekton-pipeline 19 | postsubmits: 20 | - name: release 21 | context: "release" 22 | agent: tekton-pipeline 23 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/duplicate-postsubmit/.lighthouse/duplicate-lint/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "test" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/test|/retest)" 10 | rerun_command: "/retest" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline 16 | 17 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/duplicate-postsubmit/.lighthouse/linter/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: test 6 | context: "test" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/test|/retest)" 10 | rerun_command: "/retest" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline 16 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/duplicate-presubmit/.lighthouse/duplicate-lint/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "test" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/test|/retest)" 10 | rerun_command: "/retest" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline 16 | 17 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/duplicate-presubmit/.lighthouse/linter/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "lint" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/lint|/relint)" 10 | rerun_command: "/relint" 11 | agent: tekton-pipeline 12 | 13 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/issue-1306/refs/master/.lighthouse/jenkins-x/pullrequest.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | creationTimestamp: null 5 | name: release 6 | spec: 7 | pipelineSpec: 8 | tasks: 9 | - name: release 10 | taskSpec: 11 | steps: 12 | - image: uses:.lighthouse/jenkins-x/shared-task.yaml 13 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/issue-1306/refs/master/.lighthouse/jenkins-x/shared-task.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: task1 5 | spec: 6 | steps: 7 | - name: step-1 8 | image: ubuntu 9 | script: | 10 | #!/usr/bin/env bash 11 | echo ubuntu-master -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/issue-1306/refs/master/.lighthouse/jenkins-x/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: pullrequest 6 | context: "pr" 7 | always_run: true 8 | optional: false 9 | source: "pullrequest.yaml" 10 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/issue-1306/refs/pr1/.lighthouse/jenkins-x/pullrequest.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | creationTimestamp: null 5 | name: release 6 | spec: 7 | pipelineSpec: 8 | tasks: 9 | - name: release 10 | taskSpec: 11 | steps: 12 | - image: uses:.lighthouse/jenkins-x/shared-task.yaml 13 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/issue-1306/refs/pr1/.lighthouse/jenkins-x/shared-task.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: Task 3 | metadata: 4 | name: shared-task 5 | spec: 6 | steps: 7 | - name: step-1 8 | image: ubuntu 9 | script: | 10 | #!/usr/bin/env bash 11 | echo ubuntu-pr1 -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/issue-1306/refs/pr1/.lighthouse/jenkins-x/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: pullrequest 6 | context: "pr" 7 | always_run: true 8 | optional: false 9 | source: "pullrequest.yaml" 10 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/loadtest/.lighthouse/dummy/README.md: -------------------------------------------------------------------------------- 1 | to test a dir without a config file 2 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/loadtest/.lighthouse/jenkins-x/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: test 6 | context: "test" 7 | always_run: true 8 | optional: false 9 | trigger: "/test" 10 | rerun_command: "/retest" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline 16 | 17 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/loadtest/.lighthouse/linter/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "lint" 7 | always_run: true 8 | optional: false 9 | trigger: "/lint" 10 | rerun_command: "/relint" 11 | agent: tekton-pipeline 12 | 13 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/myrepo/.lighthouse/dummy/README.md: -------------------------------------------------------------------------------- 1 | to test a dir without a config file 2 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/myrepo/.lighthouse/jenkins-x/release.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: release 5 | spec: 6 | pipelineSpec: 7 | params: 8 | - name: MORNING_GREETINGS 9 | description: "morning greetings, default is Good Morning!" 10 | type: string 11 | default: "Good Morning!" 12 | - name: NIGHT_GREETINGS 13 | description: "Night greetings, default is Good Night!" 14 | type: string 15 | default: "Good Night!" 16 | tasks: 17 | # Task to display morning greetings 18 | - name: echo-good-morning 19 | taskRef: 20 | name: task-echo-message 21 | params: 22 | - name: MESSAGE 23 | value: $(params.MORNING_GREETINGS) 24 | # Task to display night greetings 25 | - name: echo-good-night 26 | taskRef: 27 | name: task-echo-message 28 | params: 29 | - name: MESSAGE 30 | value: $(params.NIGHT_GREETINGS) 31 | params: 32 | - name: MORNING_GREETINGS 33 | value: "Good Morning, Bob!" 34 | - name: NIGHT_GREETINGS 35 | value: "Good Night, Bob!" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/myrepo/.lighthouse/jenkins-x/test.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: test 5 | spec: 6 | pipelineSpec: 7 | params: 8 | - name: MORNING_GREETINGS 9 | description: "morning greetings, default is Good Morning!" 10 | type: string 11 | default: "Good Morning!" 12 | - name: NIGHT_GREETINGS 13 | description: "Night greetings, default is Good Night!" 14 | type: string 15 | default: "Good Night!" 16 | tasks: 17 | # Task to display morning greetings 18 | - name: echo-good-morning 19 | taskRef: 20 | name: task-echo-message 21 | params: 22 | - name: MESSAGE 23 | value: $(params.MORNING_GREETINGS) 24 | # Task to display night greetings 25 | - name: echo-good-night 26 | taskRef: 27 | name: task-echo-message 28 | params: 29 | - name: MESSAGE 30 | value: $(params.NIGHT_GREETINGS) 31 | params: 32 | - name: MORNING_GREETINGS 33 | value: "Good Morning, Bob!" 34 | - name: NIGHT_GREETINGS 35 | value: "Good Night, Bob!" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/myrepo/.lighthouse/jenkins-x/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: test 6 | context: "test" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/test|/retest)" 10 | rerun_command: "/retest" 11 | source: "test.yaml" 12 | pipeline_run_params: 13 | - name: MORNING_GREETINGS 14 | valueTemplate: "hey this is a custom parameter" 15 | postsubmits: 16 | - name: release 17 | context: "release" 18 | source: "release.yaml" 19 | branchProtection: 20 | contexts: 21 | - test 22 | 23 | -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/myrepo/.lighthouse/linter/lint.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: tekton.dev/v1beta1 2 | kind: PipelineRun 3 | metadata: 4 | name: lint 5 | spec: 6 | pipelineSpec: 7 | params: 8 | - name: MORNING_GREETINGS 9 | description: "morning greetings, default is Good Morning!" 10 | type: string 11 | default: "Good Morning!" 12 | - name: NIGHT_GREETINGS 13 | description: "Night greetings, default is Good Night!" 14 | type: string 15 | default: "Good Night!" 16 | tasks: 17 | # Task to display morning greetings 18 | - name: echo-good-morning 19 | taskRef: 20 | name: task-echo-message 21 | params: 22 | - name: MESSAGE 23 | value: $(params.MORNING_GREETINGS) 24 | # Task to display night greetings 25 | - name: echo-good-night 26 | taskRef: 27 | name: task-echo-message 28 | params: 29 | - name: MESSAGE 30 | value: $(params.NIGHT_GREETINGS) 31 | params: 32 | - name: MORNING_GREETINGS 33 | value: "Good Morning, Bob!" 34 | - name: NIGHT_GREETINGS 35 | value: "Good Night, Bob!" -------------------------------------------------------------------------------- /pkg/triggerconfig/inrepo/test_data/myorg/myrepo/.lighthouse/linter/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "lint" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/lint|/relint)" 10 | rerun_command: "/relint" 11 | source: "lint.yaml" 12 | branchProtection: 13 | contexts: 14 | - lint 15 | 16 | -------------------------------------------------------------------------------- /pkg/triggerconfig/merge/combine.go: -------------------------------------------------------------------------------- 1 | package merge 2 | 3 | import ( 4 | "github.com/jenkins-x/lighthouse/pkg/triggerconfig" 5 | ) 6 | 7 | // CombineConfigs combines the two configurations together from multiple files 8 | func CombineConfigs(a, b *triggerconfig.Config) *triggerconfig.Config { 9 | if a == nil { 10 | return b 11 | } 12 | if b == nil { 13 | return a 14 | } 15 | a.Spec.Presubmits = append(a.Spec.Presubmits, b.Spec.Presubmits...) 16 | a.Spec.Postsubmits = append(a.Spec.Postsubmits, b.Spec.Postsubmits...) 17 | a.Spec.Periodics = append(a.Spec.Periodics, b.Spec.Periodics...) 18 | a.Spec.Deployments = append(a.Spec.Deployments, b.Spec.Deployments...) 19 | return a 20 | } 21 | -------------------------------------------------------------------------------- /pkg/triggerconfig/merge/helpers.go: -------------------------------------------------------------------------------- 1 | package merge 2 | 3 | // StringArrayIndex returns the index in the slice which equals the given value 4 | func StringArrayIndex(array []string, value string) int { 5 | for i, v := range array { 6 | if v == value { 7 | return i 8 | } 9 | } 10 | return -1 11 | } 12 | 13 | // RemoveStringArrayAtIndex removes an item at a given index 14 | func RemoveStringArrayAtIndex(s []string, index int) []string { 15 | ret := make([]string, 0) 16 | ret = append(ret, s[:index]...) 17 | return append(ret, s[index+1:]...) 18 | } 19 | -------------------------------------------------------------------------------- /pkg/triggerconfig/merge/test_data/simple/expected-config.yaml: -------------------------------------------------------------------------------- 1 | branch-protection: {} 2 | github: 3 | LinkURL: null 4 | in_repo_config: {} 5 | plank: {} 6 | postsubmits: 7 | myorg/myowner: 8 | - agent: tekton-pipeline 9 | cluster: default 10 | context: release 11 | name: release 12 | namespace: "" 13 | presubmits: 14 | myorg/myowner: 15 | - agent: tekton-pipeline 16 | always_run: true 17 | cluster: default 18 | context: lint 19 | name: lint 20 | namespace: "" 21 | rerun_command: /relint 22 | trigger: (?:/lint|/relint) 23 | push_gateway: 24 | serve_metrics: false 25 | tide: 26 | context_options: 27 | required-if-present-contexts: null 28 | -------------------------------------------------------------------------------- /pkg/triggerconfig/merge/test_data/simple/source-config.yaml: -------------------------------------------------------------------------------- 1 | branch-protection: {} 2 | github: 3 | LinkURL: null 4 | plank: {} 5 | presubmits: {} 6 | push_gateway: 7 | serve_metrics: false 8 | tide: 9 | context_options: 10 | required-if-present-contexts: null -------------------------------------------------------------------------------- /pkg/triggerconfig/merge/test_data/simple/source-plugins.yaml: -------------------------------------------------------------------------------- 1 | approve: 2 | - lgtm_acts_as_approve: true 3 | repos: 4 | - someorg/somerepo 5 | require_self_approval: true 6 | cat: {} 7 | cherry_pick_unapproved: {} 8 | config_updater: 9 | maps: 10 | env/prow/config.yaml: 11 | name: config 12 | env/prow/plugins.yaml: 13 | name: plugins 14 | heart: {} 15 | label: 16 | additional_labels: null 17 | owners: {} 18 | plugins: 19 | someorg/somerepo: 20 | - config-updater 21 | - approve 22 | - assign 23 | - help 24 | - hold 25 | - lgtm 26 | - lifecycle 27 | - size 28 | - trigger 29 | - wip 30 | - cat 31 | - override 32 | - dog 33 | - pony 34 | requiresig: {} 35 | sigmention: {} 36 | size: 37 | l: 0 38 | m: 0 39 | s: 0 40 | xl: 0 41 | xxl: 0 42 | triggers: 43 | - repos: 44 | - someorg/somerepo 45 | trusted_org: someorg -------------------------------------------------------------------------------- /pkg/triggerconfig/merge/test_data/simple/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "lint" 7 | always_run: true 8 | optional: false 9 | trigger: "(?:/lint|/relint)" 10 | rerun_command: "/relint" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline 16 | -------------------------------------------------------------------------------- /pkg/triggerconfig/scmload/test_data/myorg/duplicate-postsubmit/.lighthouse/duplicate-lint/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "test" 7 | alwaysRun: true 8 | optional: false 9 | trigger: "/test" 10 | rerunCommand: "/retest" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline 16 | 17 | -------------------------------------------------------------------------------- /pkg/triggerconfig/scmload/test_data/myorg/duplicate-postsubmit/.lighthouse/linter/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: test 6 | context: "test" 7 | alwaysRun: true 8 | optional: false 9 | trigger: "/test" 10 | rerunCommand: "/retest" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline -------------------------------------------------------------------------------- /pkg/triggerconfig/scmload/test_data/myorg/duplicate-presubmit/.lighthouse/duplicate-lint/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "test" 7 | alwaysRun: true 8 | optional: false 9 | trigger: "/test" 10 | rerunCommand: "/retest" 11 | agent: tekton-pipeline 12 | postsubmits: 13 | - name: release 14 | context: "release" 15 | agent: tekton-pipeline 16 | 17 | -------------------------------------------------------------------------------- /pkg/triggerconfig/scmload/test_data/myorg/duplicate-presubmit/.lighthouse/linter/triggers.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: config.lighthouse.jenkins-x.io/v1alpha1 2 | kind: TriggerConfig 3 | spec: 4 | presubmits: 5 | - name: lint 6 | context: "lint" 7 | alwaysRun: true 8 | optional: false 9 | trigger: "/lint" 10 | rerunCommand: "/relint" 11 | agent: tekton-pipeline 12 | 13 | -------------------------------------------------------------------------------- /pkg/triggerconfig/types.go: -------------------------------------------------------------------------------- 1 | package triggerconfig 2 | 3 | import ( 4 | "github.com/jenkins-x/lighthouse/pkg/config/job" 5 | metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" 6 | ) 7 | 8 | // Config represents local trigger configurations which can be merged into the configuration 9 | type Config struct { 10 | metav1.TypeMeta `json:",inline"` 11 | // +optional 12 | metav1.ObjectMeta `json:"metadata"` 13 | 14 | // Spec holds the desired state of the Config from the client 15 | // +optional 16 | Spec ConfigSpec `json:"spec"` 17 | } 18 | 19 | // ConfigSpec specifies the optional presubmit/postsubmit/trigger configurations 20 | type ConfigSpec struct { 21 | // Presubmit zero or more presubmits 22 | Presubmits []job.Presubmit `json:"presubmits,omitempty"` 23 | 24 | // Postsubmit zero or more postsubmits 25 | Postsubmits []job.Postsubmit `json:"postsubmits,omitempty"` 26 | 27 | Periodics []job.Periodic `json:"periodics,omitempty"` 28 | 29 | Deployments []job.Deployment `json:"deployments,omitempty"` 30 | } 31 | 32 | // ConfigList contains a list of Config 33 | type ConfigList struct { 34 | metav1.TypeMeta `json:",inline"` 35 | // +optional 36 | metav1.ListMeta `json:"metadata,omitempty"` 37 | Items []Config `json:"items"` 38 | } 39 | -------------------------------------------------------------------------------- /pkg/util/error_markdown.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "strings" 5 | ) 6 | 7 | const loadFilePrefix = "failed to load file " 8 | 9 | // ErrorToMarkdown converts an error to markdown text so we can include it on a Pull Request comment 10 | func ErrorToMarkdown(err error, fileLink string) string { 11 | lines := strings.Split(err.Error(), ": ") 12 | 13 | // lets convert files to links 14 | if fileLink != "" { 15 | for i := range lines { 16 | line := lines[i] 17 | if strings.HasPrefix(line, loadFilePrefix) { 18 | remain := line[len(loadFilePrefix):] 19 | if remain == "" { 20 | continue 21 | } 22 | words := strings.Split(remain, " ") 23 | fileName := words[0] 24 | if len(fileName) == 0 { 25 | continue 26 | } 27 | rest := remain[len(fileName):] 28 | lines[i] = loadFilePrefix + "[" + fileName + "](" + fileLink + fileName + ")" + rest 29 | } 30 | } 31 | } 32 | 33 | // now lets convert them all to markdown 34 | return "* " + strings.Join(lines, "\n* ") + "\n" 35 | } 36 | -------------------------------------------------------------------------------- /pkg/util/error_markdown_test.go: -------------------------------------------------------------------------------- 1 | package util_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/jenkins-x/lighthouse/pkg/util" 7 | "github.com/pkg/errors" 8 | "github.com/stretchr/testify/assert" 9 | ) 10 | 11 | var fileLink = "https://github.com/cb-kubecd/bdd-gh-1602679032/blob/master/" 12 | 13 | func TestErrorToMarkdown(t *testing.T) { 14 | err := errors.Errorf("failed to do something") 15 | actual := util.ErrorToMarkdown(err, fileLink) 16 | assert.Equal(t, "* failed to do something\n", actual, "for %s", err.Error()) 17 | 18 | err = errors.Wrapf(err, "top level error") 19 | actual = util.ErrorToMarkdown(err, fileLink) 20 | assert.Equal(t, "* top level error\n* failed to do something\n", actual, "for %s", err.Error()) 21 | } 22 | 23 | func TestErrorToMarkdownWithfileLink(t *testing.T) { 24 | err := errors.Errorf("failed to load file .lighthouse/lint/triggers.yaml") 25 | 26 | err = errors.Wrapf(err, "top level error") 27 | actual := util.ErrorToMarkdown(err, fileLink) 28 | assert.Equal(t, "* top level error\n* failed to load file [.lighthouse/lint/triggers.yaml](https://github.com/cb-kubecd/bdd-gh-1602679032/blob/master/.lighthouse/lint/triggers.yaml)\n", actual, "for %s", err.Error()) 29 | } 30 | -------------------------------------------------------------------------------- /pkg/util/externalplugins_test.go: -------------------------------------------------------------------------------- 1 | package util_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/jenkins-x/lighthouse/pkg/plugins" 7 | "github.com/jenkins-x/lighthouse/pkg/util" 8 | "github.com/stretchr/testify/require" 9 | ) 10 | 11 | func Test_ExternalPluginsForEvent_returns_empty_slice_for_nil_configuration(t *testing.T) { 12 | configAgent := &plugins.ConfigAgent{} 13 | plugins := util.ExternalPluginsForEvent(configAgent, util.LighthousePayloadTypeActivity, "myorg/myrepo", nil) 14 | require.Empty(t, plugins) 15 | } 16 | -------------------------------------------------------------------------------- /pkg/util/go_mod_tidy_hack.go: -------------------------------------------------------------------------------- 1 | //go:build modhack 2 | // +build modhack 3 | 4 | package util 5 | 6 | // Necessary for safely adding multi-module repo. See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository 7 | import _ "github.com/Azure/go-autorest" 8 | 9 | // This file, and the github.com/Azure/go-autorest import, won't actually become part of the resultant binary. 10 | -------------------------------------------------------------------------------- /pkg/util/hmac.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "crypto/hmac" 5 | "crypto/sha256" 6 | "encoding/hex" 7 | ) 8 | 9 | // CreateHMACHeader creates the hmac token 10 | func CreateHMACHeader(data []byte, key string) string { 11 | sig := hmac.New(sha256.New, []byte(key)) 12 | sig.Write(data) 13 | return "sha256=" + hex.EncodeToString(sig.Sum(nil)) 14 | } 15 | -------------------------------------------------------------------------------- /pkg/util/hmac_test.go: -------------------------------------------------------------------------------- 1 | package util_test 2 | 3 | import ( 4 | "testing" 5 | 6 | "github.com/jenkins-x/go-scm/pkg/hmac" 7 | 8 | "github.com/jenkins-x/lighthouse/pkg/util" 9 | "github.com/stretchr/testify/assert" 10 | ) 11 | 12 | func TestCreateHMACHeader(t *testing.T) { 13 | data := []byte(`{ "text": "hello world" }`) 14 | 15 | key := "5c50537bc2a8cb57ad578ba90318392fd71cfa44c" 16 | header := util.CreateHMACHeader(data, key) 17 | 18 | assert.True(t, hmac.ValidatePrefix(data, []byte(key), header), "failed to validate header of %s", header) 19 | 20 | t.Logf("got generated header %s\n", header) 21 | } 22 | -------------------------------------------------------------------------------- /pkg/util/owner_tokens_dir_test.go: -------------------------------------------------------------------------------- 1 | package util_test 2 | 3 | import ( 4 | "path/filepath" 5 | "testing" 6 | 7 | "github.com/jenkins-x/lighthouse/pkg/util" 8 | "github.com/stretchr/testify/assert" 9 | "github.com/stretchr/testify/require" 10 | ) 11 | 12 | func TestOwnerTokensDir(t *testing.T) { 13 | dir := filepath.Join("test_data", "secret_dir") 14 | 15 | tokenFinder := util.NewOwnerTokensDir(util.GithubServer, dir) 16 | 17 | owner := "arcalos-environments" 18 | token, err := tokenFinder.FindToken(owner) 19 | require.NoError(t, err, "failed to find token for owner %s in dir %s", owner, dir) 20 | assert.Equal(t, "mytoken", token, "token for owner %s in dir %s", owner, dir) 21 | t.Logf("found token %s for owner %s", token, owner) 22 | } 23 | -------------------------------------------------------------------------------- /pkg/util/stopper.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | import ( 4 | "os" 5 | "os/signal" 6 | "syscall" 7 | 8 | "github.com/sirupsen/logrus" 9 | ) 10 | 11 | // Stopper returns a channel that remains open until an interrupt is received. 12 | func Stopper() chan struct{} { 13 | stop := make(chan struct{}) 14 | c := make(chan os.Signal, 2) 15 | signal.Notify(c, os.Interrupt, syscall.SIGTERM) 16 | go func() { 17 | <-c 18 | logrus.Warn("Interrupt received, attempting clean shutdown...") 19 | close(stop) 20 | <-c 21 | logrus.Error("Second interrupt received, force exiting...") 22 | os.Exit(1) 23 | }() 24 | return stop 25 | } 26 | -------------------------------------------------------------------------------- /pkg/util/strings.go: -------------------------------------------------------------------------------- 1 | package util 2 | 3 | // StringArrayIndex returns the index in the slice which equals the given value 4 | func StringArrayIndex(array []string, value string) int { 5 | for i, v := range array { 6 | if v == value { 7 | return i 8 | } 9 | } 10 | return -1 11 | } 12 | -------------------------------------------------------------------------------- /pkg/util/test_data/secret_dir/git-token: -------------------------------------------------------------------------------- 1 | mytokenfrompath -------------------------------------------------------------------------------- /pkg/util/test_data/secret_dir/github-app-github-github-aps-shoulderthunder-0: -------------------------------------------------------------------------------- 1 | https://github.com/arcalos-environments=mytoken -------------------------------------------------------------------------------- /pkg/util/test_data/secret_dir/hmac-token: -------------------------------------------------------------------------------- 1 | myhmactokenfrompath -------------------------------------------------------------------------------- /pkg/util/test_data/secret_dir/username: -------------------------------------------------------------------------------- 1 | jenkins-x[bot] -------------------------------------------------------------------------------- /test/e2e/jenkins/test_data/example-plugins.tmpl.yml: -------------------------------------------------------------------------------- 1 | approve: 2 | - lgtm_acts_as_approve: true 3 | repos: 4 | - {{ .Owner }}/{{ .Repo }} 5 | require_self_approval: true 6 | cat: {} 7 | cherry_pick_unapproved: {} 8 | config_updater: {} 9 | heart: {} 10 | label: 11 | additional_labels: null 12 | owners: {} 13 | plugins: 14 | {{ .Owner }}/{{ .Repo }}: 15 | - approve 16 | - assign 17 | - help 18 | - hold 19 | - lgtm 20 | - lifecycle 21 | - override 22 | - size 23 | - trigger 24 | - wip 25 | - cat 26 | - dog 27 | - pony 28 | - label 29 | - yuks 30 | - shrug 31 | - skip 32 | requiresig: {} 33 | sigmention: {} 34 | size: 35 | l: 0 36 | m: 0 37 | s: 0 38 | xl: 0 39 | xxl: 0 40 | triggers: 41 | - repos: 42 | - {{ .Owner }}/{{ .Repo }} 43 | trusted_org: {{ .Owner }} 44 | welcome: 45 | - message_template: Welcome 46 | -------------------------------------------------------------------------------- /test/e2e/jenkins/test_data/main.go.failing: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | func main() { 4 | boom 5 | } 6 | 7 | -------------------------------------------------------------------------------- /test/e2e/jenkins/test_data/repo/build-pod.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Pod 3 | spec: 4 | containers: 5 | - name: pack 6 | volumeMounts: 7 | - name: docker 8 | mountPath: /var/run/docker.sock 9 | image: buildpacksio/pack:0.12.0 10 | command: ["tail", "-f", "/dev/null"] 11 | imagePullPolicy: Always 12 | resources: 13 | requests: 14 | memory: "2Gi" 15 | cpu: "500m" 16 | limits: 17 | memory: "2Gi" 18 | volumes: 19 | - name: docker 20 | hostPath: 21 | path: /var/run/docker.sock -------------------------------------------------------------------------------- /test/e2e/jenkins/test_data/repo/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "net/http" 6 | ) 7 | 8 | func main() { 9 | http.HandleFunc("/", helloServer) 10 | _ = http.ListenAndServe(":8080", nil) 11 | } 12 | 13 | func helloServer(w http.ResponseWriter, r *http.Request) { 14 | _, _ = fmt.Fprintf(w, "Hi, %s!", r.URL.Path[1:]) 15 | } 16 | -------------------------------------------------------------------------------- /test/e2e/tekton/test_data/example-config.tmpl.yml: -------------------------------------------------------------------------------- 1 | branch-protection: 2 | orgs: 3 | {{ .Owner }}: 4 | repos: 5 | {{ .Repo }}: 6 | required_status_checks: 7 | contexts: 8 | - pr-build 9 | protect-tested-repos: true 10 | github: 11 | LinkURL: null 12 | owners_dir_excludes: 13 | default: null 14 | repos: null 15 | plank: {} 16 | pod_namespace: {{ .Namespace }} 17 | postsubmits: {} 18 | presubmits: 19 | {{ .Owner }}/{{ .Repo }}: 20 | - agent: {{ .Agent }} 21 | always_run: true 22 | context: pr-build 23 | name: pr-build 24 | rerun_command: /test this 25 | trigger: (?m)^/test( all| this),?(\s+|$) 26 | prowjob_namespace: {{ .Namespace }} 27 | push_gateway: 28 | serve_metrics: false 29 | tide: 30 | context_options: 31 | from-branch-protection: true 32 | required-if-present-contexts: [] 33 | skip-unknown-contexts: false 34 | merge_method: 35 | {{ .Owner }}/{{ .Repo }}: merge 36 | queries: 37 | - labels: 38 | - approved 39 | missingLabels: 40 | - do-not-merge 41 | - do-not-merge/hold 42 | - do-not-merge/work-in-progress 43 | - needs-ok-to-test 44 | - needs-rebase 45 | repos: 46 | - {{ .Owner }}/{{ .Repo }} 47 | -------------------------------------------------------------------------------- /test/e2e/tekton/test_data/example-plugins.tmpl.yml: -------------------------------------------------------------------------------- 1 | approve: 2 | - lgtm_acts_as_approve: true 3 | repos: 4 | - {{ .Owner }}/{{ .Repo }} 5 | require_self_approval: true 6 | cat: {} 7 | cherry_pick_unapproved: {} 8 | config_updater: {} 9 | heart: {} 10 | label: 11 | additional_labels: null 12 | owners: {} 13 | plugins: 14 | {{ .Owner }}/{{ .Repo }}: 15 | - approve 16 | - assign 17 | - help 18 | - hold 19 | - lgtm 20 | - lifecycle 21 | - override 22 | - size 23 | - trigger 24 | - wip 25 | - cat 26 | - dog 27 | - pony 28 | - label 29 | - yuks 30 | - shrug 31 | - skip 32 | requiresig: {} 33 | sigmention: {} 34 | size: 35 | l: 0 36 | m: 0 37 | s: 0 38 | xl: 0 39 | xxl: 0 40 | triggers: 41 | - repos: 42 | - {{ .Owner }}/{{ .Repo }} 43 | trusted_org: {{ .Owner }} 44 | welcome: 45 | - message_template: Welcome 46 | -------------------------------------------------------------------------------- /test/e2e/tekton/test_data/failingRepoScript.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "This fails" 4 | 5 | exit 1 6 | -------------------------------------------------------------------------------- /test/e2e/tekton/test_data/passingRepoScript.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "This has changed but still passes" 4 | -------------------------------------------------------------------------------- /test/e2e/tekton/test_data/repo/script.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "This passes" 4 | --------------------------------------------------------------------------------