From 34de8f16bb721385b06ad1a23f0d5233d3ab95bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20Barr=C3=A8re?= Date: Fri, 9 Apr 2021 16:50:42 +0200 Subject: [PATCH] Add a Ruby task to easily generate our image name --- Rakefile | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Rakefile diff --git a/Rakefile b/Rakefile new file mode 100644 index 0000000..6265732 --- /dev/null +++ b/Rakefile @@ -0,0 +1,6 @@ +task :get_image_version do + version = IO.read("transport-site/Dockerfile")[/FROM (hexpm\/elixir.*)/, 1] + version = version.gsub('hexpm/elixir:','elixir-') + fail "Unexpected FROM format, script must be verified" unless version =~ /\Aelixir\-[^\-]+\-erlang\-[^\-]+\-alpine\-[^\-]+\z/ + puts version +end