Compare commits
7 Commits
Author | SHA1 | Date | |
---|---|---|---|
ddbcb8fc6e | |||
6bca816d11 | |||
a4be249b2c | |||
0f165681ac | |||
219efef570 | |||
92a8045e13 | |||
1368f8aa50 |
@ -14,7 +14,7 @@ You'll setup a project which will need the following information:
|
||||
2. Script to build the repository
|
||||
3. Script to test the repository
|
||||
4. Script to build the release file
|
||||
5. Path to the release file
|
||||
5. Path to the release file / can also be a script that returns a file name
|
||||
6. Script to set release name / version
|
||||
|
||||
An optional set of environment strings can be set to define the environment in which the scripts run.
|
||||
|
File diff suppressed because one or more lines are too long
9
cycle.go
9
cycle.go
@ -32,7 +32,8 @@ func (p *Project) load() {
|
||||
defer p.processing.Unlock()
|
||||
|
||||
p.setStage(stageLoad)
|
||||
p.setVersion("")
|
||||
p.setVersion("Version not yet set")
|
||||
p.start = time.Time{}
|
||||
|
||||
if p.filename == "" {
|
||||
p.errHandled(errors.New("Invalid project file name"))
|
||||
@ -82,6 +83,7 @@ func (p *Project) load() {
|
||||
// fetched code, if there is then the temp dir is renamed to the version name
|
||||
func (p *Project) fetch() {
|
||||
p.setStage(stageFetch)
|
||||
p.start = time.Now()
|
||||
|
||||
if p.Fetch == "" {
|
||||
return
|
||||
@ -216,14 +218,15 @@ func (p *Project) release() {
|
||||
return
|
||||
}
|
||||
|
||||
if p.errHandled(p.ds.AddRelease(p.version, p.ReleaseFile, buff)) {
|
||||
if p.errHandled(p.ds.AddRelease(p.version, filepath.Base(p.ReleaseFile), buff)) {
|
||||
return
|
||||
}
|
||||
|
||||
p.setStage(stageReleased)
|
||||
|
||||
if p.errHandled(p.ds.AddLog(p.version, p.stage,
|
||||
fmt.Sprintf("Project %s Version %s built, tested, and released successfully.\n", p.id(), p.version))) {
|
||||
fmt.Sprintf("Project %s Version %s built, tested, and released successfully and took %s.\n", p.id(), p.version,
|
||||
time.Now().Sub(p.start)))) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -121,7 +121,7 @@ func (ds *Store) LastRelease() (*Release, error) {
|
||||
err := ds.bolt.View(func(tx *bolt.Tx) error {
|
||||
c := tx.Bucket([]byte(bucketReleases)).Cursor()
|
||||
|
||||
_, v := c.Last()
|
||||
_, v := c.First() // this is confusing
|
||||
if v == nil {
|
||||
return ErrNotFound
|
||||
}
|
||||
|
@ -68,6 +68,7 @@ type Project struct {
|
||||
status string
|
||||
version string
|
||||
hash string
|
||||
start time.Time // the last start time of the latest cycle
|
||||
|
||||
sync.RWMutex
|
||||
processing sync.Mutex
|
||||
|
@ -177,7 +177,7 @@
|
||||
<td>
|
||||
<a href="/project/{{.id}}/{{.lastLog.version}}">{{.lastLog.version}}</a>
|
||||
</td>
|
||||
<td title="{{.lastLog.log}}">{{#if .lastLog.log}}{{.lastLog.log.substring(0,100)}}{{/if}}</td>
|
||||
<td title="{{.lastLog.log}}">{{#if .lastLog.log && .lastLog.length > 100}}{{.lastLog.log.substring(0,100)}}...{{else}}{{.lastLog.log}}{{/if}}</td>
|
||||
<td>
|
||||
<a href="/project/{{.id}}/{{.releaseVersion}}">{{.releaseVersion}}</a>
|
||||
</td>
|
||||
@ -213,7 +213,7 @@
|
||||
<a href="/project/{{project.id}}/{{.version}}">{{.version}}</a>
|
||||
</td>
|
||||
<td>{{.stage}}</td>
|
||||
<td title="{{.log}}">{{#if .log}}{{.log.substring(0,100)}}{{/if}}</td>
|
||||
<td title="{{.log}}">{{#if .log && .log.length > 100}}{{.log.substring(0,100)}}...{{else}}{{.log}}{{/if}}</td>
|
||||
<td>
|
||||
{{#if releases[project.id + .version]}}
|
||||
<a href="/release/{{project.id}}/{{.version}}?file">{{releases[project.id + .version].fileName}}</a>
|
||||
|
@ -135,7 +135,11 @@ Ractive.DEBUG = false;
|
||||
function getVersion(id, version) {
|
||||
get("/log/" + id + "/" + version,
|
||||
function(result) {
|
||||
r.set("version", version);
|
||||
if (!result.data || !result.data.length || !result.data[0].version) {
|
||||
r.set("version", version);
|
||||
} else {
|
||||
r.set("version", result.data[0].version);
|
||||
}
|
||||
r.set("stages", result.data);
|
||||
},
|
||||
function(result) {
|
||||
@ -171,6 +175,8 @@ Ractive.DEBUG = false;
|
||||
//statuses
|
||||
if (project.stage != "waiting") {
|
||||
project.status = project.stage;
|
||||
} else if (!project.lastLog || !project.lastLog.version) {
|
||||
project.status = "waiting";
|
||||
} else if (project.lastLog.version.trim() == project.releaseVersion.trim()) {
|
||||
project.status = "Successfully Released";
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user