Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic circle CI config #50

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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/[email protected]
# TODO: Add the shallow checkout orb
# orbs:
# ruby: circleci/[email protected]

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