You've already forked golang-saas-starter-kit
mirror of
https://github.com/raseels-repos/golang-saas-starter-kit.git
synced 2025-06-15 00:15:15 +02:00
fix build info
This commit is contained in:
@ -50,16 +50,14 @@
|
|||||||
{"name": "WEB_API_AUTH_AWS_SECRET_ID", "value": "auth-{ECS_SERVICE}"},
|
{"name": "WEB_API_AUTH_AWS_SECRET_ID", "value": "auth-{ECS_SERVICE}"},
|
||||||
{"name": "WEB_API_AWS_S3_BUCKET_PRIVATE", "value": "{AWS_S3_BUCKET_PRIVATE}"},
|
{"name": "WEB_API_AWS_S3_BUCKET_PRIVATE", "value": "{AWS_S3_BUCKET_PRIVATE}"},
|
||||||
{"name": "WEB_API_AWS_S3_BUCKET_PUBLIC", "value": "{AWS_S3_BUCKET_PUBLIC}"},
|
{"name": "WEB_API_AWS_S3_BUCKET_PUBLIC", "value": "{AWS_S3_BUCKET_PUBLIC}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_REF_NAME", "value": "{CI_COMMIT_REF_NAME}"},
|
{"name": "CI_COMMIT_REF_NAME", "value": "{CI_COMMIT_REF_NAME}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_REF_SLUG", "value": "{CI_COMMIT_REF_SLUG}"},
|
{"name": "CI_COMMIT_SHORT_SHA", "value": "{CI_COMMIT_SHORT_SHA}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_SHA", "value": "{CI_COMMIT_SHA}"},
|
{"name": "CI_COMMIT_SHA", "value": "{CI_COMMIT_SHA}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_TAG", "value": "{CI_COMMIT_TAG}"},
|
{"name": "CI_COMMIT_TAG", "value": "{CI_COMMIT_TAG}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_TITLE", "value": "{CI_COMMIT_TITLE}"},
|
{"name": "CI_JOB_ID", "value": "{CI_JOB_ID}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_DESCRIPTION", "value": "{CI_COMMIT_DESCRIPTION}"},
|
{"name": "CI_JOB_URL", "value": "https://gitlab.com/geeks-accelerator/oss/saas-starter-kit/-/jobs/{CI_JOB_ID}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_JOB_ID", "value": "{CI_COMMIT_JOB_ID}"},
|
{"name": "CI_PIPELINE_ID", "value": "{CI_PIPELINE_ID}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_JOB_URL", "value": "{CI_COMMIT_JOB_URL}"},
|
{"name": "CI_PIPELINE_URL", "value": "https://gitlab.com/geeks-accelerator/oss/saas-starter-kit/pipelines/{CI_PIPELINE_ID}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_PIPELINE_ID", "value": "{CI_COMMIT_PIPELINE_ID}"},
|
|
||||||
{"name": "BUILDINFO_CI_COMMIT_PIPELINE_URL", "value": "{CI_COMMIT_PIPELINE_URL}"},
|
|
||||||
{"name": "DATADOG_ADDR", "value": "127.0.0.1:8125"},
|
{"name": "DATADOG_ADDR", "value": "127.0.0.1:8125"},
|
||||||
{"name": "DD_TRACE_AGENT_HOSTNAME", "value": "127.0.0.1"},
|
{"name": "DD_TRACE_AGENT_HOSTNAME", "value": "127.0.0.1"},
|
||||||
{"name": "DD_TRACE_AGENT_PORT", "value": "8126"},
|
{"name": "DD_TRACE_AGENT_PORT", "value": "8126"},
|
||||||
|
@ -37,7 +37,7 @@ func (c *Check) Health(ctx context.Context, w http.ResponseWriter, r *http.Reque
|
|||||||
data := struct {
|
data := struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
CiCommitRefName string `json:"ci-commit-ref-name,omitempty"`
|
CiCommitRefName string `json:"ci-commit-ref-name,omitempty"`
|
||||||
CiCommitRefSlug string `json:"ci-commit-ref-slug,omitempty"`
|
CiCommitShortSha string `json:"ci-commit-short-sha,omitempty"`
|
||||||
CiCommitSha string `json:"ci-commit-sha,omitempty"`
|
CiCommitSha string `json:"ci-commit-sha,omitempty"`
|
||||||
CiCommitTag string `json:"ci-commit-tag,omitempty"`
|
CiCommitTag string `json:"ci-commit-tag,omitempty"`
|
||||||
CiCommitTitle string `json:"ci-commit-title,omitempty"`
|
CiCommitTitle string `json:"ci-commit-title,omitempty"`
|
||||||
@ -46,12 +46,11 @@ func (c *Check) Health(ctx context.Context, w http.ResponseWriter, r *http.Reque
|
|||||||
}{
|
}{
|
||||||
Status: "ok",
|
Status: "ok",
|
||||||
CiCommitRefName: os.Getenv("CI_COMMIT_REF_NAME"),
|
CiCommitRefName: os.Getenv("CI_COMMIT_REF_NAME"),
|
||||||
CiCommitRefSlug: os.Getenv("CI_COMMIT_REF_SLUG"),
|
CiCommitShortSha : os.Getenv("CI_COMMIT_SHORT_SHA"),
|
||||||
CiCommitSha: os.Getenv("CI_COMMIT_SHA"),
|
CiCommitSha: os.Getenv("CI_COMMIT_SHA"),
|
||||||
CiCommitTag: os.Getenv("CI_COMMIT_TAG"),
|
CiCommitTag: os.Getenv("CI_COMMIT_TAG"),
|
||||||
CiCommitTitle: os.Getenv("CI_COMMIT_TITLE"),
|
CiJobId: os.Getenv("CI_JOB_ID"),
|
||||||
CiJobId: os.Getenv("CI_COMMIT_JOB_ID"),
|
CiPipelineId: os.Getenv("CI_PIPELINE_ID"),
|
||||||
CiPipelineId: os.Getenv("CI_COMMIT_PIPELINE_ID"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return web.RespondJson(ctx, w, data, http.StatusOK)
|
return web.RespondJson(ctx, w, data, http.StatusOK)
|
||||||
|
@ -134,15 +134,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
BuildInfo struct {
|
BuildInfo struct {
|
||||||
CiCommitRefName string `envconfig:"CI_COMMIT_REF_NAME"`
|
CiCommitRefName string `envconfig:"CI_COMMIT_REF_NAME"`
|
||||||
CiCommitRefSlug string `envconfig:"CI_COMMIT_REF_SLUG"`
|
CiCommitShortSha string `envconfig:"CI_COMMIT_SHORT_SHA"`
|
||||||
CiCommitSha string `envconfig:"CI_COMMIT_SHA"`
|
CiCommitSha string `envconfig:"CI_COMMIT_SHA"`
|
||||||
CiCommitTag string `envconfig:"CI_COMMIT_TAG"`
|
CiCommitTag string `envconfig:"CI_COMMIT_TAG"`
|
||||||
CiCommitTitle string `envconfig:"CI_COMMIT_TITLE"`
|
CiJobId string `envconfig:"CI_JOB_ID"`
|
||||||
CiCommitDescription string `envconfig:"CI_COMMIT_DESCRIPTION"`
|
CiJobUrl string `envconfig:"CI_JOB_URL"`
|
||||||
CiJobId string `envconfig:"CI_COMMIT_JOB_ID"`
|
CiPipelineId string `envconfig:"CI_PIPELINE_ID"`
|
||||||
CiJobUrl string `envconfig:"CI_COMMIT_JOB_URL"`
|
CiPipelineUrl string `envconfig:"CI_PIPELINE_URL"`
|
||||||
CiPipelineId string `envconfig:"CI_COMMIT_PIPELINE_ID"`
|
|
||||||
CiPipelineUrl string `envconfig:"CI_COMMIT_PIPELINE_URL"`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,16 +54,14 @@
|
|||||||
{"name": "WEB_APP_AUTH_AWS_SECRET_ID", "value": "auth-{ECS_SERVICE}"},
|
{"name": "WEB_APP_AUTH_AWS_SECRET_ID", "value": "auth-{ECS_SERVICE}"},
|
||||||
{"name": "WEB_APP_AWS_S3_BUCKET_PRIVATE", "value": "{AWS_S3_BUCKET_PRIVATE}"},
|
{"name": "WEB_APP_AWS_S3_BUCKET_PRIVATE", "value": "{AWS_S3_BUCKET_PRIVATE}"},
|
||||||
{"name": "WEB_APP_AWS_S3_BUCKET_PUBLIC", "value": "{AWS_S3_BUCKET_PUBLIC}"},
|
{"name": "WEB_APP_AWS_S3_BUCKET_PUBLIC", "value": "{AWS_S3_BUCKET_PUBLIC}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_REF_NAME", "value": "{CI_COMMIT_REF_NAME}"},
|
{"name": "CI_COMMIT_REF_NAME", "value": "{CI_COMMIT_REF_NAME}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_REF_SLUG", "value": "{CI_COMMIT_REF_SLUG}"},
|
{"name": "CI_COMMIT_SHORT_SHA", "value": "{CI_COMMIT_SHORT_SHA}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_SHA", "value": "{CI_COMMIT_SHA}"},
|
{"name": "CI_COMMIT_SHA", "value": "{CI_COMMIT_SHA}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_TAG", "value": "{CI_COMMIT_TAG}"},
|
{"name": "CI_COMMIT_TAG", "value": "{CI_COMMIT_TAG}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_TITLE", "value": "{CI_COMMIT_TITLE}"},
|
{"name": "CI_JOB_ID", "value": "{CI_JOB_ID}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_DESCRIPTION", "value": "{CI_COMMIT_DESCRIPTION}"},
|
{"name": "CI_JOB_URL", "value": "https://gitlab.com/geeks-accelerator/oss/saas-starter-kit/-/jobs/{CI_JOB_ID}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_JOB_ID", "value": "{CI_COMMIT_JOB_ID}"},
|
{"name": "CI_PIPELINE_ID", "value": "{CI_PIPELINE_ID}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_JOB_URL", "value": "{CI_COMMIT_JOB_URL}"},
|
{"name": "CI_PIPELINE_URL", "value": "https://gitlab.com/geeks-accelerator/oss/saas-starter-kit/pipelines/{CI_PIPELINE_ID}"},
|
||||||
{"name": "BUILDINFO_CI_COMMIT_PIPELINE_ID", "value": "{CI_COMMIT_PIPELINE_ID}"},
|
|
||||||
{"name": "BUILDINFO_CI_COMMIT_PIPELINE_URL", "value": "{CI_COMMIT_PIPELINE_URL}"},
|
|
||||||
{"name": "DATADOG_ADDR", "value": "127.0.0.1:8125"},
|
{"name": "DATADOG_ADDR", "value": "127.0.0.1:8125"},
|
||||||
{"name": "DD_TRACE_AGENT_HOSTNAME", "value": "127.0.0.1"},
|
{"name": "DD_TRACE_AGENT_HOSTNAME", "value": "127.0.0.1"},
|
||||||
{"name": "DD_TRACE_AGENT_PORT", "value": "8126"},
|
{"name": "DD_TRACE_AGENT_PORT", "value": "8126"},
|
||||||
|
@ -37,7 +37,7 @@ func (c *Check) Health(ctx context.Context, w http.ResponseWriter, r *http.Reque
|
|||||||
data := struct {
|
data := struct {
|
||||||
Status string `json:"status"`
|
Status string `json:"status"`
|
||||||
CiCommitRefName string `json:"ci-commit-ref-name,omitempty"`
|
CiCommitRefName string `json:"ci-commit-ref-name,omitempty"`
|
||||||
CiCommitRefSlug string `json:"ci-commit-ref-slug,omitempty"`
|
CiCommitShortSha string `json:"ci-commit-short-sha,omitempty"`
|
||||||
CiCommitSha string `json:"ci-commit-sha,omitempty"`
|
CiCommitSha string `json:"ci-commit-sha,omitempty"`
|
||||||
CiCommitTag string `json:"ci-commit-tag,omitempty"`
|
CiCommitTag string `json:"ci-commit-tag,omitempty"`
|
||||||
CiCommitTitle string `json:"ci-commit-title,omitempty"`
|
CiCommitTitle string `json:"ci-commit-title,omitempty"`
|
||||||
@ -46,12 +46,11 @@ func (c *Check) Health(ctx context.Context, w http.ResponseWriter, r *http.Reque
|
|||||||
}{
|
}{
|
||||||
Status: "ok",
|
Status: "ok",
|
||||||
CiCommitRefName: os.Getenv("CI_COMMIT_REF_NAME"),
|
CiCommitRefName: os.Getenv("CI_COMMIT_REF_NAME"),
|
||||||
CiCommitRefSlug: os.Getenv("CI_COMMIT_REF_SLUG"),
|
CiCommitShortSha : os.Getenv("CI_COMMIT_SHORT_SHA"),
|
||||||
CiCommitSha: os.Getenv("CI_COMMIT_SHA"),
|
CiCommitSha: os.Getenv("CI_COMMIT_SHA"),
|
||||||
CiCommitTag: os.Getenv("CI_COMMIT_TAG"),
|
CiCommitTag: os.Getenv("CI_COMMIT_TAG"),
|
||||||
CiCommitTitle: os.Getenv("CI_COMMIT_TITLE"),
|
CiJobId: os.Getenv("CI_JOB_ID"),
|
||||||
CiJobId: os.Getenv("CI_COMMIT_JOB_ID"),
|
CiPipelineId: os.Getenv("CI_PIPELINE_ID"),
|
||||||
CiPipelineId: os.Getenv("CI_COMMIT_PIPELINE_ID"),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return web.RespondJson(ctx, w, data, http.StatusOK)
|
return web.RespondJson(ctx, w, data, http.StatusOK)
|
||||||
|
@ -151,15 +151,13 @@ func main() {
|
|||||||
}
|
}
|
||||||
BuildInfo struct {
|
BuildInfo struct {
|
||||||
CiCommitRefName string `envconfig:"CI_COMMIT_REF_NAME"`
|
CiCommitRefName string `envconfig:"CI_COMMIT_REF_NAME"`
|
||||||
CiCommitRefSlug string `envconfig:"CI_COMMIT_REF_SLUG"`
|
CiCommitShortSha string `envconfig:"CI_COMMIT_SHORT_SHA"`
|
||||||
CiCommitSha string `envconfig:"CI_COMMIT_SHA"`
|
CiCommitSha string `envconfig:"CI_COMMIT_SHA"`
|
||||||
CiCommitTag string `envconfig:"CI_COMMIT_TAG"`
|
CiCommitTag string `envconfig:"CI_COMMIT_TAG"`
|
||||||
CiCommitTitle string `envconfig:"CI_COMMIT_TITLE"`
|
CiJobId string `envconfig:"CI_JOB_ID"`
|
||||||
CiCommitDescription string `envconfig:"CI_COMMIT_DESCRIPTION"`
|
CiJobUrl string `envconfig:"CI_JOB_URL"`
|
||||||
CiJobId string `envconfig:"CI_COMMIT_JOB_ID"`
|
CiPipelineId string `envconfig:"CI_PIPELINE_ID"`
|
||||||
CiJobUrl string `envconfig:"CI_COMMIT_JOB_URL"`
|
CiPipelineUrl string `envconfig:"CI_PIPELINE_URL"`
|
||||||
CiPipelineId string `envconfig:"CI_COMMIT_PIPELINE_ID"`
|
|
||||||
CiPipelineUrl string `envconfig:"CI_COMMIT_PIPELINE_URL"`
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
Branch: {{ ._Service.BuildInfo.CiCommitRefName }}@{{ ._Service.BuildInfo.CiCommitSha }}<br/>
|
Branch: {{ ._Service.BuildInfo.CiCommitRefName }}@{{ ._Service.BuildInfo.CiCommitSha }}<br/>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{if ne ._Service.ENV "prod"}}
|
{{if ne ._Service.ENV "prod"}}
|
||||||
Commit: {{ ._Service.BuildInfo.CiCommitTitle }}
|
|
||||||
{{if ne ._Service.BuildInfo.CiJobId ""}}
|
{{if ne ._Service.BuildInfo.CiJobId ""}}
|
||||||
Job: <a href="{{ ._Service.BuildInfo.CiJobUrl }}" target="_blank">{{ ._Service.BuildInfo.CiJobId }}</a>
|
Job: <a href="{{ ._Service.BuildInfo.CiJobUrl }}" target="_blank">{{ ._Service.BuildInfo.CiJobId }}</a>
|
||||||
{{end}}
|
{{end}}
|
||||||
|
@ -296,6 +296,7 @@ func ServiceBuild(log *log.Logger, req *serviceBuildRequest) error {
|
|||||||
cmds = append(cmds, []string{
|
cmds = append(cmds, []string{
|
||||||
"docker", "build",
|
"docker", "build",
|
||||||
"--file=" + dockerFile,
|
"--file=" + dockerFile,
|
||||||
|
"--cache-from", buildBaseImage,
|
||||||
"--build-arg", "service=" + req.ServiceName,
|
"--build-arg", "service=" + req.ServiceName,
|
||||||
"--build-arg", "env=" + req.Env,
|
"--build-arg", "env=" + req.Env,
|
||||||
"-t", buildBaseImage,
|
"-t", buildBaseImage,
|
||||||
|
Reference in New Issue
Block a user