Skip to content

Commit 2256f3b

Browse files
committed
Initial commit
Signed-off-by: Edward Wilde <[email protected]>
0 parents  commit 2256f3b

File tree

507 files changed

+292901
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

507 files changed

+292901
-0
lines changed

.editorconfig

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
root = true
2+
3+
; Unix-style newlines with a newline ending every file
4+
[*]
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
charset = utf-8
12+
13+
; Golang
14+
[*.go]
15+
indent_style = tab
16+
indent_size = 4
17+
18+
; YAML
19+
[*.{yaml,yml}]
20+
indent_style = space
21+
indent_size = 2
22+
23+
[{Makefile,GNUmakefile}]
24+
indent_style = tab
25+
indent_size = 4

.github/ISSUE_TEMPLATE.md

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!--- Provide a general summary of the issue in the Title above -->
2+
3+
## Expected Behaviour
4+
<!--- If you're describing a bug, tell us what should happen -->
5+
<!--- If you're suggesting a change/improvement, tell us how it should work -->
6+
7+
## Current Behaviour
8+
<!--- If describing a bug, tell us what happens instead of the expected behavior -->
9+
<!--- If suggesting a change/improvement, explain the difference from current behavior -->
10+
11+
## Possible Solution
12+
<!--- Not obligatory, but suggest a fix/reason for the bug, -->
13+
<!--- or ideas how to implement the addition or change -->
14+
15+
## Steps to Reproduce (for bugs)
16+
<!--- Provide a link to a live example, or an unambiguous set of steps to -->
17+
<!--- reproduce this bug. Include code to reproduce, if relevant -->
18+
1.
19+
2.
20+
3.
21+
4.
22+
23+
## Context
24+
<!--- How has this issue affected you? What are you trying to accomplish? -->
25+
<!--- Providing context helps us come up with a solution that is most useful in the real world -->
26+
27+
## Your Environment
28+
<!--- Include as many relevant details about the environment you experienced the bug in -->
29+
* OpenFaaS version information run `faas-cli version` to get relevant information

.github/PULL_REQUEST_TEMPLATE.md

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<!--- Provide a general summary of your changes in the Title above -->
2+
3+
## Description
4+
<!--- Describe your changes in detail -->
5+
6+
## Motivation and Context
7+
<!--- Why is this change required? What problem does it solve? -->
8+
<!--- If it fixes an open issue, please link to the issue here. -->
9+
- [ ] I have raised an issue to propose this change ([required](https://github.com/ewilde/faas-ecs/blob/master/CONTRIBUTING.md))
10+
11+
12+
## How Has This Been Tested?
13+
<!--- Please describe in detail how you tested your changes. -->
14+
<!--- Include details of your testing environment, and the tests you ran to -->
15+
<!--- Please show output from tests if possible -->
16+
<!--- see how your change affects other areas of the code, etc. -->
17+
18+
## Types of changes
19+
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply: -->
20+
- [ ] Bug fix (non-breaking change which fixes an issue)
21+
- [ ] New feature (non-breaking change which adds functionality)
22+
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
23+
24+
## Checklist:
25+
<!--- Go over all the following points, and put an `x` in all the boxes that apply. -->
26+
<!--- If you're unsure about any of these, don't hesitate to ask. We're here to help! -->
27+
- [ ] My code follows the code style of this project.
28+
- [ ] My change requires a change to the documentation.
29+
- [ ] I have updated the documentation accordingly.
30+
- [ ] I've read the [CONTRIBUTION](https://github.com/ewilde/faas-ecs/blob/master/CONTRIBUTING.md) guide
31+
- [ ] I have signed-off my commits with `git commit -s`
32+
- [ ] I have added tests to cover my changes.
33+
- [ ] All new and existing tests passed.
34+
- [ ] Below is the relevant test output.

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.idea
2+
examples/hellogoworld2/
3+
dist

.goreleaser.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
builds:
2+
- binary: faas-ecs
3+
goos:
4+
- linux
5+
goarch:
6+
- amd64
7+
archive:
8+
format: zip
9+
changelog:
10+
sort: asc
11+
filters:
12+
exclude:
13+
- '^docs:'
14+
- '^test:'
15+
- Merge pull request
16+
- Merge branch

.travis.yml

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
sudo: required
2+
3+
language: go
4+
5+
go:
6+
- 1.10.x
7+
8+
install:
9+
- echo "Please don't go get"
10+
11+
services:
12+
- docker
13+
14+
before_script:
15+
- bash scripts/set_travis_experimental_mode.sh
16+
- curl -sSL get.docker.com | sudo -E sh
17+
18+
after_success:
19+
- if [ ! -z "$TRAVIS_TAG" ] ; then
20+
docker tag ewilde/faas-ecs:latest ewilde/faas-ecs:$TRAVIS_TAG;
21+
echo $DOCKER_PASSWORD | docker login -u=$DOCKER_USERNAME --password-stdin;
22+
docker push $DOCKER_NS/faas-ecs:$TRAVIS_TAG;
23+
docker push $DOCKER_NS/faas-ecs:latest;
24+
fi
25+
script:
26+
- make build
27+
28+
deploy:
29+
- provider: script
30+
skip_cleanup: true
31+
script: curl -sL https://git.io/goreleaser | bash
32+
on:
33+
tags: true
34+
condition: $TRAVIS_OS_NAME = linux

CONTRIBUTING.md

+167
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,167 @@
1+
# Contributing
2+
3+
## Guidelines
4+
5+
Guidelines for contributing.
6+
7+
### How can I get involved?
8+
9+
We have a number of areas where we can accept contributions:
10+
11+
* Work on [missing features and bugs](https://github.com/ewilde/faas-ecs/issues)
12+
13+
14+
### I've found a typo
15+
16+
* A Pull Request is not necessary. Raise an [Issue](https://github.com/ewilde/faas-ecs/issues) and we'll fix it as soon as we can.
17+
18+
### I have a (great) idea
19+
20+
The maintainers would like to make faas-ecs the best it can be and welcome new contributions that align with the project's goals.
21+
Our time is limited so we'd like to make sure we agree on the proposed work before you spend time doing it.
22+
Saying "no" is hard which is why we'd rather say "yes" ahead of time. You need to raise a proposal.
23+
24+
**Please do not raise a proposal after doing the work - this is counter to the spirit of the project. It is hard to be objective about something which has already been done**
25+
26+
What makes a good proposal?
27+
28+
* Brief summary including motivation/context
29+
* Any design changes
30+
* Pros + Cons
31+
* Effort required up front
32+
* Effort required for CI/CD, release, ongoing maintenance
33+
* Migration strategy / backwards-compatibility
34+
* Mock-up screenshots or examples of how the CLI would work
35+
36+
If you are proposing a new tool or service please do due diligence.
37+
Does this tool already exist? Can we reuse it? For example: a timer / CRON-type scheduler for invoking functions.
38+
39+
### Paperwork for Pull Requests
40+
41+
Please read this whole guide and make sure you agree to our DCO agreement (included below):
42+
43+
* See guidelines on commit messages (below)
44+
* Sign-off your commits
45+
* Complete the whole template for issues and pull requests
46+
* [Reference addressed issues](https://help.github.com/articles/closing-issues-using-keywords/) in the PR description & commit messages - use 'Fixes #IssueNo'
47+
* Always give instructions for testing
48+
* Provide us CLI commands and output or screenshots where you can
49+
50+
### Commit messages
51+
52+
The first line of the commit message is the *subject*, this should be followed by a blank line and then a message describing the intent and purpose of the commit. These guidelines are based upon a [post by Chris Beams](https://chris.beams.io/posts/git-commit/).
53+
54+
* When you run `git commit` make sure you sign-off the commit by typing `git commit -s`.
55+
* The commit subject-line should start with an uppercase letter
56+
* The commit subject-line should not exceed 72 characters in length
57+
* The commit subject-line should not end with punctuation (., etc)
58+
59+
When giving a commit body:
60+
* Leave a blank line after the subject-line
61+
* Make sure all lines are wrapped to 72 characters
62+
63+
Here's an example:
64+
65+
```
66+
Add secrets to provider
67+
68+
We need to have the ability to pass secrets to faas-ecs securely.
69+
This commits adds secrets support using AWS Secrets Manager API.
70+
71+
Resolves #1
72+
73+
Signed-off-by: Edward Wilde <[email protected]>
74+
```
75+
76+
If you would like to ammend your commit follow this guide: [Git: Rewriting History](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History)
77+
78+
**Unit testing with Golang**
79+
80+
Please follow style guide on [this blog post](https://blog.alexellis.io/golang-writing-unit-tests/) from [The Go Programming Language](https://www.amazon.co.uk/Programming-Language-Addison-Wesley-Professional-Computing/dp/0134190440)
81+
82+
**I have a question, a suggestion or need help**
83+
84+
Please raise an Issue.
85+
86+
**I need to add a dependency**
87+
88+
We use vendoring for projects written in Go.
89+
This means that we will maintain a copy of the source-code of dependencies within Git.
90+
It allows a repeatable build and isolates change.
91+
92+
We use Golang's `dep` tool to manage dependencies for Golang projects - https://github.com/golang/dep
93+
94+
## License
95+
96+
This project is licensed under the MIT License.
97+
98+
### Copyright notice
99+
100+
Please add a Copyright notice to new files you add where this is not already present:
101+
102+
```
103+
// Copyright (c) Edward Wilde 2018. All rights reserved.
104+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
105+
```
106+
107+
### Sign your work
108+
109+
> Note: all of the commits in your PR/Patch must be signed-off.
110+
111+
The sign-off is a simple line at the end of the explanation for a patch. Your
112+
signature certifies that you wrote the patch or otherwise have the right to pass
113+
it on as an open-source patch. The rules are pretty simple: if you can certify
114+
the below (from [developercertificate.org](http://developercertificate.org/)):
115+
116+
```
117+
Developer Certificate of Origin
118+
Version 1.1
119+
120+
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
121+
1 Letterman Drive
122+
Suite D4700
123+
San Francisco, CA, 94129
124+
125+
Everyone is permitted to copy and distribute verbatim copies of this
126+
license document, but changing it is not allowed.
127+
128+
Developer's Certificate of Origin 1.1
129+
130+
By making a contribution to this project, I certify that:
131+
132+
(a) The contribution was created in whole or in part by me and I
133+
have the right to submit it under the open source license
134+
indicated in the file; or
135+
136+
(b) The contribution is based upon previous work that, to the best
137+
of my knowledge, is covered under an appropriate open source
138+
license and I have the right under that license to submit that
139+
work with modifications, whether created in whole or in part
140+
by me, under the same open source license (unless I am
141+
permitted to submit under a different license), as indicated
142+
in the file; or
143+
144+
(c) The contribution was provided directly to me by some other
145+
person who certified (a), (b) or (c) and I have not modified
146+
it.
147+
148+
(d) I understand and agree that this project and the contribution
149+
are public and that a record of the contribution (including all
150+
personal information I submit with it, including my sign-off) is
151+
maintained indefinitely and may be redistributed consistent with
152+
this project or the open source license(s) involved.
153+
```
154+
155+
Then you just add a line to every git commit message:
156+
157+
Signed-off-by: Joe Smith <[email protected]>
158+
159+
Use your real name (sorry, no pseudonyms or anonymous contributions.)
160+
161+
If you set your `user.name` and `user.email` git configs, you can sign your
162+
commit automatically with `git commit -s`.
163+
164+
* Please sign your commits with `git commit -s` so that commits are traceable.
165+
166+
If you forgot to sign your work and want to fix that, see the following guide:
167+
[Git: Rewriting History](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History)

Dockerfile

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM golang:1.10.2-alpine3.7
2+
3+
RUN apk --no-cache add git curl
4+
RUN go get golang.org/x/tools/cmd/goimports
5+
6+
RUN mkdir -p /go/src/github.com/ewilde/faas-ecs/
7+
8+
WORKDIR /go/src/github.com/ewilde/faas-ecs
9+
10+
COPY . .
11+
12+
RUN curl -sL https://github.com/alexellis/license-check/releases/download/0.2.2/license-check > /usr/bin/license-check \
13+
&& chmod +x /usr/bin/license-check
14+
RUN license-check -path ./ --verbose=false "Edward Wilde" "OpenFaaS Project"
15+
RUN goimports -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") \
16+
&& VERSION=$(git describe --all --exact-match `git rev-parse HEAD` | grep tags | sed 's/tags\///') \
17+
&& GIT_COMMIT_SHA=$(git rev-list -1 HEAD) \
18+
&& GIT_COMMIT_MESSAGE=$(git log -1 --pretty=%B 2>&1 | head -n 1) \
19+
&& CGO_ENABLED=0 GOOS=linux go build --ldflags "-s -w \
20+
-X github.com/ewilde/faas-ecs/version.GitCommitSHA=${GIT_COMMIT_SHA}\
21+
-X \"github.com/ewilde/faas-ecs/version.GitCommitMessage=${GIT_COMMIT_MESSAGE}\"\
22+
-X github.com/ewilde/faas-ecs/version.Version=${VERSION}" \
23+
-a -installsuffix cgo -o faas-ecs .
24+
25+
FROM alpine:3.7
26+
27+
RUN addgroup -S app \
28+
&& adduser -S -g app app \
29+
&& apk --no-cache add \
30+
ca-certificates
31+
WORKDIR /home/app
32+
33+
EXPOSE 8080
34+
35+
ENV http_proxy ""
36+
ENV https_proxy ""
37+
38+
COPY --from=0 /go/src/github.com/ewilde/faas-ecs/faas-ecs .
39+
RUN chown -R app:app ./
40+
41+
USER app
42+
43+
CMD ["./faas-ecs"]

0 commit comments

Comments
 (0)