This file contains hidden or 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
#!/bin/bash | |
set -e | |
docker build -t gcr.io/${PROJECT_DEV}/${IMAGE_NAME}:$TRAVIS_COMMIT . | |
echo $GCLOUD_SERVICE_KEY_DEV | base64 --decode -i > ${HOME}/gcloud-service-key.json | |
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json | |
gcloud --quiet config set project $PROJECT_DEV |
This file contains hidden or 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
dist: trusty | |
sudo: false | |
cache: | |
directories: | |
- "$HOME/google-cloud-sdk/" | |
services: | |
- docker |
This file contains hidden or 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
version: "3.5" | |
services: | |
nginx1: | |
image: nginx:1.13.3 | |
volumes: | |
- ./nginx/local.nginx.conf:/etc/nginx/nginx.conf | |
depends_on: | |
- api | |
links: | |
- api:api |
This file contains hidden or 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 Flask | |
from flask import jsonify | |
from time import sleep | |
from datetime import datetime | |
app = Flask(__name__) | |
@app.route("/") | |
def hello(): |
This file contains hidden or 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
{ | |
"type": "object", | |
"properties": { | |
"name": { | |
"type": "string" | |
} | |
}, | |
"required": [ "name" ] | |
} |
This file contains hidden or 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 jsonschema import validate | |
from jsonschema import FormatChecker | |
data = { | |
"name": "Ricardo", | |
"image": "https://www.ricardobaltazar.com/static/principal/images/profilepic-new.jpg", | |
"age": 37, | |
"birth_date": "1981-06-21T12:42:31+00:32" | |
} |
This file contains hidden or 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
expected_result = { | |
"name": "Ricardo", | |
"image": "https://www.ricardobaltazar.com/static/principal/images/profilepic-new.jpg", | |
"age": 37, | |
"birth_date": "1981-06-21T12:42:31+00:32" | |
} | |
result = client.get("/user/info") | |
self.assertDictEqual(result.json, expected_result) |
This file contains hidden or 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 ubuntu:16.10 | |
MAINTAINER Ricardo Baltazar Chaves <[email protected]> | |
RUN apt-get update | |
RUN apt-get -y upgrade | |
RUN apt-get install -y python3.6 python-pip | |
#https://hub.docker.com/r/ricardobchaves6/myubuntu16-10/ |
This file contains hidden or 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 string import Template | |
class MyOtherTemplate(Template): | |
delimiter = "#" | |
data = dict(id = 1, name = "Ricardo") | |
t = MyOtherTemplate("My name is #name and I have the id: #id") | |
print(t.substitute(data)) |
NewerOlder