1
0
Fork 0

app/factorio: multiple versions

master
q3k 2019-05-19 03:09:47 +02:00
parent 44116eae1e
commit 644f9ff57e
2 changed files with 32 additions and 15 deletions

View File

@ -71,11 +71,18 @@ container_pull(
# 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

View File

@ -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 @@ container_image(
#)
# 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)
""",
)