Added time took to release log statement

Changed release file name handling to only include the base of the file
path.
This commit is contained in:
Tim Shannon 2016-04-25 21:02:01 +00:00
parent 04060ee63d
commit 8d79ded661
3 changed files with 7 additions and 3 deletions

View File

@ -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.

View File

@ -33,6 +33,7 @@ func (p *Project) load() {
p.setStage(stageLoad)
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
}

View File

@ -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