Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Go Httpbin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Nix
Go Httpbin
Commits
f72cf672
Commit
f72cf672
authored
4 years ago
by
Will McCutchen
Browse files
Options
Downloads
Patches
Plain Diff
Don't require local gcloud installation
parent
9e3d9aa5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Makefile
+11
-5
11 additions, 5 deletions
Makefile
with
11 additions
and
5 deletions
Makefile
+
11
−
5
View file @
f72cf672
.PHONY
:
clean deploy deps image imagepush lint run stagedeploy test testci testcover
.PHONY
:
clean deploy deps
gcloud-auth
image imagepush lint run stagedeploy test testci testcover
# The version that will be used in docker tags (e.g. to push a
# go-httpbin:latest image use `make imagepush VERSION=latest)`
...
...
@@ -8,6 +8,9 @@ VERSION ?= $(shell git rev-parse --short HEAD)
GCLOUD_PROJECT
?=
httpbingo
GCLOUD_ACCOUNT
?=
mccutchen@gmail.com
# Run gcloud in a container to avoid needing to install the SDK locally
GCLOUD_COMMAND
?=
docker run
--rm
-ti
--workdir
/code
-v
$$
PWD:/code
-v
$$
HOME/.config/gcloud:/root/.config/gcloud google/cloud-sdk gcloud
# Built binaries will be placed here
DIST_PATH
?=
dist
...
...
@@ -78,11 +81,14 @@ lint: $(TOOL_GOLINT) $(TOOL_STATICCHECK)
# =============================================================================
# deploy & run locally
# =============================================================================
deploy
:
build
gcloud
--account
=
$(
GCLOUD_ACCOUNT
)
app deploy
--quiet
--project
=
$(
GCLOUD_PROJECT
)
--version
=
$(
VERSION
)
--promote
deploy
:
build gcloud-auth
$(
GCLOUD_COMMAND
)
--account
=
$(
GCLOUD_ACCOUNT
)
app deploy
--quiet
--project
=
$(
GCLOUD_PROJECT
)
--version
=
$(
VERSION
)
--promote
stagedeploy
:
build gcloud-auth
$(
GCLOUD_COMMAND
)
--account
=
$(
GCLOUD_ACCOUNT
)
app deploy
--quiet
--project
=
$(
GCLOUD_PROJECT
)
--version
=
$(
VERSION
)
--no-promote
stagedeploy
:
build
gcloud
--account
=
$(
GCLOUD_ACCOUNT
)
app deploy
--quiet
--project
=
$(
GCLOUD_PROJECT
)
--version
=
$(
VERSION
)
--no-promote
gcloud-auth
:
@$(
GCLOUD_COMMAND
)
auth list |
grep
'^\*'
|
grep
-q
$(
GCLOUD_ACCOUNT
)
||
$(
GCLOUD_COMMAND
)
auth login
$(
GCLOUD_ACCOUNT
)
run
:
build
$(
DIST_PATH
)
/go-httpbin
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment