Skip to content

Commit 969bbf0

Browse files
author
EvaBardou
committed
Update version.json before taskboot build
1 parent ae17312 commit 969bbf0

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

.taskcluster.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -295,17 +295,13 @@ tasks:
295295
GIT_REPOSITORY: ${repository}
296296
GIT_REVISION: ${head_rev}
297297
command:
298-
- taskboot
299-
- build
300-
- --image
301-
- mozilla/code-review
302-
- --tag
303-
- "${channel}"
304-
- --tag
298+
- bash
299+
- backend/build.sh
305300
- "${head_rev}"
306-
- --write
307-
- /backend.tar
308-
- backend/Dockerfile
301+
- "${head_branch}"
302+
- "${repository}"
303+
- "${taskcluster_root_url}/tasks/{$eval: as_slugid('backend_build')}"
304+
- "${channel}"
309305
artifacts:
310306
public/code-review-backend.tar:
311307
expires: {$fromNow: '2 weeks'}

backend/build.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/bin/bash
2+
3+
COMMIT_SHA=$1
4+
VERSION=$2
5+
SOURCE=$3
6+
BUILD_URL=$4
7+
CHANNEL=$5
8+
9+
# create a version.json per https://github.com/mozilla-services/Dockerflow/blob/master/docs/version_object.md
10+
printf '{"commit": "%s", "version": "%s", "source": "%s", "build": "%s"}\n' \
11+
"$COMMIT_SHA" \
12+
"$VERSION" \
13+
"$SOURCE" \
14+
"$BUILD_URL" > backend/code_review_backend/version.json
15+
16+
taskboot build --image mozilla/code-review --tag "$CHANNEL" --tag "$COMMIT_SHA" --write /backend.tar backend/Dockerfile

backend/code_review_backend/version.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"version": "stub",
44
"source": "https://github.com/mozilla/code-review",
55
"build": "https://tools.taskcluster.net/task-inspector/#XXXXXXXXXXXXXXXXXX"
6-
}
6+
}

0 commit comments

Comments
 (0)