Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
H
head.hackage
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
5
Merge Requests
5
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Glasgow Haskell Compiler
head.hackage
Commits
c3b4e4ba
Commit
c3b4e4ba
authored
Jul 07, 2019
by
Ben Gamari
🐢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve summary formatting
parent
b498cc6a
Pipeline
#8073
passed with stages
in 36 minutes and 12 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
6 deletions
+69
-6
.gitlab-ci.yml
.gitlab-ci.yml
+7
-2
scripts/build-repo.sh
scripts/build-repo.sh
+49
-3
scripts/render-graph.sh
scripts/render-graph.sh
+8
-0
scripts/summarize.py
scripts/summarize.py
+5
-1
No files found.
.gitlab-ci.yml
View file @
c3b4e4ba
...
...
@@ -81,8 +81,7 @@ build:
after_script
:
-
nix run -f '<nixpkgs>' gnutar -c tar -zcf logs.tar.gz logs
# The following throws a fontconfig error but it appears to be innocuous.
-
nix run -f '<nixpkgs>' graphviz -c dot -O -T svg summary.dot
-
nix run -f '<nixpkgs>' graphviz -c scripts/render-graph.sh summary.dot > summary.dot.svg
-
ls -lh
artifacts
:
...
...
@@ -116,6 +115,12 @@ update-repo:
-
nix-channel --update
-
nix build -f scripts/build-repo.nix
-
nix run -f scripts/build-repo.nix -c build-repo.sh build-repo
-
nix run -f '<nixpkgs>' gnutar -c tar -zxf logs.tar.gz
-
mv logs repo
-
cp summary.dot.svg repo
dependencies
:
-
build
after_script
:
-
rm -Rf keys
...
...
scripts/build-repo.sh
View file @
c3b4e4ba
...
...
@@ -37,10 +37,12 @@ extract_keys_tarball() {
fi
}
build_index
_html
()
{
build_index
()
{
local
keys
=
"
$(
find keys/root
-type
f
-printf
"%f"
)
"
local
commit
=
"
$CI_COMMIT_SHA
"
local
commit_url
=
"https://gitlab.haskell.org/ghc/head.hackage/commit/
$commit
"
local
newline
=
$'
\n
'
cat
|
sed
-e
's/ \+$//'
>
repo/cabal.project.local
<<
EOF
sed
-e
's/ \+$//'
>
repo/cabal.project.local
<<
EOF
repository head.hackage.ghc.haskell.org
url: https://ghc.gitlab.haskell.org/head.hackage/
secure: True
...
...
@@ -49,6 +51,43 @@ repository head.hackage.ghc.haskell.org
${
keys
//.private/
$newline
}
EOF
cat
>
repo/ci.html
<<
EOF
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.1/dist/leaflet.css" />
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css" media="screen">
<script type="text/javascript" src="https://unpkg.com/leaflet@1.3.1/dist/leaflet.js"></script>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"></script>
<script src="scripts/imgViewer2.min.js"></script>
<title>head.hackage</title>
</head>
<body>
<section class="container">
<h1 class="title">head.hackage build results</h1>
<p>This page summarizes the build dependency graph from the continuous
integration build of <code>head.hackage</code> commit
<a href="
$commit_url
"><code>
$commit
</code></a>.
<img id="graph" width="80%" height="80%" src="summary.dot.svg">
<script>
(function(
$)
{
\$
("
\#
graph").imgViewer2();
})(
$)
;
</script>
</body>
</html>
EOF
mkdir
-p
repo/scripts
curl https://raw.githubusercontent.com/waynegm/imgViewer2/master/dist/imgViewer2.min.js
\
>
repo/scripts/imgViewer2.min.js
cat
>
repo/index.html
<<
EOF
<!DOCTYPE html>
<html>
...
...
@@ -80,6 +119,12 @@ $(cat repo/cabal.project.local)
<a href="https://gitlab.haskell.org/ghc/head.hackage">head.hackage
documentation</a> or
<a href="https://gitlab.haskell.org/ghc/head.hackage/issues">let us know</a>.
<p>You might also be interested in referring to the <a href="ci.html">CI
build results</a> of the build that gave rise to this repository.
<p><code>head.hackage</code> commit:
<a href="
$commit_url
"><code>
$commit
</code></a>
</section>
</body>
</html>
...
...
@@ -108,13 +153,14 @@ build_repo() {
--template
=
template
\
./repo
build_index
_html
build_index
}
case
$1
in
gen-keys
)
gen_keys_tarball
;;
extract-keys
)
extract_keys_tarball
;;
build-repo
)
build_repo
;;
build-index
)
build_index
;;
*
)
echo
"Unknown command
$1
"
exit
1
...
...
scripts/render-graph.sh
0 → 100755
View file @
c3b4e4ba
#!/bin/sh
# The following throws a fontconfig error but it appears to be innocuous.
unflatten
-f
-l
3
\
| dot
\
| neato
-s
-n2
-Tsvg
-Gsize
=
"40,10"
-Gratio
=
"fill"
-Gsplines
=
true
#unflatten -f -l 2 | dot | sfdp -s -n2 -Tsvg -o output.svg -Gsize="24,12" -Gratio="fill" -Goverlap="false"
scripts/summarize.py
View file @
c3b4e4ba
...
...
@@ -55,8 +55,12 @@ def export_dot(summary):
s
+=
f' "
{
pkg
}
" -> "
{
dep
}
";
\n
'
for
pkg
in
summary
[
'pkgs'
]:
color
=
'lightblue'
if
pkg
[
'failed'
]:
s
+=
f' "
{
pkg
[
"drvName"
]
}
" [ color=indianred style=filled ];
\n
'
color
=
'indianred'
elif
pkg
[
'drvName'
]
in
summary
[
'roots'
]:
color
=
'green'
s
+=
f' "
{
pkg
[
"drvName"
]
}
" [ URL="logs/
{
pkg
[
"drvName"
]
}
.log" color=
{
color
}
style=filled ];
\n
'
s
+=
'}'
return
s
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment