-
Notifications
You must be signed in to change notification settings - Fork 11.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Move
verify-storybook
command from grabpl (#59928)
* Move verify-storybook from grabpl * Remove zerolog
- Loading branch information
1 parent
440d8a3
commit 0801fce
Showing
4 changed files
with
44 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Package verifystorybook contains the sub-command "verify-storybook". | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"log" | ||
"path/filepath" | ||
|
||
"github.com/grafana/grafana/pkg/infra/fs" | ||
"github.com/urfave/cli/v2" | ||
) | ||
|
||
// VerifyStorybook Action implements the sub-command "verify-storybook". | ||
func VerifyStorybook(c *cli.Context) error { | ||
const grafanaDir = "." | ||
|
||
paths := []string{ | ||
"packages/grafana-ui/dist/storybook/index.html", | ||
"packages/grafana-ui/dist/storybook/iframe.html"} | ||
for _, p := range paths { | ||
exists, err := fs.Exists(filepath.Join(grafanaDir, p)) | ||
if err != nil { | ||
return cli.NewExitError(fmt.Sprintf("failed to verify Storybook build: %s", err), 1) | ||
} | ||
if !exists { | ||
return fmt.Errorf("failed to verify Storybook build, missing %q", p) | ||
} | ||
} | ||
|
||
log.Printf("Successfully verified Storybook integrity") | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters