Skip to content

Instantly share code, notes, and snippets.

@tonysm
Created August 16, 2020 18:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tonysm/da8e1d45cf85ad8263465bf16b4ffc8c to your computer and use it in GitHub Desktop.
Save tonysm/da8e1d45cf85ad8263465bf16b4ffc8c to your computer and use it in GitHub Desktop.
Commiting changes and sending a Pull Request to the infrastructure repository
# Configuring Git
git config --global credential.helper store
echo "https://${GITHUB_TOKEN}:x-oauth-basic@github.com" > "${HOME}/.git-credentials"
hub config --global hub.protocol https
hub config --global user.name "${GITHUB_NAME}"
hub config --global user.email "${GIT_EMAIL}"
# Cloning the infrastructure repository
hub clone ${GIT_REPO} infrastructure-repo
cd infrastructure-repo
# Create a new branch for the release
git checkout -b release-${RELEASE_VERSION}
# Patch the new version using kustomize
kustomize edit set image laravel-app-php=tonysm/docker4laravelapp-php:${RELEASE_VERSION}
kustomize edit set image laravel-app-nginx=tonysm/docker4laravelapp-nginx:${RELEASE_VERSION}
# Adds the kustomization file to git stage
hub add kustomization.yml
hub commit -F- <<EOF
Auto-release of the image version
This commit updates the application container image version to: ${RELEASE_VERSION}
EOF
# Create the PR in the infrastructure repository
hub pull-request -p -m "Auto-release of image version: ${RELEASE_VERSION}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment