diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e0a10c3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM node:4-alpine + +WORKDIR /root + +COPY package.json npm-shrinkwrap.json ./ + +RUN apk update \ + && apk upgrade \ + && apk add bash \ + && npm install \ + && mv node_modules node_modules_cache \ + && rm -r package.json npm-shrinkwrap.json /tmp/* diff --git a/buildspec.yml b/buildspec.yml index fee7e4f..25e052a 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -1,12 +1,21 @@ version: 0.2 phases: + pre_build: + commands: + - aws ecr get-login-password --region us-west-2 | docker login --username AWS --password-stdin 840814869112.dkr.ecr.us-west-2.amazonaws.com install: commands: - npm install build: commands: - npm test + - docker build -t eshdutta-repo . + - docker tag eshdutta-repo:latest 840814869112.dkr.ecr.us-west-2.amazonaws.com/eshdutta-repo:latest + post_build: + commands: + - docker push 840814869112.dkr.ecr.us-west-2.amazonaws.com/eshdutta-repo:latest + artifacts: files: - '**/*' diff --git a/dummy.txt b/dummy.txt new file mode 100644 index 0000000..98f3383 --- /dev/null +++ b/dummy.txt @@ -0,0 +1 @@ +