Skip to content

Commit

Permalink
further runtime optimization for CI
Browse files Browse the repository at this point in the history
  • Loading branch information
izelnakri committed Mar 1, 2020
1 parent 92616f0 commit 113ce09
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 44 deletions.
8 changes: 2 additions & 6 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: 2
jobs:
test:
docker:
- image: docker:stable-git
- image: docker/compose:alpine-1.26.0-rc2
working_directory: /code
steps:
- checkout
Expand All @@ -16,14 +16,10 @@ jobs:
command: |
DOCKER_TAG=$(echo paper_trail:${CIRCLE_BRANCH} | tr '/' '_')
DOCKER_TARGET_REMOTE="${HUB_USERNAME}/${DOCKER_TAG}"
sed -i $(echo "s/\$DOCKER_TAG/$DOCKER_TAG/g") /code/.env
echo $HUB_KEY | docker login -u $HUB_USERNAME --password-stdin
docker tag paper_trail "${DOCKER_TARGET_REMOTE}"
docker push "${DOCKER_TARGET_REMOTE}"
- run:
name: Pull and run a docker container
command: |
apk add docker-compose
sed -i $(echo "s/\$CIRCLE_BRANCH/$CIRCLE_BRANCH/g") /code/.env
- run: docker-compose run paper_trail mix test test/paper_trail
- run: docker-compose run paper_trail mix test test/version
- run: docker-compose run paper_trail mix test test/uuid
Expand Down
5 changes: 3 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ POSTGRES_HOST=localhost
PG_HOST=localhost
MIX_ENV=test
# CIRCLE_BRANCH=$$(if [ -v CIRCLE_BRANCH ]; then echo master; else git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'; fi)
CIRCLE_BRANCH=$CIRCLE_BRANCH
DOCKER_TAG=$(echo paper_trail:${CIRCLE_BRANCH} | tr '/' '_')
# DOCKER_TARGET_REMOTE=inakri/paper_trail:master
DOCKER_TAG=$DOCKER_TAG
# DOCKER_TAG=$(echo paper_trail:${CIRCLE_BRANCH} | tr '/' '_')
34 changes: 0 additions & 34 deletions circle.yml

This file was deleted.

4 changes: 2 additions & 2 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ services:
volumes:
- pgdata:/var/lib/postgresql/data
paper_trail:
image: inakri/paper_trail:$CIRCLE_BRANCH
image: inakri/$DOCKER_TAG
build:
context: .
dockerfile: Dockerfile
cache_from:
- inakri/paper_trail:$CIRCLE_BRANCH
- inakri/$DOCKER_TAG
environment:
POSTGRES_USER: $POSTGRES_USER
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
Expand Down

0 comments on commit 113ce09

Please sign in to comment.