-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
60 additions
and
0 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,31 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
--- | ||
|
||
loader: taskgraph.loader.transform:loader | ||
|
||
transforms: | ||
- taskgraph.transforms.run:transforms | ||
- taskgraph.transforms.task:transforms | ||
|
||
task-defaults: | ||
worker-type: t-linux | ||
worker: | ||
docker-image: {in-tree: python3.11} | ||
max-run-time: 3600 | ||
run: | ||
cwd: '{checkout}' | ||
using: run-task | ||
checkout: true | ||
|
||
tasks: | ||
apply-staging: | ||
description: "Run `tc-admin apply --envrionment=staging` to apply config to Taskcluster stage" | ||
scopes: | ||
- secrets:get:project/releng/fxci-config/taskcluster-stage-client | ||
run: | ||
command: >- | ||
pip install --user -r requirements/base.txt && | ||
pip install --user --no-deps . && | ||
python taskcluster/scripts/tc-admin-apply-staging.py |
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,29 @@ | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
import os | ||
import subprocess | ||
|
||
import taskcluster | ||
|
||
assert "TASKCLUSTER_PROXY_URL" in os.environ | ||
options = {"rootUrl": os.environ["TASKCLUSTER_PROXY_URL"]} | ||
secrets = taskcluster.Secrets(options) | ||
|
||
result = secrets.get("project/releng/fxci-config/taskcluster-stage-client") | ||
assert result | ||
|
||
auth = result["secret"] | ||
assert isinstance(auth, dict) | ||
|
||
env = os.environ.copy() | ||
del env["TASKCLUSTER_PROXY_URL"] # ensure we don't use the proxy client | ||
env.update( | ||
{ | ||
"TASKCLUSTER_ROOT_URL": "https://stage.taskcluster.nonprod.cloudops.mozgcp.net", | ||
"TASKCLUSTER_CLIENT_ID": auth["clientId"], | ||
"TASKCLUSTER_ACCESS_TOKEN": auth["accessToken"], | ||
} | ||
) | ||
subprocess.run(["tc-admin", "apply", "--environment=staging"], env=env, check=True) |