-
Notifications
You must be signed in to change notification settings - Fork 36
More sophisticated automation of image set generation #486
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
petemoore
wants to merge
9
commits into
main
Choose a base branch
from
pull-root-creds-in-tc-admin-script
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3c2a619
Fetch root credentials from pass when running tc-admin
petemoore 2280630
Work in progress
petemoore 16912fd
Merge branch 'main' into pull-root-creds-in-tc-admin-script
petemoore 2bf8cb0
Merge branch 'main' into pull-root-creds-in-tc-admin-script
petemoore bf8c055
Merge branch 'main' of github.com:mozilla/community-tc-config into pu…
petemoore b69a98b
wip
petemoore b38f744
whoops
petemoore 23a85ce
wip
petemoore 82ddcc9
Merge branch 'main' into pull-root-creds-in-tc-admin-script
petemoore File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| set -eu | ||
| set -o pipefail | ||
|
|
||
| function tc_admin { | ||
| apt update | ||
| apt install -y python3-pip python3.8-venv | ||
| pip install --upgrade pip | ||
|
|
||
| export TEMP_DIR="$(mktemp -d -t password-store.XXXXXXXXXX)" | ||
| export PASSWORD_STORE_DIR="${TEMP_DIR}/.password-store" | ||
| cd "${TEMP_DIR}" | ||
| python3 -m venv tc-admin-venv | ||
| source tc-admin-venv/bin/activate | ||
| pip3 install pytest | ||
| pip3 install --upgrade pip | ||
| git clone https://github.com/mozilla/community-tc-config | ||
| cd community-tc-config | ||
| pip3 install -e . | ||
| which tc-admin | ||
| git clone ssh://[email protected]/taskcluster/secrets.git "${PASSWORD_STORE_DIR}" | ||
| TASKCLUSTER_ROOT_URL=https://community-tc.services.mozilla.com | ||
| TASKCLUSTER_CLIENT_ID=static/taskcluster/root | ||
| TASKCLUSTER_ACCESS_TOKEN="$(pass show community-tc/root | head -n 1)" | ||
| unset TASKCLUSTER_CERTIFICATE | ||
| tc-admin diff || true | ||
| tc-admin diff --ids-only || true | ||
| echo | ||
| echo 'Applying in 60 seconds (Ctrl-C to abort)....' | ||
petemoore marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| echo | ||
| done=false | ||
| while ! ${done}; do | ||
| read -p "Apply changes (yes/no)? " choice | ||
| case "$choice" in | ||
| yes) | ||
| echo | ||
| echo 'Applying!' | ||
| echo | ||
| tc-admin apply | ||
| done=true;; | ||
| no) | ||
| echo "Ok ok 🐥" | ||
petemoore marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| done=true;; | ||
| *) | ||
| echo "Invalid response: '${choice}'. Please answer 'yes' or 'no'.";; | ||
| esac | ||
| done | ||
| cd / | ||
| rm -rf "${TEMP_DIR}" | ||
| } | ||
|
|
||
| ################## Entry point ################## | ||
|
|
||
| cd "$(dirname "${0}")" | ||
|
|
||
| if [ "${1-}" == "native" ]; then | ||
| tc_admin | ||
| else | ||
| TAG="$(cat docker/TAG)" | ||
| echo docker run \ | ||
| --rm \ | ||
| -ti \ | ||
| -v "$(pwd):/community-tc-config" \ | ||
| -v ~/.config:/root/.config \ | ||
| -v ~/.gitconfig:/root/.gitconfig \ | ||
| -v ~/.gnupg:/root/.gnupg \ | ||
| -v ~/.ssh:/root/.ssh \ | ||
| "${TAG}" \ | ||
| /community-tc-config/run-tc-admin.sh native | ||
| fi | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.