fixed config prefix, hookup build output

This commit is contained in:
Brad Rydzewski 2015-08-02 23:02:44 -07:00
parent 12cf89f8b3
commit 79bf71b03b
7 changed files with 81 additions and 75 deletions

View file

@ -177,12 +177,12 @@
views: {
'toolbar': {
templateUrl: '/static/scripts/views/builds/show/toolbar.html',
controller: 'BuildCtrl',
controller: 'BuildOutCtrl',
resolve: resolveUser
},
'content': {
templateUrl: '/static/scripts/views/builds/show/content.html',
controller: 'BuildCtrl',
controller: 'BuildOutCtrl',
resolve: resolveUser
}
},
@ -192,12 +192,12 @@
url: '/:owner/:name/:number/:step',
views: {
'toolbar': {
templateUrl: '/static/scripts/views/builds/step/toolbar.html',
templateUrl: '/static/scripts/views/builds/show/toolbar.html',
controller: 'BuildOutCtrl',
resolve: resolveUser
},
'content': {
templateUrl: '/static/scripts/views/builds/step/content.html',
templateUrl: '/static/scripts/views/builds/show/content.html',
controller: 'BuildOutCtrl',
resolve: resolveUser
},

View file

@ -1,40 +1,41 @@
<article>
<section class="commit-section">
<div class="row build-row">
<div>
<div ng-class="[ 'build-num', build.status ]"></div>
</div>
<div>
<h3>{{ build.head_commit.message }}</h3>
<p><strong>{{ build.head_commit.author.login }}</strong> pushed to <strong>{{ build.head_commit.branch}}</strong> {{ build.started_at | fromNow }}</p>
<div style="position:absolute;top:30px;right:30px;color:#CCC;"># {{build.number}}</div>
</div>
</div>
</section>
<p style="padding-top: 20px;">
<h3><strong>Build jobs</strong></h3>
</p>
<section>
<a class="row build-row sub-build-row" ng-repeat="job in build.jobs" ng-href="{{ repo.full_name }}/{{ build.number }}/{{ job.number }}">
<div>
<div ng-class="[ 'build-num', build.status ]"></div>
</div>
<div>
<h3>
<div ng-repeat="(key, value) in job.environment">
{{ key.toUpperCase() }}={{ value }}
</div>
</h3>
<div style="position:absolute;top:30px;right:30px;color:#CCC;"># {{job.number}}</div>
</div>
</a>
</section>
</article>
<div style="padding-left: 20px;">
<button ng-if="build.status !== 'pending' && build.status !== 'running'" ng-click="restart()">Restart</button>
<!-- <button ng-if="build.status !== 'pending' && build.status !== 'running'" ng-click="restart()">Restart</button>
<button ng-if="build.status === 'pending' || build.status === 'running'" ng-click="cancel()">Cancel</button>
</div>
-->
<main class="flex">
<aside>
<div>
<div class="build-section">
<div class="status"><i class="material-icons">close</i></div><!--remove-->
<div class="build-summary">
<h2>{{ build.head_commit.message }}</h2>
<p><em>{{ build.head_commit.author.login }}</em> pushed to <em>{{ build.head_commit.branch }}</em> {{ build.started_at | fromNow }}</p>
</div>
</div>
<div class="list job-list">
<a ng-repeat="job in build.jobs" ng-href="{{ repo.full_name }}/{{ build.number }}/{{ job.number }}">
<div>
<div class="status {{ job.status }}">
<i class="material-icons">check</i>
</div>
</div>
<div>{{ job.number }}</div>
<div>
<div class="param" ng-repeat="(key, value) in job.environment">
{{ key.toUpperCase() }}={{ value }}
</div>
</div>
</a>
</div>
</div>
</aside>
<article class="console">
<div class="button-tail" ng-if="build.status === 'running'" ng-click="tail()">
<i class="material-icons">expand_more</i>
</div>
<pre id="term"></pre>
</article>
</main>

View file

@ -1,24 +1,3 @@
<div class="breadcrumb" style="position:relative;top:0px;">
<a ng-href="/{{ repo.full_name }}" class="icon icon-home">
<i class="material-icons md-18">home</i>
</a>
<a ng-href="/{{ repo.full_name }}">{{ repo.owner }} / {{ repo.name }}</a>
<span class="spacer"></span>
<a ng-href="#">#{{ build.number }}</a>
</div>
<div class="menu">
<a ng-href="/{{ repo.full_name }}/edit" class="nav-item settings float-right" ng-if="repo.permissions.pull">
<i class="material-icons md-18">edit</i>
</a>
<button ng-click="watch(repo)" ng-if="!repo.starred && user" class="nav-item star float-right">
<i class="material-icons md-18">star_border</i>
</button>
<button ng-click="unwatch(repo)" ng-if="repo.starred && user" class="nav-item unstar float-right">
<i class="material-icons md-18">star</i>
</button>
</div>
<ol>
<li>
<a ng-href="/{{ repo.full_name }}">

View file

@ -17,6 +17,10 @@
color: #a3be8c;
border: 1px solid #a3be8c;
background: #fff;
/*
background: rgba(163, 190, 140, 0.25);
border: none;
font-size: 11px;*/
}
.label-failure {
color: #bf616a;

View file

@ -143,6 +143,8 @@ main aside > div {
top:0px;
}
/*
* Build Console
*/
@ -164,11 +166,19 @@ main aside > div {
box-sizing: border-box;
padding:35px 40px;
line-height:18px;
font-family: "RobotoMono", Roboto+Mono, Roboto;
font-family: "Roboto Mono";
font-size:12px;
font-weight:300;
}
@media (-webkit-min-device-pixel-ratio: 1) {
.console pre {
font-weight:400;
line-height:20px;
font-size:13px;
}
}
/*
* Repo List
*/
@ -307,16 +317,20 @@ main aside > div {
*/
.job-list { }
.job-list li {
.job-list > a,
.job-list > li {
display:flex;
padding:20px 0px;
border-top:1px solid #f0f4f7;
}
.job-list li > div:first-child {
width:50px;
min-width:50px;
.job-list > a > div:first-child,
.job-list > li > div:first-child {
width:40px;
min-width:40px;
}
.job-list li > div:nth-child(2) { /** TEMPORARILY HIDDEN. MAY DECIDE TO REMOVE */
.job-list > a > div:nth-child(2),
.job-list > li > div:nth-child(2) { /** TEMPORARILY HIDDEN. MAY DECIDE TO REMOVE */
min-width:25px;
font-size:13px;
text-align:right;
@ -325,14 +339,17 @@ main aside > div {
font-size:15px;
display:none;
}
.job-list li > div:nth-child(3) {
.job-list > a > div:nth-child(3),
.job-list > li > div:nth-child(3) {
flex:1 1 auto;
font-size:13px;
}
.job-list li div.param {
.job-list > a > div.param,
.job-list > li div.param {
margin-top:5px;
}
.job-list li div.param:first-child {
.job-list > a div.param:first-child,
.job-list > li div.param:first-child {
margin-top:10px;
}

View file

@ -112,7 +112,7 @@ func LoadBytes(data []byte) (*Config, error) {
// if err != nil {
// return nil, err
// }
err := envconfig.InitWithPrefix(conf, "DRONE")
err := envconfig.Init(conf)
if err != nil {
return nil, err
}

View file

@ -30,6 +30,7 @@ func GetCommit(c *gin.Context) {
build, err := store.BuildNumber(repo, num)
if err != nil {
c.Fail(404, err)
return
}
build.Jobs, err = store.JobList(build)
if err != nil {
@ -72,7 +73,11 @@ func GetLogs(c *gin.Context) {
r, err := store.GetBlobReader(path)
if err != nil {
c.Fail(404, err)
} else if full {
return
}
defer r.Close()
if full {
io.Copy(c.Writer, r)
} else {
io.Copy(c.Writer, io.LimitReader(r, 2000000))