-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
part of #36
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,28 +7,35 @@ import ( | |
"fmt" | ||
"html/template" | ||
"strings" | ||
"time" | ||
) | ||
|
||
const ( | ||
EnvMantilConfig = "MANTIL_CONFIG" | ||
) | ||
|
||
type Stage struct { | ||
Name string `yaml:"name"` | ||
Default bool `yaml:"default,omitempty"` | ||
NodeName string `yaml:"node"` | ||
Endpoints *StageEndpoints `yaml:"endpoints,omitempty"` | ||
Functions []*Function `yaml:"functions,omitempty"` | ||
Public *Public `yaml:"public,omitempty"` | ||
project *Project | ||
node *Node | ||
Name string `yaml:"name"` | ||
Default bool `yaml:"default,omitempty"` | ||
NodeName string `yaml:"node"` | ||
Endpoints *StageEndpoints `yaml:"endpoints,omitempty"` | ||
LastDeployment *LastDeployment `yaml:"last_deployment,omitempty"` | ||
Functions []*Function `yaml:"functions,omitempty"` | ||
Public *Public `yaml:"public,omitempty"` | ||
project *Project | ||
node *Node | ||
} | ||
|
||
type Public struct { | ||
Bucket string `yaml:"bucket"` | ||
Hash string `yaml:"hash,omitempty"` | ||
} | ||
|
||
type LastDeployment struct { | ||
Version string `yaml:"version"` | ||
Time time.Time `yaml:"time"` | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
IvanVlasic
Contributor
|
||
} | ||
|
||
func (s *Stage) ResourceTags() map[string]string { | ||
// stage resource tags include tags from both node and project | ||
tags := s.node.ResourceTags() | ||
|
@@ -102,6 +109,13 @@ func (s *Stage) SetEndpoints(rest, ws string) { | |
} | ||
} | ||
|
||
func (s *Stage) SetLastDeployment() { | ||
s.LastDeployment = &LastDeployment{ | ||
Version: s.node.Version, | ||
Time: time.Now().Round(time.Second), | ||
} | ||
} | ||
|
||
func (s *Stage) applyConfiguration(ec *EnvironmentConfig) bool { | ||
if ec == nil { | ||
return false | ||
|
za sada imamo:
CreatedAt int64
Timestamp int64
ovdje je:
Time time.Time
Je li moguce imati jedan nacin biljezenja trenuka u vremenu?