Skip to content

Commit

Permalink
FTR-96: Add sets & use templates for all wiki pages (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
CDA0 authored Nov 13, 2023
1 parent 92e03d4 commit 9e5637e
Show file tree
Hide file tree
Showing 12 changed files with 222 additions and 70 deletions.
6 changes: 2 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
module github.com/frontierdigital/ranger

go 1.20
go 1.21

require (
github.com/frontierdigital/utils v0.0.8
github.com/frontierdigital/utils v0.0.8-1
github.com/google/uuid v1.1.2
github.com/libgit2/git2go/v34 v34.0.0
github.com/otiai10/copy v1.9.0
github.com/segmentio/ksuid v1.0.4
github.com/spf13/cobra v1.6.1
Expand All @@ -32,7 +31,6 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.1 // indirect
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect
golang.org/x/exp v0.0.0-20230206171751-46f607a40771 // indirect
golang.org/x/sys v0.3.0 // indirect
golang.org/x/text v0.4.0 // indirect
Expand Down
21 changes: 8 additions & 13 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
github.com/frontierdigital/utils v0.0.8 h1:zIvqu8KLX8yfzEu0qEaAO9+/cu7Da5p0zZdhcG21Ze4=
github.com/frontierdigital/utils v0.0.8/go.mod h1:iz+lbB9iGA9ZsVbber/tPosKC9HFTgKTDP8/UC6XxBY=
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
github.com/frontierdigital/utils v0.0.8-1 h1:J4cYMjEWq/XMewPfSBDtGb7+DUnpj/gKvjd/yts0AtQ=
github.com/frontierdigital/utils v0.0.8-1/go.mod h1:iz+lbB9iGA9ZsVbber/tPosKC9HFTgKTDP8/UC6XxBY=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
Expand Down Expand Up @@ -130,6 +131,7 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
Expand All @@ -144,8 +146,6 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe
github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 h1:El6M4kTTCOh6aBiKaUGG7oYTSPP8MxqL4YI3kZKwcP4=
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
Expand Down Expand Up @@ -177,11 +177,11 @@ github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFB
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
github.com/kr/pretty v0.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/libgit2/git2go/v34 v34.0.0 h1:UKoUaKLmiCRbOCD3PtUi2hD6hESSXzME/9OUZrGcgu8=
github.com/libgit2/git2go/v34 v34.0.0/go.mod h1:blVco2jDAw6YTXkErMMqzHLcAjKkwF0aWIRHBqiJkZ0=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ=
github.com/magiconair/properties v1.8.6 h1:5ibWZ6iY0NctNGWo87LalDlEZ6R41TqbbDamhfG/Qzo=
github.com/magiconair/properties v1.8.6/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60=
Expand Down Expand Up @@ -230,6 +230,7 @@ github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40T
github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg=
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g=
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/segmentio/ksuid v1.0.4 h1:sBo2BdShXjmcugAMwjugoGUdUV0pcxY5mW4xKRn3v4c=
Expand Down Expand Up @@ -266,6 +267,7 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/subosito/gotenv v1.4.1 h1:jyEFiXpy21Wm81FBN71l9VoMMV8H8jG+qIK3GCpY6Qs=
github.com/subosito/gotenv v1.4.1/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
Expand Down Expand Up @@ -297,11 +299,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201203163018-be400aefbc4c/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I=
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM=
golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
Expand Down Expand Up @@ -405,7 +404,6 @@ golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190812172437-4e8604ab3aff/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -426,7 +424,6 @@ golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201204225414-ed752295db88/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand All @@ -438,8 +435,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ=
golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
Expand Down
126 changes: 75 additions & 51 deletions pkg/cmd/app/generate/docs.go
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
package generate

import (
_ "embed"
"embed"
"errors"
"fmt"
"io/fs"
"os"
"path"
"path/filepath"
"slices"
"strings"
"text/template"

"github.com/frontierdigital/ranger/pkg/core"
rfile "github.com/frontierdigital/ranger/pkg/util/file"
rtime "github.com/frontierdigital/ranger/pkg/util/time"
igit "github.com/frontierdigital/utils/git"
git "github.com/frontierdigital/utils/git/external_git"
"github.com/frontierdigital/utils/output"
)

//go:embed tpl/workload.tpl
var workloadTemplate string
//go:embed tpl/*
var wikiTemplates embed.FS

type Workload struct {
Name string
Expand Down Expand Up @@ -70,56 +73,75 @@ func publish(ado *core.AzureDevOps, repoName string, repo interface{ igit.Git })
if err != nil {
return err
}
} else {
output.PrintlnfInfo("No changes for wiki")
}

return nil
}

func createWorkLoadPages(workloads *[]core.Workload, localPath string) error {
orderPath := filepath.Join(localPath, "workloads", ".order")

err := rfile.Clear(orderPath)
if err != nil {
return errors.New("could not reset order file")
}

for _, w := range *workloads {
fullPath := filepath.Join(localPath, "workloads", fmt.Sprintf("%s.md", w.Name))

err := rfile.CreateOrUpdate(fullPath, w.Readme, false)
if err != nil {
return errors.New("could not create or update page")
}

err = rfile.CreateOrUpdate(orderPath, fmt.Sprintln(w.Name), true)
if err != nil {
return errors.New("could not create or update orderfile")
}
}

return nil
type WikiContent struct {
Sets []core.SetCollection
Workloads []core.Workload
}

func createWorkloadIndex(workloads *[]core.Workload, localPath string) error {
wl := core.WorkloadIndex{
Workloads: *workloads,
}
tmpl, err := template.New("workloadTemplate").Parse(workloadTemplate)
func processTemplateFile(src string, tgt string, localPath string, wikiContent interface{}) error {
tmpl, err := template.New(path.Base(src)).ParseFS(wikiTemplates, src)
if err != nil {
return err
}

file, err := os.Create(filepath.Join(localPath, "workloads.md"))
var f *os.File
err = os.MkdirAll(filepath.Dir(filepath.Join(localPath, tgt)), 0700)
if err != nil {
return err
panic(err)
}
f, err = os.Create(filepath.Join(localPath, tgt))
if err != nil {
panic(err)
}
defer file.Close()
defer f.Close()

err = tmpl.Execute(file, wl)
err = tmpl.Execute(f, wikiContent)
if err != nil {
return err
panic(err)
}
return nil
}

func writeWiki(wikiContent *WikiContent, localPath string) error {
loopDirs := []string{"tpl/sets", "tpl/workloads"}
fs.WalkDir(wikiTemplates, "tpl", func(src string, d fs.DirEntry, err error) error {
if slices.Contains(loopDirs, filepath.Dir(src)) {
if strings.Contains(src, "workloads") {
for _, w := range wikiContent.Workloads {
tgt := "workloads/" + w.Name + ".md"
terr := processTemplateFile(src, tgt, localPath, &w)
if terr != nil {
return nil
}
}
}
if strings.Contains(src, "sets") {
for _, s := range wikiContent.Sets {
tgt := "sets/" + s.Name + ".md"
terr := processTemplateFile(src, tgt, localPath, &s)
if terr != nil {
return nil
}
}
}
}

if !d.IsDir() && !slices.Contains(loopDirs, filepath.Dir(src)) {
tgt := strings.Replace(src, "tpl"+string(os.PathSeparator), "", 1)
tgt = strings.ReplaceAll(tgt, ".tpl", "")
terr := processTemplateFile(src, tgt, localPath, wikiContent)
if terr != nil {
return terr
}
}
return nil
})
return nil
}

Expand All @@ -130,42 +152,44 @@ func GenerateDocs(config *core.Config, projectName string, organisationName stri
PAT: config.ADO.PAT,
WorkloadFeedName: feedName,
}

err := ado.CreateWikiIfNotExists(wikiName, config.Git.UserName, config.Git.UserEmail)
sets, err := ado.GetSets()
if err != nil {
return err
}
output.PrintlnfInfo("Fetched set info from project '%s/%s'", organisationName, projectName)

output.PrintlnfInfo("Created wiki '%s' (%s)", wikiName, ado.WikiRemoteUrl)

wikiRepo, err := git.NewClonedGit(ado.WikiRepoRemoteUrl, "x-oauth-basic", config.ADO.PAT, config.Git.UserEmail, config.Git.UserName)
workloads, err := ado.GetWorkloadInfo()
if err != nil {
return err
}
defer os.RemoveAll(wikiRepo.GetRepositoryPath())
output.PrintlnfInfo("Fetched workload info from feed '%s' (https://dev.azure.com/%s/%s/_artifacts/feed/%s)", feedName, organisationName, projectName, feedName)

workloads, err := ado.GetWorkloadInfo()
wc := WikiContent{
Workloads: *workloads,
Sets: *sets,
}

err = ado.CreateWikiIfNotExists(wikiName, config.Git.UserName, config.Git.UserEmail)
if err != nil {
return err
}

output.PrintlnfInfo("Fetched workload info from feed '%s' (https://dev.azure.com/%s/%s/_artifacts/feed/%s)", feedName, organisationName, projectName, feedName)
output.PrintlnfInfo("Created wiki '%s' (%s)", wikiName, ado.WikiRemoteUrl)

err = createWorkLoadPages(workloads, wikiRepo.GetRepositoryPath())
wikiRepo, err := git.NewClonedGit(ado.WikiRepoRemoteUrl, "x-oauth-basic", config.ADO.PAT, config.Git.UserEmail, config.Git.UserName)
if err != nil {
return err
}
defer os.RemoveAll(wikiRepo.GetRepositoryPath())

err = createWorkloadIndex(workloads, wikiRepo.GetRepositoryPath())
err = writeWiki(&wc, wikiRepo.GetRepositoryPath())
if err != nil {
return err
}

output.PrintlnInfo("Generated workload index and pages")

err = publish(ado, wikiName, wikiRepo)
if err != nil {
return errors.New("could not create or automerge PR")
return errors.New("could not create or automerge pr")
}

output.PrintlnfInfo("Published Wiki '%s' (%s)", wikiName, ado.WikiRemoteUrl)
Expand Down
10 changes: 10 additions & 0 deletions pkg/cmd/app/generate/tpl/sets.md.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Sets

## Sets available in this project

| Name | Instances | Latest version | Latest build |
|:-----------|:-----------|:-----------|:-----------|
{{- range .Sets }}
| {{ .Name }} | 0 | 0 | 0 |
{{- end }}

2 changes: 2 additions & 0 deletions pkg/cmd/app/generate/tpl/sets/set.md.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# {{ .Name }}

File renamed without changes.
3 changes: 3 additions & 0 deletions pkg/cmd/app/generate/tpl/workloads/.order.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- range .Workloads }}
{{ .Name }}
{{- end }}
3 changes: 3 additions & 0 deletions pkg/cmd/app/generate/tpl/workloads/workload.md.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# {{ .Name }}

{{ .Readme }}
Loading

0 comments on commit 9e5637e

Please sign in to comment.