| load("@io_bazel_rules_docker//container:container.bzl", "container_image") |
| |
| container_image( |
| name="latest", |
| base="@prodimage-bionic//image", |
| tars = ["@factorio-headless//file"], |
| files = [":entrypoint.sh"], |
| directory = "/", |
| entrypoint = ["/entrypoint.sh"], |
| ) |
| |
| # Totally broken right now because google/containerregistry doesn't handle |
| # /usr/bin/env python == python3. |
| #container_push( |
| # name = "push_latest", |
| # image = ":latest", |
| # format = "Docker", |
| # registry = "registry.k0.hswaw.net", |
| # repository = "app/factorio", |
| # tag = "latest", |
| #) |
| # So this is a replacement hack. |
| genrule( |
| name = "push_latest", |
| srcs = [":latest"], |
| outs = ["version.sh"], |
| executable = True, |
| cmd = """ |
| docker tag bazel/app/factorio:latest registry.k0.hswaw.net/app/factorio:latest |
| docker push registry.k0.hswaw.net/app/factorio:latest |
| echo -ne "#!/bin/sh\necho Tagged.\n" > $(OUTS) |
| """, |
| ) |