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
resource "aws_acm_certificate" "acm_cert" { | |
provider = aws.us-east-1 | |
domain_name = var.root_domain | |
subject_alternative_names = ["*.${var.root_domain}"] | |
validation_method = "DNS" | |
lifecycle { | |
create_before_destroy = true | |
} |
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
data "aws_route53_zone" "root_domain" { | |
name = var.root_domain | |
} | |
resource "aws_route53_zone" "sub_domain" { | |
name = var.site_domain | |
tags = { | |
name = var.tag | |
} | |
} |
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
locals { | |
s3_origin_id = "s3-origin-${var.site_domain}" | |
} | |
resource "aws_cloudfront_origin_access_identity" "site" { | |
comment = var.site_domain | |
} | |
resource "aws_cloudfront_distribution" "site" { | |
tags = { |
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
resource "aws_s3_bucket" "site" { | |
bucket = var.bucket_name | |
acl = "private" | |
tags = { | |
name = var.tag | |
} | |
force_destroy = true | |
versioning { | |
enabled = true |
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
name: Deploy Production | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
build: | |
runs-on: ubuntu-latest |
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
import { firestore } from 'firebase' | |
import { injectable, inject, Container } from 'inversify' | |
import { db } from '@/plugins/firebase' | |
import 'reflect-metadata' | |
class RestaurantDataModel { | |
constructor(init: any) { | |
this.id = init.id || this.id | |
this.clientUID = init.clientUID || this.clientUID | |
this.content = init.content || this.content |
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
steps: | |
# Build the container image | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['build', '-t', 'gcr.io/$PROJECT_ID/todo-notify', '-f', 'Dockerfile.prod', '.'] | |
# Push the image to Container Registry | |
- name: 'gcr.io/cloud-builders/docker' | |
args: ['push', 'gcr.io/$PROJECT_ID/todo-notify'] | |
# Deploy image to Cloud Run | |
- name: 'gcr.io/cloud-builders/gcloud' | |
args: ['beta', 'run', 'deploy', 'todo-notify', '--image', 'gcr.io/$PROJECT_ID/todo-notify', '--region', 'us-central1', '--platform', 'managed'] |
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 node:13 | |
WORKDIR /app | |
COPY ./app/package*.json ./ | |
COPY ./app/yarn.lock ./ | |
# Install production dependencies. | |
RUN yarn install --production |
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" | |
services: | |
node: | |
image: node:13 | |
volumes: | |
- ./app:/app:cached | |
working_dir: /app | |
env_file: | |
- .env | |
tty: true |
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
var precedences = map[token.TokenType]int{ | |
token.EQ: EQUALS, | |
token.NOT_EQ: EQUALS, | |
token.LT: LESSGRETER, | |
token.GT: LESSGRETER, | |
token.PLUS: SUM, | |
token.MINUS: SUM, | |
token.SLASH: PRODUCT, | |
token.ASTERISK: PRODUCT, | |
} |