-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 1c9e45d
Showing
117 changed files
with
23,775 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.neAEmr1g5PwTl5FzaAc2ml-Piua8OgcTnf768zMTNsgQTscs2GmNCscQRi4HvHWGX0p5RXMUmn9PXyIisd2rYT_CFAgrLBLxN-Jm8-PvyT1DJsfhJnTO3-BVIK9R49v_uWh0gMFRpXLi-ojaCyvAsM6npjx84HW88LhNKH16gFHNEMOV4T5osTKDqQFJWdw4QGSwy26Ktu5tx26YR6MImYdh3FsgtDBKg-FvDVB5w3b9oibM8Jo9FVMYFBJsWJa1w-wt5HtGLZ62ugChW399E2NcCUMno4ldMdpXhWOBL5POh4NYrJlnqfIk3Xs19o1LDOm_fjjzKxeEePupmoSXlQ.CW8X9tt9hr178FtR.9Fv9MTjG8feIxViRAF8SY41cXCUdC5BbhQRMRjE2iPBxBIw5d_sjOaWlJJ_APQ5cdaKjXUFpRTz6lEPR57FiVesgLRLXD3ND4_eXhcmw4dFT79wKqQUlNw235JxbVUMfBaDYaK5DAWdVeNkCHgYITjkZ9eqLZpvJhHUqalqBRehrdbCDvmO8LdQSCPPtJ_AD4uDwefcBdtTXb3IwWWpW7IU6v4TVT036P-bNzNVGGotzXpcbxQJJUjw.gywITpIJJxOj-photPrKhQ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
environment: | ||
DOCKER_USER: # | ||
DOCKER_EMAIL: # | ||
DOCKER_PASS: # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
build: | ||
image: golang:1.7 | ||
environment: | ||
- CGO_ENABLED=0 | ||
- GOPATH=/drone | ||
commands: | ||
- env | ||
- go vet | ||
- go test | ||
- go build -ldflags "-s -w -X main.build=$DRONE_BUILD_NUMBER -X main.rev=$DRONE_COMMIT" -a -tags netgo | ||
|
||
publish: | ||
docker: | ||
repo: jprobinson/drone-gae | ||
tag: latest | ||
when: | ||
branch: master | ||
|
||
# Hack: Use the vfs driver to get Docker-in-Docker working on CentOS | ||
# Todo: Migrate the Drone servers to an operating system which works | ||
# See: https://github.com/drone/drone/issues/1296 | ||
storage_driver: vfs | ||
|
||
# Todo: The docs indicate that these should be implicit. What's up? | ||
username: $$DOCKER_USER | ||
password: $$DOCKER_PASS | ||
email: $$DOCKER_EMAIL | ||
|
||
plugin: | ||
name: Google App Engine | ||
desc: Manage deployments on Google App Engine | ||
type: publish | ||
image: jprobinson/drone-gae |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/.drone.sec.yml | ||
/drone-gae | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
FROM alpine:3.4 | ||
|
||
ENV GOOGLE_CLOUD_SDK_VERSION=122.0.0 | ||
ENV GOOGLE_APP_ENGINE_SDK_VERSION=1.9.40 | ||
|
||
RUN apk add --no-cache curl python | ||
|
||
# Install the gcloud SDK | ||
RUN curl -fsSLo google-cloud-sdk.tar.gz https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-sdk-$GOOGLE_CLOUD_SDK_VERSION-linux-x86_64.tar.gz | ||
RUN tar -xzf google-cloud-sdk.tar.gz | ||
RUN rm google-cloud-sdk.tar.gz | ||
RUN ./google-cloud-sdk/install.sh --quiet | ||
|
||
# Install the app engine SDK | ||
RUN curl -fsSLo go_appengine_sdk_linux_amd64-$GOOGLE_APP_ENGINE_SDK_VERSION.zip https://storage.googleapis.com/appengine-sdks/featured/go_appengine_sdk_linux_amd64-$GOOGLE_APP_ENGINE_SDK_VERSION.zip | ||
RUN unzip go_appengine_sdk_linux_amd64-$GOOGLE_APP_ENGINE_SDK_VERSION.zip | ||
RUN rm go_appengine_sdk_linux_amd64-$GOOGLE_APP_ENGINE_SDK_VERSION.zip | ||
|
||
# Clean up | ||
RUN rm -rf ./google-cloud-sdk/.install | ||
|
||
ADD drone-gke /bin/ | ||
ENTRYPOINT ["/bin/drone-gae"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# drone-gae | ||
|
||
Manage deployments on Google App Engine via drone. | ||
|
||
This is currently very new and unstable. | ||
Please don't use it for anything important! | ||
|
||
|
||
## Example | ||
|
||
build: | ||
image: golang:1.7 | ||
commands: | ||
- goapp get -t | ||
- goapp test -v -cover | ||
when: | ||
event: | ||
- push | ||
- pull_request | ||
|
||
deploy: | ||
gae: | ||
action: update | ||
project: my-gae-project | ||
version: "$$COMMIT" | ||
token: > | ||
$$GOOGLE_CREDENTIALS | ||
|
||
when: | ||
event: push | ||
branch: master | ||
|
||
gae: | ||
action: set_default_version | ||
project: my-gae-project | ||
version: "$$COMMIT" | ||
token: > | ||
$$GOOGLE_CREDENTIALS | ||
|
||
when: | ||
event: push | ||
branch: master | ||
|
||
|
||
## License | ||
|
||
MIT. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
cd $(cd `dirname "$0"`; cd ..; pwd) | ||
|
||
drone secure --in ".drone.sec.yml" --out ".drone.sec" --yaml ".drone.yml" --repo jprobinson/drone-gae |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
cd $(cd `dirname "$0"`; cd ..; pwd) | ||
|
||
# https://glide.sh | ||
# brew install glide | ||
glide up | ||
|
||
# https://github.com/sgotti/glide-vc | ||
# go get github.com/sgotti/glide-vc | ||
glide-vc --only-code --no-tests --no-legal-files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package main | ||
|
||
import ( | ||
"fmt" | ||
"io" | ||
"os/exec" | ||
"strings" | ||
) | ||
|
||
type Environ struct { | ||
dir string | ||
env []string | ||
stdout io.Writer | ||
stderr io.Writer | ||
} | ||
|
||
func NewEnviron(dir string, env []string, stdout, stderr io.Writer) *Environ { | ||
return &Environ{ | ||
dir: dir, | ||
env: env, | ||
stdout: stdout, | ||
stderr: stderr, | ||
} | ||
} | ||
|
||
// Run executes the given program. | ||
func (e *Environ) Run(name string, arg ...string) error { | ||
cmd := exec.Command(name, arg...) | ||
cmd.Dir = e.dir | ||
cmd.Env = e.env | ||
cmd.Stdout = e.stdout | ||
cmd.Stderr = e.stderr | ||
|
||
// TODO: Extract this | ||
fmt.Println() | ||
fmt.Println("$", strings.Join(cmd.Args, " ")) | ||
//-- | ||
|
||
return cmd.Run() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package main | ||
|
||
import ( | ||
"bytes" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestEnvironRun(t *testing.T) { | ||
stdout := &bytes.Buffer{} | ||
stderr := &bytes.Buffer{} | ||
|
||
e := &Environ{ | ||
dir: "/tmp", | ||
env: []string{"A=1"}, | ||
stdout: stdout, | ||
stderr: stderr, | ||
} | ||
|
||
err := e.Run("/bin/echo", "hello, ae") | ||
if assert.NoError(t, err) { | ||
assert.Equal(t, "hello, ae\n", stdout.String()) | ||
assert.Equal(t, "", stderr.String()) | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
package: github.com/jprobinson/drone-gae | ||
import: | ||
- package: github.com/drone/drone-plugin-go | ||
subpackages: | ||
- plugin |
Oops, something went wrong.