Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Github API from generating hab release notes #3769

Merged
merged 3 commits into from
Mar 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
# so we have to override the default shell here
SHELL=bash

assets:
pushd themes/docs-new && make assets && popd
bundle:
pushd themes/docs-new && make bundle && popd

clean_all:
pushd themes/docs-new && make clean_all && popd
rm -rf resources/
rm -rf public/
hugo mod clean

serve: assets
serve: bundle
hugo server --buildDrafts --noHTTPCache --buildFuture

production: assets
production: bundle
hugo server --buildDrafts --noHTTPCache --buildFuture --environment production

serve_ignore_vendor: assets
serve_ignore_vendor: bundle
hugo server --buildDrafts --noHTTPCache --buildFuture --ignoreVendorPaths github.com/**

lint: assets
lint: bundle
hugo -D


Expand Down
32 changes: 32 additions & 0 deletions assets/release-notes/habitat/release-versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[
"1.6.420",
"1.6.416",
"1.6.415",
"1.6.400",
"1.6.351",
"1.6.319",
"1.6.288",
"1.6.267",
"1.6.235",
"1.6.216",
"1.6.181",
"1.6.175",
"1.6.139",
"1.6.115",
"1.6.56",
"1.6.39",
"1.6.0",
"1.5.86",
"1.5.71",
"1.5.50",
"1.5.29",
"1.5.0",
"0.90.6",
"0.88.0",
"0.85.0",
"0.83.0",
"0.82.0",
"0.81.0",
"0.80.0",
"0.79.1"
]
16 changes: 16 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
github.com/chef/automate/components/docs-chef-io v0.0.0-20220310100506-f4b4aa2db398 h1:lgc4IAeRVoQvIK1s4VAYMm3z+TBe+/vdsqv0kJzD1VY=
github.com/chef/automate/components/docs-chef-io v0.0.0-20220310100506-f4b4aa2db398/go.mod h1:juvLC7Rt33YOCgJ5nnfl4rWZRAbSwqjTbWmcAoA0LtU=
github.com/chef/chef-server/docs-chef-io v0.0.0-20220303162748-5640b2de7236 h1:XQk3NNEf2lHYPLhByoHXO6Jg9gjV70MW8CKAWMlCXwQ=
github.com/chef/chef-server/docs-chef-io v0.0.0-20220303162748-5640b2de7236/go.mod h1:gMSa25GUHmLimA0gjvRd3hs1buOBqkKPrdHzHvaJauY=
github.com/chef/chef-workstation/docs-chef-io v0.0.0-20220224061011-84c0b824afd4 h1:kbNjKsaI0oqqmC8RQIEjE+2UJ4Hhvmjg1P69lZkyKz0=
github.com/chef/chef-workstation/docs-chef-io v0.0.0-20220224061011-84c0b824afd4/go.mod h1:gvoh6ov1YU98CVzBEWzEZeCLTRunfQ6r1VO7M3LFE9U=
github.com/chef/desktop-config/docs-chef-io v0.0.0-20211006114000-6bf6119bfc8a h1:YJMehQcDZDeu4z1x+fV5iGq1Sf24gP53+hqHIRLDmfQ=
github.com/chef/desktop-config/docs-chef-io v0.0.0-20211006114000-6bf6119bfc8a/go.mod h1:90xAx6sIfgSL50M2KzeBmx7V7s7dlhQU3xpUkJO0qW0=
github.com/chef/effortless/docs-chef-io v0.0.0-20211119164252-4ff3d53886be h1:QeeHFnUaNVQmTlxX3MT06Dgz8omORr5ZATVH7yLc96A=
github.com/chef/effortless/docs-chef-io v0.0.0-20211119164252-4ff3d53886be/go.mod h1:Lfq+HjwAQwUJ41EPTO/8qbI1oJb2i415fR28d2Ig9kc=
github.com/chef/supermarket/docs-chef-io v0.0.0-20220303181518-342cf6e77367 h1:LpdEaZp4hdAsBuF3B4DeToAOw5PaQEF1c1oafjPzKqY=
github.com/chef/supermarket/docs-chef-io v0.0.0-20220303181518-342cf6e77367/go.mod h1:L0DhIJHTKsPYhAr9TrhAIg3KXtrS9BJF0XNHfGDDGGg=
github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
github.com/cowboy/jquery-hashchange v0.0.0-20100902193700-0310f3847f90 h1:p/a5iSATj0OjrqJLX/YKxYdGXhZzW58yyyNIC4JY4S0=
github.com/cowboy/jquery-hashchange v0.0.0-20100902193700-0310f3847f90/go.mod h1:N/6F0+wmdvL6k0AjqyKIncMRClKAN92atjZdTLtYMaw=
github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
Expand All @@ -26,15 +33,24 @@ github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMyw
github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/habitat-sh/habitat/components/docs-chef-io v0.0.0-20220223204905-ee157196b538 h1:ju+BMva5hAc68Dcp3jgR578hlnzLil1PP6r47iO5QMk=
github.com/habitat-sh/habitat/components/docs-chef-io v0.0.0-20220223204905-ee157196b538/go.mod h1:luAy42opPrAM/T6hsqDyW3CNBaAMgy+a6l0+oi8sw8U=
github.com/inspec/inspec-alicloud/docs-chef-io v0.0.0-20220218210517-5887448b615c h1:M+QfQccL/pUxFdxiAyNa34kXghYe4S0KGUb7ZXLBaW8=
github.com/inspec/inspec-alicloud/docs-chef-io v0.0.0-20220218210517-5887448b615c/go.mod h1:tAazDDBtR5yCl/FNWHnrmkxpfxnOo9B99DyfRE7JH1c=
github.com/inspec/inspec-aws/docs-chef-io v0.0.0-20220228151600-69aa036b1527 h1:uUaij/nZVKcjxg6wiyKdHZjUESGAXrnUPyFL8+YhfaU=
github.com/inspec/inspec-aws/docs-chef-io v0.0.0-20220228151600-69aa036b1527/go.mod h1:5rfIsi1/SqSiAXqU94UOcfMnebnuaEmFriU8k8t1Kes=
github.com/inspec/inspec-azure/docs-chef-io v0.0.0-20220228040450-e1b23e65979a h1:YCnnf7CjKnzRm4YbTVl4NDc8moJb4c80nUHy6XOG0p8=
github.com/inspec/inspec-azure/docs-chef-io v0.0.0-20220228040450-e1b23e65979a/go.mod h1:93+uw8FTBAWybBZIn45FzO5vnZDBh51lgMwMP1vvIqo=
github.com/inspec/inspec-habitat/docs-chef-io v0.0.0-20220218210405-bfd542da49fd h1:DyqDEbj+OfJEvigVO37AsEaZMqC71rLgfb7aGR2jEEI=
github.com/inspec/inspec-habitat/docs-chef-io v0.0.0-20220218210405-bfd542da49fd/go.mod h1:Q4E7QBY4b7HDE2psfGT9jqvnLq1yfg5e9KWK4VTtI/M=
github.com/inspec/inspec/docs-chef-io v0.0.0-20220228020638-0383e819eb35 h1:R5zgq/+H/2zhBpLmsGzYgV5fQT0XDL2qmMuEIe+3QDQ=
github.com/inspec/inspec/docs-chef-io v0.0.0-20220228020638-0383e819eb35/go.mod h1:oudFvipU0DTMkp8+MiwdUGerVEoWcJG0MQciDEOd6G8=
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
github.com/swiftype/swiftype-autocomplete-jquery v0.0.0-20190222215504-a90008d64b30 h1:dhqLFBINtD1rMwwd5s9INu4BkciCvQUd+r+CWUYWIB4=
github.com/swiftype/swiftype-autocomplete-jquery v0.0.0-20190222215504-a90008d64b30/go.mod h1:qnxTyatkwE84LvoaQLPaLB4h5M3n6Q2z+SB/96DcAK8=
github.com/swiftype/swiftype-search-jquery v1.1.0 h1:VRYyWPQtf3Vl3B5W2xQJuFVoUBlBFGQ4tOTu94b8mNU=
github.com/swiftype/swiftype-search-jquery v1.1.0/go.mod h1:ozrXd90Gb0yopbWx+Iw4poOxjLe2lBFcKHDfIHrFHmA=
github.com/twitter/hogan.js v3.0.2+incompatible h1:DdinnfJ/9Wbro2tdeHV6PJJgknxqCbjdJxDQYxiqGmk=
github.com/twitter/hogan.js v3.0.2+incompatible/go.mod h1:x3aKPTRsKTy23Q9NizAq8BBZstS4fy72LcbAL13ps9A=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
Expand Down
6 changes: 3 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
skip_processing = true

[context.production]
command = "make assets; hugo --gc --minify --enableGitInfo"
command = "make bundle; hugo --gc --minify --enableGitInfo"
[context.production.environment]
HUGO_ENV = "production"

[context.deploy-preview]
command = "make assets; hugo --gc --minify --enableGitInfo --buildFuture"
command = "make bundle; hugo --gc --minify --enableGitInfo --buildFuture"

[context.branch-deploy]
command = "make assets; hugo --gc --minify --enableGitInfo"
command = "make bundle; hugo --gc --minify --enableGitInfo"
[context.branch-deploy.environment]
HUGO_ENV = "production"

Expand Down
6 changes: 1 addition & 5 deletions themes/docs-new/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
assets: node_modules
bundle: node_modules

clean_all: clean_node_modules

clean_node_modules:
rm -rf node_modules

#
# Assets
#

node_modules:
npm install
6 changes: 1 addition & 5 deletions themes/docs-new/layouts/_default/release_notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{{ if eq $product "automate" }}
{{ $versionsUrl = "https://packages.chef.io/releases/current/automate.json"}}
{{ else if (eq $product "habitat") }}
{{ $versionsUrl = "https://api.github.com/repos/habitat-sh/habitat/releases" }}
{{ $versionsUrl = "assets/release-notes/habitat/release-versions.json" }}
{{ else if (hasPrefix $product "inspec-") }}
{{ $versionsUrl = print "_vendor/github.com/inspec/" $product "/docs-chef-io/assets/release-notes/" $product "/release-dates.json" }}
{{ else }}
Expand All @@ -41,8 +41,6 @@

{{ if eq $product "automate" }}
{{ $version = index . "version" }}
{{ else if eq $product "habitat" }}
{{ $version = index . "tag_name" }}
{{ else }}
{{ $version = . }}
{{ end }}
Expand Down Expand Up @@ -83,8 +81,6 @@ <h2 id="{{ $version }}">{{ $fullName }} {{ $version }}</h2>

{{ if eq $product "automate"}}
<p><i>Released on {{ time.Format "January 2, 2006" .release_date }}</i></p>
{{ else if (eq $product "habitat")}}
<p><i>Released on {{ time.Format "January 2, 2006" .published_at }}</i></p>
{{ end }}

{{ $remoteResponse := resources.GetRemote $mdUrl (dict "headers" (dict "Cache-Control" "no-cache" "Connection" "keep-alive")) }}
Expand Down
8 changes: 1 addition & 7 deletions themes/docs-new/layouts/partials/release_notes_toc.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
{{ if eq $product "automate" }}
{{ $versionsUrl = "https://packages.chef.io/releases/current/automate.json"}}
{{ else if (eq $product "habitat") }}
{{ $versionsUrl = "https://api.github.com/repos/habitat-sh/habitat/releases" }}
{{ $versionsUrl = "assets/release-notes/habitat/release-versions.json" }}
{{ else if (hasPrefix $product "inspec-") }}
{{ $versionsUrl = print "_vendor/github.com/inspec/" $product "/docs-chef-io/assets/release-notes/" $product "/release-dates.json" }}
{{ else }}
Expand Down Expand Up @@ -50,12 +50,6 @@
{{ $lastDate = $releaseYearMonth }}
{{ end }}
</ul>
{{ else if eq $product "habitat" }}
<ul>
{{ range $version := $versionsCorrectOrder }}
<li><a href="#{{ $version.tag_name }}">{{ $version.tag_name }}</a></li>
{{ end }}
</ul>

{{ else }}
<ul>
Expand Down