Skip to content

Instantly share code, notes, and snippets.

@olblak
Last active November 29, 2019 08:34
Show Gist options
  • Save olblak/fcc6b6074bbbe6d048e7b34d99741e87 to your computer and use it in GitHub Desktop.
Save olblak/fcc6b6074bbbe6d048e7b34d99741e87 to your computer and use it in GitHub Desktop.
release automation tool
```
tagname = "https://api.github.com/repos/jenkins-infra/plugin-site-api/releases/latest".tag_name,
if not tagname in "https://hub.docker.com/v2/repositories/jenkinsciinfra/plugin-site/tags?page_size=1000" {
docker build -t jenkinsinfra/pluginsite:$tagname
docker push
}
if tagname != "https://github.com/jenkins-infra/charts/blob/master/charts/plugin-site/values.yaml".image.repository
update yaml file "https://github.com/jenkins-infra/charts/blob/master/charts/plugin-site/values.yaml"
git add https//github.com/jenkins-infra/charts/blob/master/charts/plugin-site/values.yaml
git commit https//github.com/jenkins-infra/charts/blob/master/charts/plugin-site/values.yaml
git push
```
# parameters:
* github.org:
* github.repository
* dockerhub.organisation
* dockerhub.repository
* version (default to latest)
# credentials:
git push permission
dockerhub credential
# const
DOCKERHUB_URL: https://hub.docker.com/v2/repositories/${dockerhub.organisation}/${dockerhub.repository}/tags?page_size=1000
GITHUB_URL: https://api.github.com/repos/${github.org}/${github.repository}/releases/latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment