Skip to content

Commit

Permalink
Merge pull request #10626 from Katharine/stamp-deck
Browse files Browse the repository at this point in the history
Show the running test-infra commit on the deck UI
  • Loading branch information
k8s-ci-robot committed Jan 7, 2019
2 parents e18e702 + 59de482 commit 31e68b0
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 0 deletions.
2 changes: 2 additions & 0 deletions prow/cmd/deck/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ go_library(
importpath = "k8s.io/test-infra/prow/cmd/deck",
deps = [
"//prow/apis/prowjobs/v1:go_default_library",
"//prow/cmd/deck/version:go_default_library",
"//prow/config:go_default_library",
"//prow/deck/jobs:go_default_library",
"//prow/gcsupload:go_default_library",
Expand Down Expand Up @@ -128,6 +129,7 @@ filegroup(
srcs = [
":package-srcs",
"//prow/cmd/deck/static:all-srcs",
"//prow/cmd/deck/version:all-srcs",
],
tags = ["automanaged"],
)
9 changes: 9 additions & 0 deletions prow/cmd/deck/static/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ body {
font-size: 16px !important;
}

.mdl-layout__drawer footer {
text-align: center;
color: darkgray;
position: absolute;
bottom: 10px;
width: 100%;
font-size: small;
}

code {
background-color: #EEEEEE;
border-radius: 3px;
Expand Down
3 changes: 3 additions & 0 deletions prow/cmd/deck/template/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
<a class="mdl-navigation__link{{if eq .PageName "plugins"}} mdl-navigation__link--current{{end}}" href="/plugins">Plugins</a>
<a class="mdl-navigation__link" href="https://github.com/kubernetes/test-infra/blob/master/prow/README.md">Documentation</a>
</nav>
<footer>
{{deckVersion}}
</footer>
</div>
<div id="loading-progress" class="mdl-progress mdl-js-progress mdl-progress__indeterminate hidden"></div>
<main class="mdl-layout__content">
Expand Down
2 changes: 2 additions & 0 deletions prow/cmd/deck/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package main
import (
"github.com/sirupsen/logrus"
"html/template"
"k8s.io/test-infra/prow/cmd/deck/version"
"k8s.io/test-infra/prow/config"
"k8s.io/test-infra/prow/deck/jobs"
"net/http"
Expand Down Expand Up @@ -66,6 +67,7 @@ func prepareBaseTemplate(o options, ca jobs.ConfigAgent, t *template.Template) (
"sections": getConcreteSectionFunction(o),
"mobileFriendly": func() bool { return true },
"mobileUnfriendly": func() bool { return false },
"deckVersion": func() string { return version.Version },
}).ParseFiles(path.Join(o.templateFilesLocation, "base.html"))
}

Expand Down
25 changes: 25 additions & 0 deletions prow/cmd/deck/version/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
load("@io_bazel_rules_go//go:def.bzl", "go_library")

go_library(
name = "go_default_library",
srcs = ["version.go"],
importpath = "k8s.io/test-infra/prow/cmd/deck/version",
visibility = ["//visibility:public"],
x_defs = {
"Version": "{STABLE_BUILD_GIT_COMMIT}",
},
)

filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)

filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)
20 changes: 20 additions & 0 deletions prow/cmd/deck/version/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package version

// This is filled in by bazel at link time. If bazel is not used, it will be empty.
var Version string

0 comments on commit 31e68b0

Please sign in to comment.