Created
February 12, 2021 11:29
-
-
Save mrnugget/4058323ad783a683d82a4c9790f98462 to your computer and use it in GitHub Desktop.
Sourcegraph campaign to change Docker Hub username in Circle CI configuration
This file contains hidden or 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
name: update-circle-ci-docker-user.campaign.yaml | |
description: Changes the Docker Hub username used for Circle CI | |
# Search for repositories containing a circle-ci.yml file with the old usename | |
on: | |
- repositoriesMatchingQuery: mydockerhub-user file:circle-ci.[yaml|yml] | |
# In each repository | |
steps: | |
# replace the old with the new username in the found files | |
- run: | | |
for file in "${{ join repository.search_result_paths " " }}"; | |
do | |
sed -i 's/mydockerhub-user/ci-dockerhub-user/g;' ${file} | |
done | |
container: alpine:3 | |
# Describe the changeset (e.g., GitHub pull request) you want for each repository. | |
changesetTemplate: | |
title: Use new Docker Hub username in Circle CI config | |
body: This change replaces the old Docker Hub user with the new, CI specific user account. | |
branch: campaigns/update-ci-user # Push the commit to this branch. | |
commit: | |
message: Update Docker Hub user in CI | |
published: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment