Fetch stable version of HAOS on build (#17484)

This commit is contained in:
Joakim Sørensen 2021-04-16 15:12:58 +02:00 committed by GitHub
parent 105ba64461
commit f127d1c7e1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 24 additions and 9 deletions

1
.gitignore vendored
View File

@ -6,6 +6,7 @@
public public
source/_data/analytics_data.json source/_data/analytics_data.json
source/_data/blueprint_exchange_data.json source/_data/blueprint_exchange_data.json
source/_data/version_data.json
source/_stash source/_stash
source/stylesheets/screen.css source/stylesheets/screen.css
source/.jekyll-cache/ source/.jekyll-cache/

View File

@ -33,6 +33,8 @@ task :generate do
abort("Generating CSS failed") unless success abort("Generating CSS failed") unless success
success = system "rake analytics_data" success = system "rake analytics_data"
abort("Generating analytics data failed") unless success abort("Generating analytics data failed") unless success
success = system "rake version_data"
abort("Generating version data failed") unless success
success = system "rake blueprint_exchange_data" success = system "rake blueprint_exchange_data"
abort("Generating blueprint exchange data failed") unless success abort("Generating blueprint exchange data failed") unless success
success = system "jekyll build" success = system "jekyll build"
@ -71,6 +73,7 @@ task :preview, :listen do |t, args|
puts "Now listening on http://localhost:#{server_port}" puts "Now listening on http://localhost:#{server_port}"
system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css") system "compass compile --css-dir #{source_dir}/stylesheets" unless File.exist?("#{source_dir}/stylesheets/screen.css")
system "rake analytics_data" system "rake analytics_data"
system "rake version_data"
system "rake blueprint_exchange_data" system "rake blueprint_exchange_data"
jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build -t --watch --incremental") jekyllPid = Process.spawn({"OCTOPRESS_ENV"=>"preview"}, "jekyll build -t --watch --incremental")
compassPid = Process.spawn("compass watch") compassPid = Process.spawn("compass watch")
@ -189,6 +192,17 @@ task :analytics_data do
end end
end end
desc "Download version data from version.home-assistant.io"
task :version_data do
uri = URI('https://version.home-assistant.io/stable.json')
remote_data = JSON.parse(Net::HTTP.get(uri))
File.open("#{source_dir}/_data/version_data.json", "w") do |file|
file.write(JSON.generate(remote_data))
end
end
desc "Download data from the blueprint exchange @ community.home-assistant.io" desc "Download data from the blueprint exchange @ community.home-assistant.io"
task :blueprint_exchange_data do task :blueprint_exchange_data do
uri = URI('https://community.home-assistant.io/c/blueprints-exchange/53/l/top/all.json') uri = URI('https://community.home-assistant.io/c/blueprints-exchange/53/l/top/all.json')

View File

@ -177,7 +177,6 @@ toc:
# Configuration for installation pages # Configuration for installation pages
installation: installation:
versions: versions:
os: "5.13"
python: "3.8" python: "3.8"
types: types:
odroid: odroid:

View File

@ -34,7 +34,7 @@ We will need a few things to get started with installing Home Assistant. Links b
content: | content: |
```text ```text
{{release_url}}/{{site.installation.versions.os}}/hassos_{{ variant.key }}-{{site.installation.versions.os}}.img.xz {{release_url}}/{{site.data.version_data.hassos[variant.key]}}/hassos_{{ variant.key }}-{{site.data.version_data.hassos[variant.key]}}.img.xz
``` ```
{% if variant.key == "odroid-n2" %} {% if variant.key == "odroid-n2" %}
@ -48,7 +48,8 @@ We will need a few things to get started with installing Home Assistant. Links b
{% else %} {% else %}
```text ```text
{{release_url}}/{{site.installation.versions.os}}/hassos_{{ site.installation.types[page.installation_type].variants[0].key }}-{{site.installation.versions.os}}.img.xz {% assign board_key = site.installation.types[page.installation_type].variants[0].key %}
{{release_url}}/{{site.data.version_data.hassos[board_key]}}/hassos_{{ board_key }}-{{site.data.version_data.hassos[board_key]}}.img.xz
``` ```
{% endif %} {% endif %}
@ -187,9 +188,9 @@ With the Home Assistant Operating System installed and accessible you can contin
{% include getting-started/next_step.html step="Onboarding" link="/getting-started/onboarding/" %} {% include getting-started/next_step.html step="Onboarding" link="/getting-started/onboarding/" %}
[intel-nuc]: {{release_url}}/{{site.installation.versions.os}}/hassos_intel-nuc-{{site.installation.versions.os}}.img.xz [intel-nuc]: {{release_url}}/{{site.data.version_data.hassos['ova']}}/hassos_intel-nuc-{{site.data.version_data.hassos['ova']}}.img.xz
[vmdk]: {{release_url}}/{{site.installation.versions.os}}/hassos_ova-{{site.installation.versions.os}}.vmdk.xz [vmdk]: {{release_url}}/{{site.data.version_data.hassos['ova']}}/hassos_ova-{{site.data.version_data.hassos['ova']}}.vmdk.xz
[vhdx]: {{release_url}}/{{site.installation.versions.os}}/hassos_ova-{{site.installation.versions.os}}.vhdx.xz [vhdx]: {{release_url}}/{{site.data.version_data.hassos['ova']}}/hassos_ova-{{site.data.version_data.hassos['ova']}}.vhdx.xz
[vdi]: {{release_url}}/{{site.installation.versions.os}}/hassos_ova-{{site.installation.versions.os}}.vdi.xz [vdi]: {{release_url}}/{{site.data.version_data.hassos['ova']}}/hassos_ova-{{site.data.version_data.hassos['ova']}}.vdi.xz
[qcow2]: {{release_url}}/{{site.installation.versions.os}}/hassos_ova-{{site.installation.versions.os}}.qcow2.xz [qcow2]: {{release_url}}/{{site.data.version_data.hassos['ova']}}/hassos_ova-{{site.data.version_data.hassos['ova']}}.qcow2.xz
[Virtual Appliance]: {{release_url}}/{{site.installation.versions.os}}/hassos_ova-{{site.installation.versions.os}}.ova [Virtual Appliance]: {{release_url}}/{{site.data.version_data.hassos['ova']}}/hassos_ova-{{site.data.version_data.hassos['ova']}}.ova