Skip to content
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

feat: ops bootstrap #105

Merged
merged 53 commits into from
Apr 1, 2024
Merged
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
50f8356
venv is now a lib
joshuarli Jan 30, 2024
9505d83
more generic check and ensure
joshuarli Jan 31, 2024
d964ef2
gcloud
joshuarli Jan 31, 2024
9eaa359
fix
joshuarli Feb 2, 2024
a130369
venv.get
joshuarli Feb 5, 2024
980a880
sync
joshuarli Feb 5, 2024
cecda9f
sync
joshuarli Feb 5, 2024
1876009
wip
joshuarli Feb 6, 2024
4d6fab2
fix
joshuarli Feb 6, 2024
10886a2
support multiple pythons
joshuarli Feb 6, 2024
20e6569
fix idempotent
joshuarli Feb 6, 2024
cc1a3f4
run devenv/sync.py if it exists
joshuarli Feb 7, 2024
d4859e5
install gke-gcloud-auth-plugin
joshuarli Feb 7, 2024
87f9b70
Merge branch 'gcloud' into sync-run
joshuarli Feb 7, 2024
73fe2b5
move version specification to user
joshuarli Feb 7, 2024
1a0d24f
uninstall
joshuarli Feb 7, 2024
7ededc1
.
joshuarli Feb 7, 2024
d49628b
[skip ci] bootstrap ops
joshuarli Feb 7, 2024
2cdb6c7
[skip ci] temp
joshuarli Feb 8, 2024
b24750a
updated code from the future
joshuarli Feb 8, 2024
a95d650
fix
joshuarli Feb 8, 2024
f79d5c9
gcloud
joshuarli Jan 31, 2024
d4507da
fix
joshuarli Feb 2, 2024
ba9d6f8
install gke-gcloud-auth-plugin
joshuarli Feb 7, 2024
8be067d
move version specification to user
joshuarli Feb 8, 2024
6bb0ab0
Merge branch 'gcloud-v2' into sentry-kube-venv
joshuarli Feb 8, 2024
7b64946
Merge branch 'sentry-kube-venv' into sync-run
joshuarli Feb 8, 2024
b694763
Merge branch 'sync-run' into bootstrap-ops
joshuarli Feb 8, 2024
1351d5b
fix rebase
joshuarli Feb 8, 2024
ab0764f
Merge branch 'sync-run' into bootstrap-ops
joshuarli Feb 8, 2024
c2b6770
3.11
joshuarli Feb 8, 2024
bd3d2f3
pc on 3.11
joshuarli Feb 8, 2024
ce9d0de
build and test on 3.11
joshuarli Feb 8, 2024
0f2658d
pc
joshuarli Feb 8, 2024
f8444dd
tox
joshuarli Feb 8, 2024
e4e02d6
fix pc
joshuarli Feb 8, 2024
39d904e
Merge branch 'sync-run' into test-on-3.11
joshuarli Feb 8, 2024
b5c4dbd
Merge branch 'sync-run' into bootstrap-ops
joshuarli Feb 8, 2024
b503f8a
[skip ci] save
joshuarli Feb 12, 2024
811ac72
Merge remote-tracking branch 'origin/main' into bootstrap-ops
joshuarli Feb 25, 2024
92f8f24
revert
joshuarli Feb 25, 2024
4e59225
fix merge
joshuarli Feb 25, 2024
f0e5e42
tenv
joshuarli Mar 27, 2024
02191bd
fixes
joshuarli Mar 27, 2024
e515ee0
Merge branch 'bootstrap-ops' into ops-bootstrap-redo
joshuarli Mar 27, 2024
a7f527e
try integration
joshuarli Mar 27, 2024
895a6cc
rm, needs to be a submodule
joshuarli Mar 27, 2024
f3a9e8d
CI_DEVENV_INTEGRATION_FAKE_REPOROOT
joshuarli Mar 28, 2024
3f601f2
fix
joshuarli Mar 28, 2024
8999353
restore
joshuarli Mar 28, 2024
e4788e5
Merge branch 'ops-tenv' into ops-bootstrap-redo
joshuarli Mar 28, 2024
538a250
Merge remote-tracking branch 'origin/main' into ops-bootstrap-redo
joshuarli Apr 1, 2024
34b556f
flip back and fix merge artifact
joshuarli Apr 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 43 additions & 20 deletions devenv/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,10 @@
def main(coderoot: str, argv: Sequence[str] | None = None) -> ExitCode:
parser = argparse.ArgumentParser(description=help)
parser.add_argument(
"repo",
type=str,
nargs="?",
default="sentry",
choices=("sentry", "getsentry"),
"repo", type=str, nargs="?", default="sentry", choices=("sentry", "ops")
)
args = parser.parse_args(argv)

if args.repo == "getsentry":
# Setting up sentry means we're setting up both repos.
args.repo = "sentry"

if args.repo not in {"sentry"}:
return f"repo {args.repo} not supported yet!"

if not CI and shutil.which("xcrun"):
# xcode-select --install will take a while,
# and involves elevated permissions with a GUI,
Expand Down Expand Up @@ -90,7 +79,40 @@ def main(coderoot: str, argv: Sequence[str] | None = None) -> ExitCode:

os.makedirs(coderoot, exist_ok=True)

if args.repo == "sentry":
if args.repo == "ops":
if not os.path.exists(f"{coderoot}/ops"):
proc.run(
(
"git",
"-C",
coderoot,
"clone",
"--filter=blob:none",
"[email protected]:getsentry/ops",
),
exit=True,
)
if not os.path.exists(f"{coderoot}/terraform-modules"):
proc.run(
(
"git",
"-C",
coderoot,
"clone",
"--filter=blob:none",
"[email protected]:getsentry/terraform-modules",
),
exit=True,
)
proc.run(("devenv", "sync"), cwd=f"{coderoot}/ops")
print(
f"""
All done! Please close this terminal window and start a fresh one.

ops repo is at: {coderoot}/ops
"""
)
elif args.repo == "sentry":
if not os.path.exists(f"{coderoot}/sentry"):
# git@ clones forces the use of cloning through SSH which is what we want,
# though CI must clone open source repos via https (no git authentication)
Expand Down Expand Up @@ -179,12 +201,13 @@ def main(coderoot: str, argv: Sequence[str] | None = None) -> ExitCode:
cwd=f"{coderoot}/getsentry",
)

print(
f"""
All done! Please close this terminal window and start a fresh one.
print(
f"""
All done! Please close this terminal window and start a fresh one.

Sentry has been set up in {coderoot}/sentry. cd into it and you should
be able to run `sentry devserver`.
"""
)

Sentry has been set up in {coderoot}/sentry. cd into it and you should
be able to run `sentry devserver`.
"""
)
return 0
Loading