app/factorio: multiple versions
diff --git a/WORKSPACE b/WORKSPACE
index 4bf8199..66cdf62 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -71,11 +71,18 @@
# HTTP stuff from the Internet
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
http_file(
- name = "factorio-headless",
+ name = "factorio-headless-0.16.51",
urls = ["https://factorio.com/get-download/0.16.51/headless/linux64"],
sha256 = "6cb09f5ac87f16f8d5b43cef26c0ae26cc46a57a0382e253dfda032dc5bb367f",
downloaded_file_path = "factorio.tar.xz",
)
+load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_file")
+http_file(
+ name = "factorio-headless-0.17.41",
+ urls = ["https://factorio.com/get-download/0.17.41/headless/linux64"],
+ sha256 = "bf2d16b23c3bbd97e41889d3e27670b6d958fa3d50f0befb41d234f735e8e6d1",
+ downloaded_file_path = "factorio.tar.xz",
+)
# Go rules
diff --git a/app/factorio/BUILD b/app/factorio/BUILD
index dc5dfd5..f3fd191 100644
--- a/app/factorio/BUILD
+++ b/app/factorio/BUILD
@@ -1,12 +1,21 @@
load("@io_bazel_rules_docker//container:container.bzl", "container_image")
container_image(
- name="latest",
+ name="0.16.51-1",
base="@prodimage-bionic//image",
- tars = ["@factorio-headless//file"],
- files = [":entrypoint.sh"],
- directory = "/",
- entrypoint = ["/entrypoint.sh"],
+ 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"],
)
# Totally broken right now because google/containerregistry doesn't handle
@@ -21,13 +30,14 @@
#)
# 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)
- """,
+ name = "push_latest",
+ srcs = [":0.17.41-1"],
+ outs = ["version.sh"],
+ executable = True,
+ cmd = """
+ tag=0.17.41-1
+ docker tag bazel/app/factorio:$$tag registry.k0.hswaw.net/app/factorio:$$tag
+ docker push registry.k0.hswaw.net/app/factorio:$$tag
+ echo -ne "#!/bin/sh\necho Pushed $$tag.\n" > $(OUTS)
+ """,
)