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
| const AWS = require("aws-sdk"); | |
| const crypto = require("crypto"); | |
| // Generate unique id with no external dependencies | |
| const generateUUID = () => crypto.randomBytes(16).toString("hex"); | |
| // Initialising the DynamoDB SDK | |
| const documentClient = new AWS.DynamoDB.DocumentClient(); | |
| exports.handler = async event => { |
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: 0.2 | |
| phases: | |
| install: | |
| runtime-versions: | |
| nodejs: 10 # (1) | |
| commands: | |
| - echo "$DOCKER_PASS" | docker login -u "$DOCKER_USER" --password-stdin # (2) | |
| pre_build: | |
| commands: |
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
| - pipeline: "CI Blog Post" | |
| trigger_mode: "ON_EVERY_PUSH" | |
| ref_name: "master" | |
| ref_type: "BRANCH" | |
| trigger_condition: "ALWAYS" | |
| actions: | |
| - action: "Execute: yarn test" | |
| type: "BUILD" | |
| working_directory: "/buddy/ci-comparison-blog" | |
| docker_image_name: "library/node" |
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
| language: node_js # (1) | |
| node_js: | |
| - 'node' | |
| services: | |
| - docker # (2) | |
| jobs: | |
| include: | |
| - stage: test | |
| script: | |
| - npm install # (3) |
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
| image: node:latest # (1) | |
| stages: | |
| - build | |
| - test | |
| - docker-deploy-image | |
| - aws-deploy | |
| cache: | |
| paths: |
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
| branch-defaults: | |
| master: | |
| environment: CiComparisonBlog-env | |
| environment-defaults: | |
| CiComparisonBlog-env: | |
| branch: null | |
| repository: null | |
| global: | |
| application_name: CI Comparison Blog | |
| default_ec2_keyname: null |
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: 2 | |
| jobs: | |
| test: | |
| working_directory: ~/app | |
| docker: | |
| - image: circleci/node:latest # (1) | |
| steps: | |
| - checkout | |
| - run: | |
| name: Update npm |
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
| const addOne = (input) => { | |
| return input +=1; | |
| )} // Notice the rogue ')' here |
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
| { | |
| "AWSEBDockerrunVersion": "1", | |
| "Image": { | |
| "Name": "andrewbest/node-docker-eb" | |
| }, | |
| "Ports": [ | |
| { | |
| "ContainerPort": "3000" | |
| } | |
| ] |
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
| # Use an official Node runtime as a parent image | |
| FROM node:12.7.0-alpine | |
| # Set the working directory to /app | |
| WORKDIR '/app' | |
| # Copy package.json to the working directory | |
| COPY package.json . | |
| # Install any needed packages specified in package.json |