app/factorio -> personal/q3k/factorio
Change-Id: I92be6a726aef306f6f4de4e5a91defa86cda81fc
diff --git a/personal/q3k/factorio/BUILD b/personal/q3k/factorio/BUILD
new file mode 100644
index 0000000..44be4dd
--- /dev/null
+++ b/personal/q3k/factorio/BUILD
@@ -0,0 +1,52 @@
+load("@io_bazel_rules_docker//container:container.bzl", "container_image")
+
+container_image(
+ name="0.16.51-1",
+ base="@prodimage-bionic//image",
+ tars = ["@factorio-headless-0.16.51//file"],
+ files = [":entrypoint.sh"],
+ directory = "/",
+ entrypoint = ["/entrypoint.sh"],
+)
+
+container_image(
+ name="0.17.41-1",
+ base="@prodimage-bionic//image",
+ tars = ["@factorio-headless-0.17.41//file"],
+ files = [":entrypoint.sh"],
+ directory = "/",
+ entrypoint = ["/entrypoint.sh"],
+)
+
+container_image(
+ name="0.17.52-1",
+ base="@prodimage-bionic//image",
+ tars = ["@factorio-headless-0.17.52//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 = [":0.17.52-1"],
+ outs = ["version.sh"],
+ executable = True,
+ cmd = """
+ tag=0.17.52-1
+ docker tag bazel/personal/q3k/factorio:$$tag registry.k0.hswaw.net/personal/q3k/factorio:$$tag
+ docker push registry.k0.hswaw.net/personal/q3k/factorio:$$tag
+ echo -ne "#!/bin/sh\necho Pushed $$tag.\n" > $(OUTS)
+ """,
+)