Contributing to apko: A Comprehensive Guide for Developers
Welcome to the apko Community! 🌱
Apko is an open-source project, and we’re thrilled that you’re interested in contributing! This guide will walk you through the process of setting up your development environment, linting and testing your changes, and submitting a pull request.
Setting Up a Development Environment 🛠️
To make development easier under any platform with Docker installed, apko provides a script called hack/make-devenv.sh
. This script uses apko itself to bootstrap a development environment.
- Navigate to the top of the apko repository.
- Run the following command:
./hack/make-devenv.sh
This command will create a development image with some useful tools, load it into your local Docker daemon, and drop you into a shell. The apko repository in your local machine will be mounted in the current working directory.
Now you can use your editor to change the apko code and execute apko in the development shell to test your changes:
go run ./main.go
When you’re done developing, simply exit the development shell.
Linting and Tests 🧪
Before submitting a pull request, ensure that tests and lints do not complain. Make sure you have Go 1.18 and golangci-lint
installed. You can install golangci-lint
using the following command:
curl -fsSL https://raw.githubusercontent.com/golangci/lint/stable/install.sh | sh
Now, try running the linter and tests:
go test ./...
golangci-lint run
Contributing Changes 💡
- Fork the apko repository on GitHub.
- Create a new branch for your changes:
git checkout -b <your-branch-name>
- Make your changes.
- Commit your changes:
git add .
git commit -m "Your commit message"
- Push your changes to your forked repository:
git push origin <your-branch-name>
- Create a pull request against the main branch of the apko repository.
Continuous Integration and Continuous Deployment 🔄
Apko uses GitHub Actions for continuous integration and continuous deployment. The project has the following workflows:
.github/workflows/build.yml
: Builds and tests changes..github/workflows/publish.yml
: Builds, tests, and publishes changes.
These workflows run on every push to a branch and pull request. They ensure that your changes are built, tested, and published only if they pass the linter and tests.
Additional Resources 📚
We’re excited to see your contributions to apko! If you have any questions, feel free to refer to the project’s contributing guide or maintainers guide. Happy coding! 💻💻💻