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
|
2. Script to build the repository
|
||||||
3. Script to test the repository
|
3. Script to test the repository
|
||||||
4. Script to build the release file
|
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
|
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.
|
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
1
build.sh
1
build.sh
@ -1,3 +1,2 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
go-bindata web/... && go build -a -v -o ironsmith
|
go-bindata web/... && go build -a -v -o ironsmith
|
||||||
|
9
cycle.go
9
cycle.go
@ -32,7 +32,8 @@ func (p *Project) load() {
|
|||||||
defer p.processing.Unlock()
|
defer p.processing.Unlock()
|
||||||
|
|
||||||
p.setStage(stageLoad)
|
p.setStage(stageLoad)
|
||||||
p.setVersion("")
|
p.setVersion("Version not yet set")
|
||||||
|
p.start = time.Time{}
|
||||||
|
|
||||||
if p.filename == "" {
|
if p.filename == "" {
|
||||||
p.errHandled(errors.New("Invalid project file name"))
|
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
|
// fetched code, if there is then the temp dir is renamed to the version name
|
||||||
func (p *Project) fetch() {
|
func (p *Project) fetch() {
|
||||||
p.setStage(stageFetch)
|
p.setStage(stageFetch)
|
||||||
|
p.start = time.Now()
|
||||||
|
|
||||||
if p.Fetch == "" {
|
if p.Fetch == "" {
|
||||||
return
|
return
|
||||||
@ -216,14 +218,15 @@ func (p *Project) release() {
|
|||||||
return
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
p.setStage(stageReleased)
|
p.setStage(stageReleased)
|
||||||
|
|
||||||
if p.errHandled(p.ds.AddLog(p.version, p.stage,
|
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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,7 +121,7 @@ func (ds *Store) LastRelease() (*Release, error) {
|
|||||||
err := ds.bolt.View(func(tx *bolt.Tx) error {
|
err := ds.bolt.View(func(tx *bolt.Tx) error {
|
||||||
c := tx.Bucket([]byte(bucketReleases)).Cursor()
|
c := tx.Bucket([]byte(bucketReleases)).Cursor()
|
||||||
|
|
||||||
_, v := c.Last()
|
_, v := c.First() // this is confusing
|
||||||
if v == nil {
|
if v == nil {
|
||||||
return ErrNotFound
|
return ErrNotFound
|
||||||
}
|
}
|
||||||
|
@ -68,6 +68,7 @@ type Project struct {
|
|||||||
status string
|
status string
|
||||||
version string
|
version string
|
||||||
hash string
|
hash string
|
||||||
|
start time.Time // the last start time of the latest cycle
|
||||||
|
|
||||||
sync.RWMutex
|
sync.RWMutex
|
||||||
processing sync.Mutex
|
processing sync.Mutex
|
||||||
|
@ -177,7 +177,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<a href="/project/{{.id}}/{{.lastLog.version}}">{{.lastLog.version}}</a>
|
<a href="/project/{{.id}}/{{.lastLog.version}}">{{.lastLog.version}}</a>
|
||||||
</td>
|
</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>
|
<td>
|
||||||
<a href="/project/{{.id}}/{{.releaseVersion}}">{{.releaseVersion}}</a>
|
<a href="/project/{{.id}}/{{.releaseVersion}}">{{.releaseVersion}}</a>
|
||||||
</td>
|
</td>
|
||||||
@ -213,7 +213,7 @@
|
|||||||
<a href="/project/{{project.id}}/{{.version}}">{{.version}}</a>
|
<a href="/project/{{project.id}}/{{.version}}">{{.version}}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>{{.stage}}</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>
|
<td>
|
||||||
{{#if releases[project.id + .version]}}
|
{{#if releases[project.id + .version]}}
|
||||||
<a href="/release/{{project.id}}/{{.version}}?file">{{releases[project.id + .version].fileName}}</a>
|
<a href="/release/{{project.id}}/{{.version}}?file">{{releases[project.id + .version].fileName}}</a>
|
||||||
|
@ -135,7 +135,11 @@ Ractive.DEBUG = false;
|
|||||||
function getVersion(id, version) {
|
function getVersion(id, version) {
|
||||||
get("/log/" + id + "/" + version,
|
get("/log/" + id + "/" + version,
|
||||||
function(result) {
|
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);
|
r.set("stages", result.data);
|
||||||
},
|
},
|
||||||
function(result) {
|
function(result) {
|
||||||
@ -171,6 +175,8 @@ Ractive.DEBUG = false;
|
|||||||
//statuses
|
//statuses
|
||||||
if (project.stage != "waiting") {
|
if (project.stage != "waiting") {
|
||||||
project.status = project.stage;
|
project.status = project.stage;
|
||||||
|
} else if (!project.lastLog || !project.lastLog.version) {
|
||||||
|
project.status = "waiting";
|
||||||
} else if (project.lastLog.version.trim() == project.releaseVersion.trim()) {
|
} else if (project.lastLog.version.trim() == project.releaseVersion.trim()) {
|
||||||
project.status = "Successfully Released";
|
project.status = "Successfully Released";
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user