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