Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Commit

Permalink
Adding cloud build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
jak103 committed Jul 17, 2020
1 parent 8df5d4c commit 4f81c2c
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ RUN env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -o uno .
FROM scratch
WORKDIR /uno
COPY --from=server /server/uno /uno/uno
COPY --from=client /client/dist/* /uno/web/
COPY --from=client /client/dist/* /client/dist/
#ENV PATH=$PATH:/uno
CMD ["/uno/uno"]
29 changes: 29 additions & 0 deletions cloudbuild.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"steps": [
{
"name": "gcr.io/cloud-builders/docker",
"args": ["build", "-t", "gcr.io/$PROJECT_ID/uno:$COMMIT_SHA", "."]
},
{
"name": "gcr.io/cloud-builders/docker",
"args": ["push", "gcr.io/$PROJECT_ID/uno:$COMMIT_SHA"]
},
{
"name": "gcr.io/cloud-builders/gcloud",
"args": [
"run",
"deploy",
"uno",
"--image",
"gcr.io/$PROJECT_ID/uno:$COMMIT_SHA",
"--region",
"us-west1",
"--platform",
"managed"
]
}
],
"images": [
"gcr.io/$PROJECT_ID/uno:$COMMIT_SHA"
]
}
2 changes: 1 addition & 1 deletion server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func main() {
e := echo.New()

// Setup middleware
e.File("/", "/client/dist/index.html")
//e.File("/", "/client/dist/index.html")

e.Use(middleware.Logger())
e.Use(middleware.Gzip())
Expand Down

0 comments on commit 4f81c2c

Please sign in to comment.