Sergiusz Bazanski | 6586533 | 2019-05-18 16:23:45 +0200 | [diff] [blame] | 1 | load("@io_bazel_rules_docker//container:container.bzl", "container_image") |
| 2 | |
| 3 | container_image( |
| 4 | name="latest", |
| 5 | base="@prodimage-bionic//image", |
| 6 | tars = ["@factorio-headless//file"], |
| 7 | files = [":entrypoint.sh"], |
| 8 | directory = "/", |
| 9 | entrypoint = ["/entrypoint.sh"], |
| 10 | ) |
| 11 | |
| 12 | # Totally broken right now because google/containerregistry doesn't handle |
| 13 | # /usr/bin/env python == python3. |
| 14 | #container_push( |
| 15 | # name = "push_latest", |
| 16 | # image = ":latest", |
| 17 | # format = "Docker", |
| 18 | # registry = "registry.k0.hswaw.net", |
| 19 | # repository = "app/factorio", |
| 20 | # tag = "latest", |
| 21 | #) |
| 22 | # So this is a replacement hack. |
| 23 | genrule( |
| 24 | name = "push_latest", |
| 25 | srcs = [":latest"], |
| 26 | outs = ["version.sh"], |
| 27 | executable = True, |
| 28 | cmd = """ |
| 29 | docker tag bazel/app/factorio:latest registry.k0.hswaw.net/app/factorio:latest |
| 30 | docker push registry.k0.hswaw.net/app/factorio:latest |
| 31 | echo -ne "#!/bin/sh\necho Tagged.\n" > $(OUTS) |
| 32 | """, |
| 33 | ) |