Unpackaged formulas used in our Salt infrastructure.
Create a repository in https://gitlab.infra.opensuse.org/saltstack-formulas/ * the "main" branch should be up to date with the upstream "main" branch * the production branch should be the default branch and be either the same as "main" or the same as the latest tagged upstream release
Create the submodule here
git submodule add --name example-formula gitlab@gitlab.infra.opensuse.org:saltstack-formulas/example-formula.git repositories/example-formula
Link the state directory
bin/link_formulas.py
Add the symlink and the submodule directory (which should automagically add .gitmodules
as well) and submit a merge request to production
Wait for someone to merge it or merge it yourself, if you know what you are doing ;-)
Change to the formula repository (the formula directory under repositories/)
If you have not already done so in the past, add the upstream as a remote
git remote add upstream https://github.com/saltstack-formulas/example-formula.git
If you have not already done so in the past, update the origin to a URL you can push to (you can configure HTTPS authentication, but usually SSH is easier)
git remote set-url origin gitlab@gitlab.infra.opensuse.org:saltstack-formulas/example-formula.git
Update the formula repository
git fetch upstream
If we run the formula off the main branch:
git checkout main
git pull main
git checkout -b update-main
git push origin update-main
If we run the formula off a tagged release:
git checkout refs/tags/<tag>
git checkout -b update-<tag>
git push origin update-<tag>
Submit a merge request to merge the formula update branch to production, and wait for someone to merge it - or merge it yourself (ensure no upstream pillar changes break our existing code, otherwise submit a matching patch to salt.git to have it ready already)
Update the submodule
* Checkout the production branch first and update it with the merged changes(while still in the repositories/<formula> subdirectory)
git checkout production
git pull origin production
cd ../..
git checkout -b <formula>
git add repositories/<formula>
git commit -sm 'Update <formula>'
git push origin <formula>
Changes get automatically applied through the "deploy" job.