-
Notifications
You must be signed in to change notification settings - Fork 7
V0.2.0 review updates #46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e912938
f126524
6daad1b
c114f71
41fab29
1ed3a99
f0ccb7a
9b69a3f
22e6db4
db0c706
9e236d9
2820507
1f1c803
57d0e9e
1c14723
f1d45f6
2c97eaa
8f90975
df66bdf
52ad3bc
e3287b4
6cf4cdc
4233cf5
3ef52b1
05ccb01
38560e9
d282e78
7de7481
26a83f6
cc9230e
19aba38
1fc955d
5e87c80
452aa49
84afbb1
5b3977d
ed33a5b
4d9a96a
a28f2ef
b5c9dea
34330ec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
name: gen-docs | ||
name: mkdocs | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
jobs: | ||
deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-python@v2 | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
- run: pip install mkdocs-material | ||
- run: mkdocs gh-deploy --force | ||
- name: Install mkdocs-material | ||
run: pip install mkdocs-material | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should consider using a golang alternative for mkdocs as its sad a golang template repo needs python 😄 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you make a fresh issue for this @mridulganga, we went for anything that we were able to get working. Now, would be a good time to start working on evaluating and taking out non-golang bits. |
||
- name: Publish to gh-pages | ||
run: mkdocs gh-deploy --force |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: tests | ||
on: [push] | ||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Setup Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.18 | ||
- name: Go Test | ||
run: go test -v ./... |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,22 @@ | ||
FROM golang:1.18 as build | ||
WORKDIR /go/src/app | ||
FROM golang:1.18-alpine as builder | ||
|
||
RUN apk update && apk upgrade && \ | ||
apk add --no-cache make bash | ||
|
||
WORKDIR /src | ||
COPY . . | ||
# Static build requires CGO_ENABLED=0 | ||
RUN mkdir -p /go/bin && CGO_ENABLED=0 go build -ldflags="-w -s" -o /go/bin/app ./... | ||
|
||
# Build executable | ||
RUN make build | ||
|
||
# Using a distroless image from https://github.com/GoogleContainerTools/distroless | ||
# Image sourced from https://console.cloud.google.com/gcr/images/distroless/global/static | ||
FROM gcr.io/distroless/static:nonroot | ||
COPY --from=build /go/bin/app / | ||
# numeric version of user nonroot:nonroot provided in image | ||
|
||
# Copy executable from builder image | ||
COPY --from=builder /src/bin/app / | ||
|
||
# Numeric version of user nonroot:nonroot provided in image | ||
USER 65532:65532 | ||
|
||
# Run the executable | ||
CMD ["/app"] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,67 @@ | ||
# golang-template-repository | ||
[](https://github.com/pre-commit/pre-commit) | ||
[](https://results.pre-commit.ci/latest/github/rog-golang-buddies/golang-template-repository/main) | ||
|
||
Kickstarter repository for a golang service | ||
> 💣 _All Setup content in this file should be replaced with your project details post setup._ | ||
|
||
Dockerhub: docker push golangbuddy/test-project:tagname | ||
## Setup | ||
|
||
TODO: | ||
A gh-pages site is automatically generated for you when you clone/fork this repository. To get started, you must configure gh-pages with a few easy clicks for the site to be published. You can then follow the pre-written site docs to familiarize yourself with this repository. | ||
|
||
1. ~~Add a CI skeleton.~~ | ||
2. ~~Add basic linting.~~ | ||
3. ~~Add secret-scanning.~~ | ||
4. Add makefile. | ||
5. Add containerization. | ||
### Steps | ||
|
||
🎛️ Configure gh-pages as per instructions [here](https://rog-golang-buddies.github.io/golang-template-repository/continuous-integration/mkdocs-material/#ci-setup). | ||
|
||
🌐 Goto your site at `<org>.github.io/<repository>` (the link is also made available via **Environments** section in your Github repo). | ||
|
||
✋ Take a moment to review the `Quickstart` guide before you get started. It has critical prerequisites. | ||
|
||
🧐 Peruse the `Continuous integration` docs to get yourself upto speed. | ||
|
||
> _Having trouble accessing your site? Access the template repository Quickstart and Continuous integration docs here_: <br> | ||
https://rog-golang-buddies.github.io/golang-template-repository | ||
|
||
🚀 Go build something amazing! | ||
|
||
--- | ||
<br> | ||
|
||
> _The following section provides a sample README template sourced from https://www.makeareadme.com_ | ||
|
||
# [Repo name] | ||
|
||
## Description | ||
|
||
_Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors._ | ||
|
||
|
||
## Installation | ||
|
||
_Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection._ | ||
|
||
## Usage | ||
|
||
_Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README._ | ||
|
||
## Support | ||
|
||
_Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc._ | ||
|
||
## Roadmap | ||
|
||
_If you have ideas for releases in the future, it is a good idea to list them in the README._ | ||
|
||
## Contributing | ||
|
||
_State if you are open to contributions and what your requirements are for accepting them._ | ||
|
||
_For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self._ | ||
|
||
_You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser._ | ||
|
||
## Authors and acknowledgment | ||
|
||
_Show your appreciation to those who have contributed to the project._ | ||
|
||
## License | ||
|
||
_For open source projects, say how it is licensed._ | ||
haani-niyaz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_Commonly used open-source licenses are MIT (https://opensource.org/licenses/MIT) and Apache (https://www.apache.org/licenses/LICENSE-2.0). |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# GoReleaser | ||
|
||
## What | ||
|
||
[GoReleaser](https://goreleaser.com/) builds Go binaries for several platforms. The goal is to simplify the build, release and publish steps while providing variant customization options for all steps. | ||
|
||
## Why | ||
|
||
Simplifies the build and packing process of your app's Go binaries. | ||
|
||
## How | ||
|
||
The entire release process can be customized through a `.goreleaser.yml` file. Once you set it up, every time you want to create a new release, all you need to do is create a git tag that conforms to [semantic versioning](https://goreleaser.com/limitations/semver/) and run `goreleaser release`. | ||
|
||
|
||
## CI setup | ||
|
||
!!! summary | ||
|
||
No configuration required. | ||
|
||
GoReleaser is configured to run on the `main` branch and is executed via the release Github workflow in `.github/workflows/release.yml`. | ||
|
||
|
||
!!! info | ||
|
||
Binaries are only created if a tag exists. This is controlled via [semantic-release](semantic-release.md). | ||
|
||
## Local setup | ||
|
||
The [quickstart](https://goreleaser.com/quick-start/) provides detailed steps to run GoReleaser locally. |
Uh oh!
There was an error while loading. Please reload this page.