Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
version: 2.1
orbs:
shallow-checkout: datacamp/shallow-checkout@0.0.2
# TODO: Add the shallow checkout orb
# orbs:
# ruby: circleci/ruby@0.1.2

jobs:
build:
machine:
image: ubuntu-2004:202010-01
steps:
- checkout
- run:
name: Where are we?
command: pwd
- run:
name: Ensure docker exists
command: docker version
- run:
name: Login to DockerHub
command: |
docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD
- run:
name: Build and push image to DockerHub
command: |
IMAGE_NAME=icyflame2/cutouts
IMAGE_TAG=$CIRCLE_BRANCH-$CIRCLE_SHA1
IMAGE=$IMAGE_NAME:$IMAGE_TAG

docker build -t $IMAGE .
docker push $IMAGE

workflows:
version: 2
build_and_test:
jobs:
- build
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ COPY . /src
WORKDIR /src
RUN bundle install

RUN /src/run-tests.sh

ENTRYPOINT [ "/src/start-server.sh" ]
11 changes: 11 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if [ ! -d /node/bin ];
then
echo "Node must be present at node/bin"
exit 42
fi

export PATH="$PATH:/node/bin"
cd /src
bundle exec rails test