mirror of
https://github.com/qdm12/ddns-updater.git
synced 2026-03-31 06:24:00 -04:00
2.0 KiB
2.0 KiB
Contributing
Table of content
Setup
Using VSCode and Docker
That should be easier and better than a local setup, although it might use more memory if you're not on Linux.
- Install Docker
- On Windows, share a drive with Docker Desktop and have the project on that partition
- On OSX, share your project directory with Docker Desktop
- With Visual Studio Code, install the remote containers extension
- In Visual Studio Code, press on
F1and selectRemote-Containers: Open Folder in Container... - Your dev environment is ready to go!... and it's running in a container 👍
Locally
Install Go, Docker and Git; then:
go mod download
And finally install golangci-lint.
You might want to use an editor such as Visual Studio Code with the Go extension. Working settings are already in .vscode/settings.json.
Build and Run
go build -o app cmd/updater/main.go
./app
Commands available
- Test the code:
go test ./... - Lint the code
golangci-lint run - Build the Docker image (tests and lint included):
docker build -t qmcgaw/ddns-updater . - Run the Docker container:
docker run -it --rm -v /yourpath/data:/updater/data qmcgaw/ddns-updater
Guidelines
The Go code is in the Go file cmd/updater/main.go and the internal directory, you might want to start reading the main.go file.
See the Contributing document for more information on how to contribute to this repository.