Skip to content

Commit 91ac1a1

Browse files
jcristauahal
authored andcommitted
feat(init): use versioned decision image
Fixes #493
1 parent 649bba5 commit 91ac1a1

File tree

6 files changed

+8
-304
lines changed

6 files changed

+8
-304
lines changed

src/taskgraph/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -859,7 +859,7 @@ def init_taskgraph(options):
859859
shutil.rmtree(tg_dir)
860860

861861
# Populate some defaults from the current repository.
862-
context = {"project_name": root.name}
862+
context = {"project_name": root.name, "taskgraph_version": taskgraph.__version__}
863863

864864
try:
865865
repo_url = repo.get_url(remote=repo.remote_name) # type: ignore

template/cookiecutter.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"project_name": "my-project",
3+
"taskgraph_version": "{{ cookiecutter.taskgraph_version }}",
34
"repo_host": ["github", "hgmo"],
45
"repo_name": "my-repo",
56
"project_slug": "{{ cookiecutter.repo_name.lower().replace(' ', '_').replace('-', '_') }}",

template/{{cookiecutter.project_name}}/taskcluster.github.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ tasks:
205205
${normProjectUpper}_HEAD_REF: '${short_head_ref}'
206206
${normProjectUpper}_HEAD_REV: '${head_sha}'
207207
${normProjectUpper}_REPOSITORY_TYPE: git
208-
${normProjectUpper}_PIP_REQUIREMENTS: taskcluster/requirements.txt
209208
REPOSITORIES:
210209
$json:
211210
${normProject}: ${normProject}
@@ -225,7 +224,7 @@ tasks:
225224
features:
226225
taskclusterProxy: true
227226

228-
image: mozillareleases/taskgraph:decision-c4ac262880970ca484105929e02dd12f00214d5f2603ab6ce4c0d17de5cd0280@sha256:2dd667994aa13fccdcdcede85c570a5eb4a5247e42875a9e95a135ef774ee469
227+
image: mozillareleases/taskgraph:decision-v{{ cookiecutter.taskgraph_version }}
229228
maxRunTime: 1800
230229

231230
command:
@@ -241,12 +240,11 @@ tasks:
241240
then: >
242241
cd /builds/worker/checkouts/src &&
243242
ln -s /builds/worker/artifacts artifacts &&
244-
pip3 install -r requirements/base.txt &&
245-
~/.local/bin/taskgraph action-callback
243+
taskgraph action-callback
246244
else: >
247245
cd /builds/worker/checkouts/src &&
248246
ln -s /builds/worker/artifacts artifacts &&
249-
~/.local/bin/taskgraph decision
247+
taskgraph decision
250248
--pushlog-id='0'
251249
--pushdate='0'
252250
--project='${project}'

template/{{cookiecutter.project_name}}/taskcluster.hgmo.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ tasks:
124124
${normProjectUpper}_HEAD_REF: '${head_ref}'
125125
${normProjectUpper}_HEAD_REV: '${head_sha}'
126126
${normProjectUpper}_REPOSITORY_TYPE: git
127-
${normProjectUpper}_PIP_REQUIREMENTS: taskcluster/requirements.txt
128127
REPOSITORIES:
129128
$json:
130129
${normProject}: ${normProject}
@@ -141,10 +140,7 @@ tasks:
141140
features:
142141
taskclusterProxy: true
143142

144-
# Note: This task is built server side without the context or tooling that
145-
# exist in tree so we must hard code the hash
146-
image:
147-
mozillareleases/taskgraph:decision-c4ac262880970ca484105929e02dd12f00214d5f2603ab6ce4c0d17de5cd0280@sha256:2dd667994aa13fccdcdcede85c570a5eb4a5247e42875a9e95a135ef774ee469
143+
image: mozillareleases/taskgraph:decision-v{{ cookiecutter.taskgraph_version }}
148144

149145
maxRunTime: 1800
150146

@@ -163,10 +159,10 @@ tasks:
163159
then: >
164160
cd /builds/worker/checkouts/src &&
165161
ln -s /builds/worker/artifacts artifacts &&
166-
~/.local/bin/taskgraph action-callback
162+
taskgraph action-callback
167163
else: >
168164
ln -s /builds/worker/artifacts artifacts &&
169-
~/.local/bin/taskgraph decision
165+
taskgraph decision
170166
--pushlog-id='${push.pushlog_id}'
171167
--pushdate='${push.pushdate}'
172168
--project='${project}'

template/{{cookiecutter.project_name}}/taskcluster/requirements.in

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)