Skip to content

Commit

Permalink
Merge pull request jenkins-x#1 from wbrefvem/master
Browse files Browse the repository at this point in the history
feat: renaming and typo fixing
  • Loading branch information
Will Refvem 文仁 authored Jul 9, 2019
2 parents b0ba444 + 3aaa71c commit a299229
Show file tree
Hide file tree
Showing 39 changed files with 119 additions and 297 deletions.
11 changes: 0 additions & 11 deletions Dockerfile

This file was deleted.

17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
# lighthouse
# Foghorn

A lightweight webhook handler to trigger Jenkins X Pipelines from webhooks from GitHub, GitHub Enterprise, BitBucket Cloud / Server, GitLab, Gitea etc
Kubernetes-native CI, inspired by [prow](https://github.com/kubernetes/test-infra/tree/master/prow).

## Building

The fastest way to get started hacking on Lighthouse is with [ko](https://github.com/google/ko).
The fastest way to get started hacking on Foghorn is with [ko](https://github.com/google/ko).

If you take a look in `deployments/manifests`, everything should look normal except for the following field in `200-webhook.yaml`:
If you take a look in `deployments`, everything should look normal except for the following field in `200-webhook-deployment.yaml`:

```yaml
image: github.com/jenkins-x/lighthouse/cmd/webhook
image: github.com/foghornci/foghorn/cmd/webhook
```
The magic of `ko` is that it will:
* automatically build the go binary whose code is specified in the `image` field *

* automatically build the go binary whose code is specified in the `image` field
* package it into an image
* push the image to a configured image registry
* update the deployment manifest with the newly build image name and tag
Expand All @@ -22,7 +23,7 @@ The magic of `ko` is that it will:
Once you've installed and configured `ko`, simply run the following from the project root:

```sh
ko apply -f deployments/manifests/
ko apply -f deployments/
```

This will build and deploy lighthouse to your Kubernetes cluster. In addition to a deployment, it will create a service and ingress so that you can start receiving webhooks right away, and it will put all of it in a namespace called `lighthouse`. Simply re-run the command to build and deploy your latest changes. It's idempotent, so running it multiple times with no changes in between will have no effect.
This will build and deploy Foghorn to your Kubernetes cluster. In addition to a deployment, it will create a service and ingress so that you can start receiving webhooks right away, and it will put all of it in a namespace called `foghorn`. Simply re-run the command to build and deploy your latest changes. It's idempotent, so running it multiple times with no changes in between will have no effect.
8 changes: 4 additions & 4 deletions cmd/webhook/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
"os"
"strconv"

clientv1 "github.com/jenkins-x/lighthouse/pkg/client/clientset/versioned/typed/jenkins.io/v1"
"github.com/jenkins-x/lighthouse/pkg/git/bitbucketserver"
clientv1 "github.com/foghornci/foghorn/pkg/client/clientset/versioned/typed/foghornci.io/v1"
"github.com/foghornci/foghorn/pkg/git/bitbucketserver"
"github.com/sirupsen/logrus"
rest "k8s.io/client-go/rest"
)

const (
helloMessage = "hello from the Jenkins X Lighthouse\n"
helloMessage = "hello from the Jenkins X foghorn\n"

// HealthPath is the URL path for the HTTP endpoint that returns health status.
HealthPath = "/health"
Expand Down Expand Up @@ -111,7 +111,7 @@ func (o *WebhookOptions) handleWebHookRequests(w http.ResponseWriter, r *http.Re
logrus.Fatalf("client initialization failed: %s", err)
}

webhookInterface := client.Webhooks("lighthouse")
webhookInterface := client.Webhooks("foghorn")

result, err := webhookInterface.Create(webhook)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: lighthouse
name: foghorn
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: controller
labels:
app: controller
namespace: lighthouse
namespace: foghorn
spec:
replicas: 1
selector:
Expand All @@ -17,6 +17,6 @@ spec:
spec:
containers:
- name: controller
image: github.com/jenkins-x/lighthouse/cmd/controller
image: github.com/foghornci/foghorn/cmd/controller
ports:
- containerPort: 8080
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: webhooks.jenkins.io
name: webhooks.foghornci.io
spec:
group: jenkins.io
group: foghornci.io
version: v1
names:
kind: Webhook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ metadata:
name: webhook
labels:
app: webhook
namespace: lighthouse
namespace: foghorn
spec:
replicas: 1
selector:
Expand All @@ -17,6 +17,6 @@ spec:
spec:
containers:
- name: webhook
image: github.com/jenkins-x/lighthouse/cmd/webhook
image: github.com/foghornci/foghorn/cmd/webhook
ports:
- containerPort: 8080
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: webhook
namespace: lighthouse
namespace: foghorn
annotations:
app: webhook
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ metadata:
nginx.ingress.kubernetes.io/rewrite-target: /
app: webhook
name: webhook
namespace: lighthouse
namespace: foghorn
spec:
rules:
- host: webhook.example.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rules:
- apiGroups: ["jenkins.io"]
- apiGroups: ["foghornci.io"]
resources: ["webhooks"]
verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: webhooks-admin
namespace: lighthouse
namespace: foghorn
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: webhooks-admin
subjects:
- kind: ServiceAccount
name: default
namespace: lighthouse
namespace: foghorn
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/jenkins-x/lighthouse
module github.com/foghornci/foghorn

go 1.12

Expand Down
140 changes: 0 additions & 140 deletions jenkins-x.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// +k8s:deepcopy-gen=package
// +k8s:defaulter-gen=TypeMeta
// +groupName=jenkins.io
// +groupName=foghornci.io

package v1
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

var SchemeGroupVersion = schema.GroupVersion{
Group: "jenkins.io",
Group: "foghornci.io",
Version: "v1",
}

Expand Down
File renamed without changes.
18 changes: 9 additions & 9 deletions pkg/client/clientset/versioned/clientset.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit a299229

Please sign in to comment.