Sergiusz Bazanski | a7e26cc | 2019-06-21 20:38:35 +0200 | [diff] [blame] | 1 | load("@io_bazel_rules_docker//container:container.bzl", "container_image") |
| 2 | |
| 3 | container_image( |
| 4 | name="with_plugins", |
| 5 | base="@gerrit-3.0.0//image", |
| 6 | files = [ |
| 7 | "//app/gerrit/gerrit-oauth-provider:gerrit-oauth-provider", |
| 8 | ], |
| 9 | # we cannot drop it directly in /var/gerrit/plugins as that changes the |
| 10 | # directory owner to 0:0 and then breaks the gerrit installer that wants |
| 11 | # to overwrite plugins. |
| 12 | directory = "/var/gerrit-plugins", |
| 13 | ) |
| 14 | container_image( |
| 15 | name="3.0.0-r7", |
| 16 | base=":with_plugins", |
| 17 | files = [":entrypoint.sh"], |
| 18 | directory = "/", |
| 19 | entrypoint = ["/entrypoint.sh"], |
| 20 | ) |
| 21 | |
| 22 | genrule( |
| 23 | name = "push_latest", |
| 24 | srcs = [":3.0.0-r7"], |
| 25 | outs = ["version.sh"], |
| 26 | executable = True, |
| 27 | cmd = """ |
| 28 | tag=3.0.0-r7 |
| 29 | docker tag bazel/app/gerrit:$$tag registry.k0.hswaw.net/app/gerrit:$$tag |
| 30 | docker push registry.k0.hswaw.net/app/gerrit:$$tag |
| 31 | echo -ne "#!/bin/sh\necho Pushed $$tag.\n" > $(OUTS) |
| 32 | """, |
| 33 | ) |