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
FROM node:8.9.4-alpine | |
RUN apk add --no-cache git | |
RUN npm install -g yo generator-hubot | |
RUN adduser -D hubot | |
USER hubot | |
WORKDIR /home/hubot | |
RUN yo hubot --owner="Tim <timothy@fireflies.ai>" --name="hubot" --description="Hubot for slack" --adapter="slack" --defaults | |
RUN npm install --save hubot-slack | |
RUN npm install --save hubot-google-images | |
RUN npm install --save hubot-google-translate |
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
confirmations: | |
required: 4 # choose the number of confirmations you require | |
policyengine.simple: | |
fixedGasPrice: null | |
gasOracle: | |
mode: connector |
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
steps: | |
# build and push container | |
- name: "gcr.io/kaniko-project/executor:latest" | |
args: ["--cache=true", "--cache-ttl=48h", "--destination=gcr.io/$PROJECT_ID/$REPO_NAME:$BRANCH_NAME"] | |
# deploy container image to Cloud Run with env vars | |
- name: "gcr.io/cloud-builders/gcloud" | |
args: ['run', 'deploy', '$REPO_NAME', '--image', 'gcr.io/$PROJECT_ID/$REPO_NAME:$BRANCH_NAME', '--region', 'europe-west4', '--allow-unauthenticated', '--platform', 'managed', '--update-env-vars', 'NODE_ENV=prod'] | |
# set full traffic to latest revision (needed if rollback was performed) | |
- name: "gcr.io/cloud-builders/gcloud" | |
args: ['run', 'services', 'update-traffic', '$REPO_NAME', '--to-latest', '--region', 'europe-west4', '--platform', 'managed'] |
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
# File: cloudbuild.yaml | |
steps: | |
# build the container image | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/demo-app', '.' ] | |
# push the container image | |
- name: 'gcr.io/cloud-builders/docker' | |
args: [ 'push', 'gcr.io/$PROJECT_ID/demo-app'] | |
# deploy to Cloud Run | |
- name: "gcr.io/cloud-builders/gcloud" |
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
# File: .gitlab-ci.yml | |
image: docker:latest | |
stages: | |
- deploy | |
deploy: | |
stage: deploy | |
image: google/cloud-sdk | |
services: |
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
# garden.yml | |
kind: Project | |
name: flask-app | |
environments: | |
- name: dev | |
providers: | |
- name: kubernetes | |
context: gke_fullstackgcp_us-central1-c_my-dev-cluster | |
buildMode: cluster-docker | |
defaultEnvironment: dev |
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
# Configure GCP project | |
provider "google" { | |
project = "terraform-cr" | |
} | |
# Deploy image to Cloud Run | |
resource "google_cloud_run_service" "mywebapp" { | |
name = "mywebapp" | |
location = "us-central1" | |
template { |
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
FROM python:3.7-stretch | |
RUN apt-get update -y | |
RUN apt-get install -y python-pip python-dev build-essential | |
COPY . /app | |
WORKDIR /app | |
RUN pip install -r requirements.txt | |
ENTRYPOINT ["python"] | |
CMD ["main.py"] |
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
runtime: python37 |
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
from flask import jsonify | |
def hello_world(request): | |
"""Responds to any HTTP request. | |
""" | |
return jsonify({"message": "Hello World"}) |
NewerOlder