-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'get-rid-pat' of github.com:cloudposse/.github into get-…
…rid-pat * 'get-rid-pat' of github.com:cloudposse/.github: Added ouputs Added outputs Updated Migration Scripts (#50) Allow release access for tags (#65) Added release branches (#59) Create auto-release-hotfix.yml (#63) `auto-release.yaml` enable filter-by-commitish (#62) Rename auto-release-2.yml to auto-release.yml (#61) Rename auto-release.yml to auto-release-2.yml (#60)
- Loading branch information
Showing
45 changed files
with
826 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
filter-by-commitish: true | ||
name-template: 'v$RESOLVED_VERSION' | ||
tag-template: '$RESOLVED_VERSION' | ||
version-template: '$MAJOR.$MINOR.$PATCH' | ||
version-resolver: | ||
major: | ||
labels: [] | ||
minor: | ||
labels: | ||
- 'minor' | ||
- 'enhancement' | ||
patch: | ||
labels: | ||
- 'auto-update' | ||
- 'patch' | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- 'hotfix' | ||
- 'no-release' | ||
default: 'minor' | ||
|
||
categories: | ||
- title: '🚀 Enhancements' | ||
labels: | ||
- 'enhancement' | ||
- 'patch' | ||
- title: '🐛 Bug Fixes' | ||
labels: | ||
- 'fix' | ||
- 'bugfix' | ||
- 'bug' | ||
- 'hotfix' | ||
- title: '🤖 Automatic Updates' | ||
labels: | ||
- 'auto-update' | ||
|
||
change-template: | | ||
<details> | ||
<summary>$TITLE @$AUTHOR (#$NUMBER)</summary> | ||
$BODY | ||
</details> | ||
template: | | ||
$CHANGES | ||
replacers: | ||
# Remove irrelevant information from Renovate bot | ||
- search: '/(?<=---\s)\s*^#.*(Renovate configuration|Configuration)(?:.|\n)*?This PR has been generated .*/gm' | ||
replace: '' | ||
# Remove Renovate bot banner image | ||
- search: '/\[!\[[^\]]*Renovate\][^\]]*\](\([^)]*\))?\s*\n+/gm' | ||
replace: '' |
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
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 |
---|---|---|
@@ -1,21 +1,7 @@ | ||
export DOCKER_ORG ?= cloudposse | ||
export DOCKER_IMAGE ?= $(DOCKER_ORG)/terraform-root-modules | ||
export DOCKER_TAG ?= latest | ||
export DOCKER_IMAGE_NAME ?= $(DOCKER_IMAGE):$(DOCKER_TAG) | ||
export DOCKER_BUILD_FLAGS = | ||
export README_DEPS ?= docs/targets.md docs/terraform.md | ||
export README_DEPS ?= docs/targets.md | ||
-include $(shell curl -sSL -o .build-harness "https://cloudposse.tools/build-harness"; echo .build-harness) | ||
|
||
all: init deps build install run | ||
|
||
deps: | ||
@exit 0 | ||
|
||
build: | ||
@make --no-print-directory docker:build | ||
|
||
push: | ||
docker push $(DOCKER_IMAGE) | ||
|
||
run: | ||
docker run -it ${DOCKER_IMAGE_NAME} sh |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
deps: | ||
brew install gh yq | ||
pip3 install yamlfix | ||
|
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,78 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Due to just endless problems working around `git-xargs` limitations, challenges with rate limits, | ||
# resorting to a basic shell script that does the same thing, but with more control and less magic and no parallelism. | ||
set -e | ||
|
||
migration=$1 | ||
batch=$2 | ||
|
||
# Validate usage | ||
if [[ -z "$migration" || -z "$batch" ]]; then | ||
echo "Usage: $0 <migration_branch> <batch>" | ||
exit 1 | ||
fi | ||
curdir=$(pwd) | ||
migration_branch="migration/${migration}" | ||
migration_dir="migrations/${migration}" | ||
repos="${migration_dir}/${batch}" | ||
|
||
# Test if the repo file exists | ||
if [[ ! -f "$repos" ]]; then | ||
echo "Repo file for ${batch} batch does not exist: $repos" | ||
exit 1 | ||
fi | ||
|
||
if [[ ! -d "migrations/${migration}" ]]; then | ||
echo "Migration does not exist: $migration" | ||
exit 1 | ||
fi | ||
|
||
while IFS= read -r repo; do | ||
if [[ $repo == \#* ]]; then | ||
continue | ||
fi | ||
cd "${curdir}" | ||
repo_name=$(basename "$repo" .git) | ||
repo_owner=$(basename "$(dirname "$repo")") | ||
repo_url="[email protected]:${repo_owner}/${repo_name}.git" | ||
tmp_dir="tmp/$repo_owner/$repo_name" | ||
|
||
echo "Processing $repo_url" | ||
if [[ ! -d "$tmp_dir" ]]; then | ||
mkdir -p $(dirname "$tmp_dir") | ||
git clone "$repo_url" "${tmp_dir}" | ||
fi | ||
|
||
cd "${tmp_dir}" || exit | ||
|
||
# Identify the default branch | ||
default_branch=$(git remote show origin | grep 'HEAD branch' | cut -d' ' -f5) | ||
|
||
git checkout "${default_branch}" | ||
# Ensure our branch is reset to match the remote default branch, so that we can apply the migration cleanly | ||
git reset --hard origin/${default_branch} | ||
git pull origin "${default_branch}" | ||
|
||
if git rev-parse --verify "${migration_branch}" >/dev/null 2>&1; then | ||
echo "Deleting existing ${migration_branch} branch" | ||
git branch -D "${migration_branch}" | ||
fi | ||
echo "Creating ${migration_branch} branch" | ||
git checkout -b "${migration_branch}" | ||
|
||
# Always start clean | ||
git clean -fxd | ||
|
||
export XARGS_DRY_RUN=${XARGS_DRY_RUN:-true} | ||
export XARGS_REPO_NAME="${repo_name}" | ||
export XARGS_REPO_OWNER="${repo_owner}" | ||
export MIGRATE_PATH="${curdir}" | ||
echo "Performing migration..." | ||
$curdir/run.sh "${migration}" | ||
if [[ $? -ne 0 ]]; then | ||
echo "Migration failed for ${repo}" | ||
exit 1 | ||
fi | ||
|
||
done < "${repos}" |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.