Giter VIP home page Giter VIP logo

jeffdecola / hello-go-deploy-gae Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 7.61 MB

Test, build, push (to DockerHub) and deploy a long running "hello-world" Docker Image to Google App Engine (gae).

License: MIT License

Shell 61.16% Go 11.74% Dockerfile 4.20% HTML 3.21% CSS 19.68%
concourse docker dockerhub dockerimage golang gae google-app-engine google-cloud-platform gcp go google appengine

hello-go-deploy-gae's Introduction

HELLO GO DEPLOY GAE

Tag Latest Go Reference Go Report Card codeclimate Maintainability codeclimate Issue Count Docker Pulls MIT License jeffdecola.com

Deploy a "hello-world" docker image to Google App Engine (gae).

Other Services

Table of Contents

Documentation and Reference

OVERVIEW

Every 2 seconds this App will print,

    INFO[0000] Let's Start this!
    Hello everyone, count is: 1
    Hello everyone, count is: 2
    Hello everyone, count is: 3
    etc...

PREREQUISITES

You will need the following go packages,

go get -u -v github.com/sirupsen/logrus
go get -u -v github.com/cweill/gotests/...

SOFTWARE STACK

RUN

To run.sh,

cd hello-go-deploy-gae-code
go run main.go

To create-binary.sh,

cd hello-go-deploy-gae-code/bin
go build -o hello-go ../main.go
./hello-go

This binary will not be used during a docker build since it creates it's own.

STEP 1 - TEST

To create unit _test files,

cd hello-go-deploy-gae-code
gotests -w -all main.go

To run unit-tests.sh,

go test -cover ./... | tee test/test_coverage.txt
cat test/test_coverage.txt

STEP 2 - BUILD (DOCKER IMAGE VIA DOCKERFILE)

This docker image is built in two stages. In stage 1, rather than copy a binary into a docker image (because that can cause issues), the Dockerfile will build the binary in the docker image. In stage 2, the Dockerfile will copy this binary and place it into a smaller docker image based on alpine, which is around 13MB.

To build.sh with a Dockerfile,

cd hello-go-deploy-gae-code/build
docker build -f Dockerfile -t jeffdecola/hello-go-deploy-gae .

You can check and test this docker image,

docker images jeffdecola/hello-go-deploy-gae
docker run --name hello-go-deploy-gae -dit jeffdecola/hello-go-deploy-gae
docker exec -i -t hello-go-deploy-gae /bin/bash
docker logs hello-go-deploy-gae
docker rm -f hello-go-deploy-gae

STEP 3 - PUSH (TO DOCKERHUB)

You must be logged in to DockerHub,

docker login

To push.sh,

docker push jeffdecola/hello-go-deploy-gae

Check the hello-go-deploy-gae docker image at DockerHub.

STEP 4 - DEPLOY (TO GAE)

Coming soon.

CONTINUOUS INTEGRATION & DEPLOYMENT

Refer to ci-README.md on how I automated the above steps using concourse.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.