-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DataDog:master' into master
- Loading branch information
Showing
29 changed files
with
1,756 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Update Docker Build Image | ||
|
||
on: | ||
schedule: | ||
# A day after creating the tag from https://github.com/DataDog/dd-trace-java-docker-build/blob/master/.github/workflows/docker-tag.yml | ||
- cron: '0 0 1 2,5,8,11 *' | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: 'The tag to use for the Docker build image' | ||
required: true | ||
default: 'vYY.MM-base' | ||
|
||
jobs: | ||
update-docker-build-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write # Required to commit and push changes to a new branch | ||
pull-requests: write # Required to create a pull request | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v2 | ||
- name: Download ghcommit CLI | ||
run: | | ||
curl https://github.com/planetscale/ghcommit/releases/download/v0.1.48/ghcommit_linux_amd64 -o /usr/local/bin/ghcommit -L | ||
chmod +x /usr/local/bin/ghcommit | ||
- name: Pick a branch name | ||
id: define-branch | ||
run: echo "branch=ci/update-docker-build-image-$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | ||
- name: Create branch | ||
run: | | ||
git checkout -b ${{ steps.define-branch.outputs.branch }} | ||
git push -u origin ${{ steps.define-branch.outputs.branch }} --force | ||
- name: Define the Docker build image tage to use | ||
id: define-tag | ||
run: | | ||
if [ -n "${{ github.event.inputs.tag }}" ]; then | ||
TAG=${{ github.event.inputs.tag }} | ||
else | ||
CURRENT_MONTH=$(date +%m) | ||
CURRENT_YEAR=$(date +%y) | ||
case $CURRENT_MONTH in | ||
01) TAG_DATE="$(($CURRENT_YEAR - 1)).10" ;; | ||
02|03|04) TAG_DATE="${CURRENT_YEAR}.01" ;; | ||
05|06|07) TAG_DATE="${CURRENT_YEAR}.04" ;; | ||
08|09|10) TAG_DATE="${CURRENT_YEAR}.07" ;; | ||
11|12) TAG_DATE="${CURRENT_YEAR}.10" ;; | ||
esac | ||
TAG="v${TAG_DATE}-base" | ||
fi | ||
echo "tag=${TAG}" >> "$GITHUB_OUTPUT" | ||
echo "::notice::Using Docker build image tag: ${TAG}" | ||
- name: Update the Docker build image in CircleCI config | ||
run: | | ||
sed -i 's|DOCKER_IMAGE_VERSION=.*|DOCKER_IMAGE_VERSION="${{ steps.define-tag.outputs.tag }}"|' .circleci/render_config.py | ||
- name: Update the Docker build image in GitLab CI config | ||
run: | | ||
sed -i 's|image: ghcr.io/datadog/dd-trace-java-docker-build:.*|image: ghcr.io/datadog/dd-trace-java-docker-build:${{ steps.define-tag.outputs.tag }}|' .gitlab-ci.yml | ||
- name: Commit and push changes | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
run: | | ||
ghcommit --repository ${{ github.repository }} --branch ${{ steps.define-branch.outputs.branch }} --add .circleci/render_config.py --add .gitlab-ci.yml --message "feat(ci): Update Docker build image" | ||
- name: Create pull request | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
run: | | ||
gh pr create --title "Update Docker build image" \ | ||
--base master \ | ||
--head ${{ steps.define-branch.outputs.branch }} \ | ||
--label "comp: tooling" \ | ||
--label "type: enhancement" \ | ||
--label "tag: no release notes" \ | ||
--body "This PR updates the Docker build image to ${{ steps.define-tag.outputs.tag }}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.