Skip to content

Commit 42b8cae

Browse files
committed
Add DEVELOPMENT.md
Signed-off-by: Andrea Frittoli <[email protected]>
1 parent a82eab4 commit 42b8cae

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

DEVELOPMENT.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Developing
2+
3+
## Setting up a development environment
4+
5+
### Setup a GitHub account accessible via SSH
6+
7+
GitHub is used for project Source Code Management (SCM) using the SSH protocol for authentication.
8+
9+
1. Create [a GitHub account](https://github.com/join) if you do not already have one.
10+
1. Setup
11+
[GitHub access via SSH](https://help.github.com/articles/connecting-to-github-with-ssh/)
12+
13+
### Install tools
14+
15+
You must install these tools:
16+
17+
1. [`git`](https://help.github.com/articles/set-up-git/): For source control
18+
19+
1. [`go`](https://golang.org/doc/install): The language this SDK is built in.
20+
> **Note** Golang [version v1.18](https://golang.org/dl/) or higher is required.
21+
22+
1. [`make`](https://www.gnu.org/software/make/): not stricly required but handy to run
23+
tests with a single command.
24+
25+
### Setup a fork
26+
27+
The Tekton project requires that you develop (commit) code changes to branches that belong to a fork of the `tektoncd/pipeline` repository in your GitHub account before submitting them as Pull Requests (PRs) to the actual project repository.
28+
29+
1. [Create a fork](https://help.github.com/articles/fork-a-repo/) of the `tektoncd/pipeline` repository in your GitHub account.
30+
31+
1. Create a clone of your fork on your local machine:
32+
33+
```shell
34+
git clone [email protected]:${YOUR_GITHUB_USERNAME}/sdk-go.git
35+
```
36+
37+
1. Configure `git` remote repositories
38+
39+
Adding `cdevents/sdk-go` as the `upstream` and your fork as the `origin` remote repositories to your `.git/config` sets you up nicely for regularly [syncing your fork](https://help.github.com/articles/syncing-a-fork/) and submitting pull requests.
40+
41+
1. Change into the project directory
42+
43+
```shell
44+
cd sdk-go
45+
```
46+
47+
1. Configure sdk-go as the `upstream` repository
48+
49+
```shell
50+
git remote add upstream [email protected]:cdevents/sdk-go.git
51+
52+
# Optional: Prevent accidental pushing of commits by changing the upstream URL to `no_push`
53+
git remote set-url --push upstream no_push
54+
```
55+
56+
1. Configure your fork as the `origin` repository
57+
58+
```shell
59+
git remote add origin [email protected]:${YOUR_GITHUB_USERNAME}/sdk-go.git
60+
```
61+
62+
## Developing, building and testing
63+
64+
Make target all defined to run unit tests, format imports, format go code and run the linter.
65+
66+
To format the go code and imports:
67+
68+
```shell
69+
$ make fmt
70+
```
71+
72+
To run the go linter:
73+
74+
```shell
75+
$ make lint
76+
```
77+
78+
To run unit tests:
79+
```shell
80+
$ make test
81+
```
82+
83+
To run all targets, before creating a commit:
84+
85+
```shell
86+
make all
87+
```
88+

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ func main() {
7070

7171
See the [CloudEvents](https://github.com/cloudevents/sdk-go#send-your-first-cloudevent) docs as well.
7272

73+
## Contributing
74+
75+
If you would like to contribute, see our [development](DEVELOPMENT.md) guide.
76+
7377
## References
7478

7579
- [CDEvents](https://cdevents.dev)

0 commit comments

Comments
 (0)