|
| 1 | +# This Source Code Form is subject to the terms of the Mozilla Public |
| 2 | +# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 3 | +# file, You can obtain one at https://mozilla.org/MPL/2.0/. |
| 4 | +load("//tool/checkstyle:rules.bzl", "checkstyle_test") |
| 5 | + |
| 6 | +# Same repository as 2.x images. |
| 7 | +load("//images/docker/ubuntu-2x:deployment.bzl", deployment_docker = "deployment") |
| 8 | + |
| 9 | +# Gen-rules to generate <VERSION>-<PLATFORM> as tag |
| 10 | +genrule( |
| 11 | + name = "tag-amd64", |
| 12 | + srcs = [":VERSION"], |
| 13 | + outs = ["tag-amd64.txt"], |
| 14 | + cmd = "cat $(location :VERSION) | tr -d '\n' > $(location tag-amd64.txt) && echo \"-amd64\" >> $(location tag-amd64.txt)", |
| 15 | +) |
| 16 | + |
| 17 | +genrule( |
| 18 | + name = "tag-arm64", |
| 19 | + srcs = [":VERSION"], |
| 20 | + outs = ["tag-arm64.txt"], |
| 21 | + cmd = "cat $(location :VERSION) | tr -d '\n' > $(location tag-arm64.txt) && echo \"-arm64\" >> $(location tag-arm64.txt)", |
| 22 | +) |
| 23 | + |
| 24 | +sh_binary( |
| 25 | + name = "assemble-docker-amd64", |
| 26 | + srcs = ["//images/docker:assemble-docker.sh"], |
| 27 | + data = ["Dockerfile.amd64", "VERSION", "tag-amd64"], |
| 28 | + deps = [], |
| 29 | + args = ["$(location Dockerfile.amd64)", "amd64", "$(location :tag-amd64)", deployment_docker["docker.organisation"], deployment_docker["docker.repository"]] |
| 30 | +) |
| 31 | + |
| 32 | +sh_binary( |
| 33 | + name = "assemble-docker-arm64", |
| 34 | + srcs = ["//images/docker:assemble-docker.sh"], |
| 35 | + data = ["Dockerfile.arm64", "VERSION", "tag-arm64"], |
| 36 | + deps = [], |
| 37 | + args = ["$(location Dockerfile.arm64)", "arm64", "$(location :tag-arm64)", deployment_docker["docker.organisation"], deployment_docker["docker.repository"]] |
| 38 | +) |
| 39 | + |
| 40 | +sh_binary( |
| 41 | + name = "deploy-docker-amd64", |
| 42 | + deps = [], |
| 43 | + srcs = ["//images/docker:deploy-docker.sh"], |
| 44 | + data = ["VERSION", "tag-amd64"], |
| 45 | + args = ["$(location :tag-amd64)", deployment_docker["docker.organisation"], deployment_docker["docker.repository"]] |
| 46 | +) |
| 47 | + |
| 48 | +sh_binary( |
| 49 | + name = "deploy-docker-arm64", |
| 50 | + deps = [], |
| 51 | + srcs = ["//images/docker:deploy-docker.sh"], |
| 52 | + data = ["VERSION", "tag-arm64"], |
| 53 | + args = ["$(location :tag-arm64)", deployment_docker["docker.organisation"], deployment_docker["docker.repository"]] |
| 54 | +) |
| 55 | + |
| 56 | +checkstyle_test( |
| 57 | + name = "checkstyle", |
| 58 | + include = glob(["*"]), |
| 59 | + exclude = glob(["*.md", "VERSION"]), |
| 60 | + license_type = "mpl-header", |
| 61 | + size = "small", |
| 62 | +) |
0 commit comments