From 1f0e2ccbdda42abdb768fa3ddb3f5967312de158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Greg=20Kar=C3=A9kinian?= Date: Thu, 21 May 2020 11:51:06 +0200 Subject: [PATCH] Move the binary URL to an attribute --- site-cookbooks/kosmos_gitea/attributes/default.rb | 4 +++- site-cookbooks/kosmos_gitea/recipes/default.rb | 3 +-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/site-cookbooks/kosmos_gitea/attributes/default.rb b/site-cookbooks/kosmos_gitea/attributes/default.rb index 2010650..09bfaf8 100644 --- a/site-cookbooks/kosmos_gitea/attributes/default.rb +++ b/site-cookbooks/kosmos_gitea/attributes/default.rb @@ -1,3 +1,5 @@ -node.default["kosmos_gitea"]["version"] = "1.11.5" +gitea_version = "1.11.5" +node.default["kosmos_gitea"]["version"] = gitea_version +node.default["kosmos_gitea"]["binary_url"] = "https://dl.gitea.io/gitea/#{gitea_version}/gitea-#{gitea_version}-linux-amd64" node.default["kosmos_gitea"]["binary_checksum"] = "d8d43c13e71596c79b541e85e29defe065b4f70ac5155e6d0212bcfc669e1b9c" node.default["kosmos_gitea"]["nginx"]["domain"] = "gitea.kosmos.org" diff --git a/site-cookbooks/kosmos_gitea/recipes/default.rb b/site-cookbooks/kosmos_gitea/recipes/default.rb index 1dd63e8..5f02f09 100644 --- a/site-cookbooks/kosmos_gitea/recipes/default.rb +++ b/site-cookbooks/kosmos_gitea/recipes/default.rb @@ -32,7 +32,6 @@ working_directory = "/var/lib/gitea" git_home_directory = "/home/git" config_directory = "/etc/gitea" gitea_binary_path = "/usr/local/bin/gitea" -gitea_version = node['kosmos_gitea']['version'] gitea_data_bag_item = data_bag_item("credentials", "gitea") smtp_credentials = data_bag_item("credentials", "smtp") jwt_secret = gitea_data_bag_item["jwt_secret"] @@ -107,7 +106,7 @@ template "#{config_directory}/app.ini" do end remote_file gitea_binary_path do - source "https://dl.gitea.io/gitea/#{gitea_version}/gitea-#{gitea_version}-linux-amd64" + source node['kosmos_gitea']['binary_url'] checksum node['kosmos_gitea']['binary_checksum'] mode "0755" end