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
cache: | |
directories: | |
- "$HOME/google-cloud-sdk/" | |
services: | |
- docker | |
before_deploy: | |
- if [ ! -d "$HOME/google-cloud-sdk/bin" ]; then rm -rf $HOME/google-cloud-sdk; export CLOUDSDK_CORE_DISABLE_PROMPTS=1; curl https://sdk.cloud.google.com | bash; fi | |
- source /home/travis/google-cloud-sdk/path.bash.inc | |
- gcloud --quiet version | |
- gcloud --quiet components update |
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
sudo: false | |
language: node_js | |
node_js: | |
- "node" | |
cache: | |
yarn: true | |
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
sudo: false | |
language: node_js | |
node_js: | |
- "node" | |
cache: | |
yarn: true | |
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
#!/bin/bash | |
set -e | |
docker build -t gcr.io/${PROJECT_PROD}/${NGINX_IMAGE}:$TRAVIS_COMMIT -f docker/nginx.dockerfile . | |
docker build -t gcr.io/${PROJECT_PROD}/${NODE_IMAGE}:$TRAVIS_COMMIT -f docker/node.dockerfile . | |
echo $GCLOUD_SERVICE_KEY_TEST | base64 --decode -i > ${HOME}/gcloud-service-key.json | |
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json |
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
apiVersion: v1 | |
kind: Secret | |
metadata: | |
name: node-secret | |
type: Opaque | |
data: | |
twitter-consumer-key: "output from [echo -n "your key" | base64]" | |
twitter-consumer-secret: "output from [echo -n "your secret" | base64]" | |
mongo-url: "output from [echo -n "mongodb://mongo:27017/sanata" | base64]" | |
--- |
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_PROD}/${NGINX_IMAGE}:$TRAVIS_COMMIT -f docker/nginx.dockerfile . | |
docker build -t gcr.io/${PROJECT_PROD}/${NODE_IMAGE}:$TRAVIS_COMMIT -f docker/node.dockerfile . | |
echo $GCLOUD_SERVICE_KEY_TEST | base64 --decode -i > ${HOME}/gcloud-service-key.json | |
gcloud auth activate-service-account --key-file ${HOME}/gcloud-service-key.json |
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
deploy: | |
- provider: script | |
script: ./deploy-prod.sh | |
on: | |
all_branches: true | |
condition: $TRAVIS_TAG =~ ^v[0-9]+\.[0-9]+\.[0-9]+ | |
- provider: script | |
script: ./deploy-test.sh | |
on: | |
branch: master |
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
export function createElement(type, config, ...args) { | |
const props = Object.assign({}, config); | |
if (args.length) { | |
props.children = [].concat(...args); | |
} | |
return { type, props }; | |
} | |
export function render(element, container) { | |
const instance = new DomComponent(element); |
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
export function createElement(type, config, ...args) { | |
const props = Object.assign({}, config); | |
if (args.length) { | |
props.children = [].concat(...args); | |
} | |
return { type, props }; | |
} | |
export function render(element, container) { | |
const instance = new DomComponent(element); |
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
function render(rootDom, element) { | |
const { type, props } = element; | |
const dom = document.createElement(type); | |
Object.keys(props).filter(isAttribute).forEach(name => { | |
dom[name] = props[name]; | |
}); | |
const children = props.children || []; | |
children.forEach(childElement => render(dom, childElement)); | |
rootDom.appendChild(dom); | |
} |