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:
parent
04060ee63d
commit
8d79ded661
@ -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.
|
||||||
|
7
cycle.go
7
cycle.go
@ -33,6 +33,7 @@ func (p *Project) load() {
|
|||||||
|
|
||||||
p.setStage(stageLoad)
|
p.setStage(stageLoad)
|
||||||
p.setVersion("Version not yet set")
|
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user