Used in jenkins to test github pull requests prerequisites and make releases.
To run from jenkins:
$docker run -i --name="$BUILD_TAG-gitflow-pr" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_CHANGE_ID="$CHANGE_ID" -e GIT_CHANGE_AUTHOR="$CHANGE_AUTHOR" -e GIT_CHANGE_TITLE="$CHANGE_TITLE" -e GIT_TOKEN="$GITHUB_TOKEN" -e GIT_NAME="$GIT_NAME" eeacms/gitflow
- GIT_NAME - Mandatory, repository name, example: "eea.testegg"
- GIT_ORG - Organisation name, default: "eea"
- GIT_VERSIONFILE - Location of the Versionfile, default: "eea/testegg/version.txt"
- GIT_HISTORYFILE - Location of the changelog, default:"docs/HISTORY.txt"
- History file updated in pull request
- Version file updated in pull request
- Version is not present in git tags
- Version format is number.number
- New version is bigger than last released version or no versions released yet
To run from jenkins:
$docker run -i --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e EGGREPO_USERNAME="$EGGREPO_USERNAME" -e EGGREPO_PASSWORD="$EGGREPO_PASSWORD" -e GIT_NAME="$GIT_NAME" -e PYPI_USERNAME="$PYPI_USERNAME" -e PYPI_PASSWORD="$PYPI_PASSWORD" -e GIT_TOKEN="$GITHUB_TOKEN" eeacms/gitflow
- GIT_NAME - Mandatory, repository name, example: "eea.testegg"
- GIT_ORG - Organisation name, default: "eea"
- GIT_VERSIONFILE - Location of the Versionfile, default: "eea/testegg/version.txt"
- GIT_USERNAME - User that will do the changes in github, default "EEA Jenkins"
- GIT_EMAIL - Email that will do the changes in github, default value set in code
- EGGREPO_URL - URL of Repository for python eggs - default: https://eggrepo.eea.europa.eu/
- KGS_GITNAME - Repository name on github for KGS (Docker image for Plone with EEA Common Add-ons) - default: eea.docker.kgs
- KGS_VERSIONS_PATH - Location of file from KGS where the version of the egg is configured - default: src/plone/versions.cfg
- NODEJS_VERSION - version of nodejs used in javascript runs
- LANGUAGE - if "javascript" will run the javascript releases
- GITFLOW_BEHAVIOR - TAG_ONLY to only create tag, and RUN_ON_TAG all release steps after it's already created
- DOCKERHUB_REPO - repository to upgrade
- RANCHER_CATALOG_PATHS - where to upgrade in catalog, can be empty to upgrade all existing templates
- DEPENDENT_DOCKERFILE_URL - list of paths separated by space with the format: GIT_ORG/GIT_NAME/blob/GIT_BRANCH/Dockerfile
- TRIGGER_MAIN_URL - to trigger the dockerhub image build in case it's not triggered ( webhook failure )
- RANCHER_CATALOG_ADD_MINUS - true, will add "-1" to the release in the rancher catalog
- RANCHER_CATALOG_SAME_VERSION - true, will not release catalog, but modify in the current one
- EXTRACT_VERSION_SH - script location that if exits, will run to calculate the next image version
- EGGREPO_USERNAME, EGGREPO_PASSWORD - user and password for eggrepo
- PYPI_USERNAME, PYPI_PASSWORD - user and password for Pypi
- GIT_TOKEN - token used for GitHub API
- NPM_TOKEN - token used for NPM login
- DOCKERHUB_USER, DOCKERHUB_PASS - used in DockerHub login
- Release on EGGREPO_URL
- Create tag on GIT_NAME repo with released version
- Update in KGS_GITNAME repo with the released version
All the steps can be rerun, the job skipping the steps already processed
Is done only if there are files changed since the latest release.
Updates local Dockerfiles(DEPENDENT_DOCKERFILE_URL) with the new release number.
Version is calculated using current date - YY.MM.DD
( when HOTFIX variable is given - YY.MM.DD-RELEASE
) or using a script located at the EXTRACT_VERSION_SH
variable value, which is by default src/docker/calculate_next_release.sh
Waits for dockerhub to finish the build succesfully before creating the Rancher Catalog release and triggering Dockerfile updates(DEPENDENT_DOCKERFILE_URL) and triggering Docker Hub repo builds (TRIGGER_RELEASE).
To run from jenkins:
$docker run -i --rm --name="$BUILD_TAG-nightlyrelease" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_ORG="$GIT_ORG" -e GIT_NAME="$GIT_NAME" -e DOCKERHUB_REPO="$DOCKERHUB_REPO" -e GIT_TOKEN="$GIT_TOKEN" -e DOCKERHUB_USER="$DOCKERHUB_USER" -e DOCKERHUB_PASS="$DOCKERHUB_PASS" -e DEPENDENT_DOCKERFILE_URL="devel/Dockerfile ORG/REPO/blob/BRANCH/PATH_TO_Dockerfile" -e TRIGGER_MAIN_URL="$TRIGGER_MAIN_URL" -e TRIGGER_RELEASE="DOCKERHUB_RELATED_REPO1;TRIGGER1 DOCKERHUB_RELATED_REPO2;TRIGGER2" eeacms/gitflow'
- GIT_NAME - Mandatory, repository name, example: "eea.docker.kgs"
- GIT_ORG - Organisation name, default: "eea"
- GIT_USERNAME - User that will do the changes in github, default "EEA Jenkins"
- GIT_EMAIL - Email that will do the changes in github, default value set in code
- DOCKERHUB_REPO - Dockerhub repository name ( for example eeacms/kgs for KGS )
- DOCKERHUB_REPO_SUFIX - If the image is also released with a suffix ( for example will update both IMAGE:VERSION and IMAGE:VERSION-SUFIX)
- RANCHER_CATALOG_PATHS - If given will upgrade only the catalog paths after the release. If not given, will be calculated from the catalog locating all current releases containing
DOCKERHUB_REPO
- RANCHER_CATALOG_SAME_VERSION - If given, will not create new catalog releases, but upgrade the last one found in the catalog with the new release of
DOCKERHUB_REPO
- DEPENDENT_DOCKERFILE_URL - Space separated list of Dockerfiles witch will contain the new release of the
DOCKERHUB_REPO
- 2 types:- Local Dockerfile - same branch, same repo, will share a release with the main Dockerfile so will be updated before the release on github - for example - devel/Dockerfile
- Remote Dockerfile - other branch or other repo - format is - ORG/REPO/blob/BRANCH/PATH_TO_Dockerfile - will be updated after the release on Dockerhub and catalog
- EXTRACT_VERSION_SH - location of script to calculate the next release, if file is not found will use the
YY.MM.DD
release.
- GIT_TOKEN - Mandatory, the token used for GitHub API
- DOCKERHUB_USER - Mandatory, the token used for Dockerhub release trigger and check status
- DOCKERHUB_PASS - Mandatory, the token used for Dockerhub release trigger and check status
- TRIGGER_MAIN_URL - Trigger url for DOCKERHUB_REPO to resubmit in case of failure to start
- TRIGGER_RELEASE - Space separated list of DEPENDENT_DOCKERFILE_REPOS;TRIGGER_OF_THE_REPO - will be triggered after the DEPENDENT_DOCKERFILE_URL upgrades.
$docker run -i --rm --name="$ {BUILD_TAG}nightly-plone" -e GIT_BRANCH="master" -e GIT_NAME=""eea.docker.plone" -e DOCKERHUB_REPO="eeacms/plone" -e GIT_TOKEN="$GITHUB_TOKEN" -e DOCKERHUB_USER="$DOCKERHUB_USER" -e DOCKERHUB_PASS="$DOCKERHUB_PASS" -e DEPENDENT_DOCKERFILE_URL="eea/eea.docker.plonesaas/blob/master/Dockerfile" eeacms/gitflow'
$docker run -i --rm --name="$ {BUILD_TAG}nightly-plonesaas" -e GIT_BRANCH="master" -e GIT_NAME="eea.docker.plonesaas" -e DOCKERHUB_REPO="eeacms/plonesaas" -e GIT_TOKEN="$GIT_TOKEN" -e DOCKERHUB_USER="$DOCKERHUB_USER" -e DOCKERHUB_PASS="$DOCKERHUB_PASS" -e DEPENDENT_DOCKERFILE_URL="devel/Dockerfile" -e TRIGGER_MAIN_URL="xxx/trigger/xxx/call/" -e TRIGGER_RELEASE="eeacms/plonesaas-devel;yyy/trigger/yyy/call/" eeacms/gitflow'
To run from jenkins:
$docker run -i --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME=eea.docker.apache-eea-www -e GIT_TOKEN="$GITHUB_TOKEN" -e DOCKERHUB_USER="$DOCKERHUB_USER" -e DOCKERHUB_PASS="$DOCKERHUB_PASS" eeacms/gitflow
and
$docker run -i --name="$BUILD_TAG-gitflow-master" -e GIT_BRANCH="$BRANCH_NAME" -e GIT_NAME=eea.docker.varnish-eea-www -e GIT_TOKEN="$GITHUB_TOKEN" -e DOCKERHUB_USER="$DOCKERHUB_USER" -e DOCKERHUB_PASS="$DOCKERHUB_PASS" eeacms/gitflow