Skip to content

Commit

Permalink
build: cleanup docker script
Browse files Browse the repository at this point in the history
  • Loading branch information
favna committed Nov 30, 2019
1 parent f7c8867 commit c899e49
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
20 changes: 4 additions & 16 deletions scripts/docker.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env bash

ASCIIDOCKER="H4sICANp3F0AA2RvY2tlci50eHQA1VfLDYMwDL1nCkZhNA4MgIhAQuqpnKpuxSSFfO3ECQm/QmVVVRNiv+dnO7Ai7TP1PG4s56B26r7Lj+7tfv/vIGmpB019vUrJZqMdcg/oiIL2aVi4MauCqvkRCiHprE4PAyaBzIbZE81YODE8N6I4MWp1tB6SiLGHSdORMbjlRF1stVoE1qDYLQiMwO5TDBkiSTrBHpMnkmy1GqszvNr6qQhisCcQ4JFuADxPubRaDlM37Q4qzdVXivkaJCA66qbDj5QLQJYEkc4vWUMr6GQOK4lu6lQ+b1llUHHOP20Y4wj6m0Ga8NwTTGMyxraq/G5mS+7xaCCU5sGqA13wsJxcmVvVBnSrOyAXr0KM/tMhwPkj6pyrgZNvc4sfZKsoxNy6gur97bbnZbkZcmasmuF4sHimnEil665Cd+HQhFTjQA314XiF0gFZefb4Xr8/BGKI+2713cVx3X1WvKOXIMsg+YJrCghfSEIWzM0PNYI/wBkQAAA="

RED='\033[0;31m'
LIGHTRED='\033[1;31m'
GREEN='\033[0;32m'
Expand Down Expand Up @@ -38,27 +36,18 @@ Commands:
${LIGHTPURPLE}
Subcommands:
all Runs build, push and deploy sequentially
build Builds the docker image
run Runs the docker image as container in detached state
push Pushes the docker image to the repository
deploy Gcloud only: Deploys the pushed docker image to Google Cloud Functions
remove Removes the Docker image
${DARKGRAY}
The answer is always 42"
}

printMoby() {
fancylog "${CYAN}Moby is here!"
base64 --decode <<<${ASCIIDOCKER} | gunzip
fancylog "${NC}"
echo ""
"
}

gcloudDocker() {
printMoby

case $1 in
all) gcloudDocker build && gcloudDocker push && gcloudDocker deploy ;;
build) docker build -t gcr.io/data-sunlight-146313/graphql-pokemon . ;;
run) docker container run --name graphql-pokemon -d --expose 8080 -p 4000:8080 -it gcr.io/data-sunlight-146313/graphql-pokemon:latest ;;
push) docker push gcr.io/data-sunlight-146313/graphql-pokemon ;;
Expand All @@ -68,9 +57,8 @@ gcloudDocker() {
}

hubDocker() {
printMoby

case $1 in
all) hubDocker build && hubDocker push ;;
build) docker build -t favware/graphql-pokemon . ;;
run) docker container run --name graphql-pokemon -d --expose 8080 -p 4000:8080 -it favware/graphql-pokemon:latest ;;
push) docker push favware/graphql-pokemon ;;
Expand Down
3 changes: 2 additions & 1 deletion src/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"declarationMap": false,
"sourceMap": false
},
"include": ["./**/*.ts", "./assets/*.json"]
"include": ["./**/*.ts", "./**/*.json"],
"exclude": ["./tsconfig.json"]
}

0 comments on commit c899e49

Please sign in to comment.