Skip to content

Commit

Permalink
Move to Circle 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
patrys committed Jun 29, 2018
1 parent 9769408 commit 83e9166
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 39 deletions.
39 changes: 39 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
version: 2
jobs:
build:
working_directory: /app
docker:
- image: docker:17.09.0-ce-git
steps:
- checkout
- setup_remote_docker:
docker_layer_caching: true
- run:
name: Set version
command: |
sed -i.bak "s#'dev'#'$(git describe --tags)'#" saleor/__init__.py
- run:
name: Build application Docker image
command: |
docker build --cache-from=mirumee/saleor:latest -t mirumee/saleor:latest .
environment:
STATIC_URL: https://saleor-demo.s3.amazonaws.com/assets/
- run:
name: Run tests
command: |
docker run -d --name db circleci/postgres:latest
docker run --network container:db --rm -e DATABASE_URL -e DJANGO_SETTINGS_MODULE -e SECRET_KEY mirumee/saleor:latest /app/virtualenv/bin/pytest
environment:
DATABASE_URL: postgres://root:@localhost:5432/circle_test
DJANGO_SETTINGS_MODULE: saleor.settings
SECRET_KEY: irrelevant
- deploy:
name: Push Docker image
command: |
if [ "${CIRCLE_TAG}" == demo* ]; then
docker login -e $DOCKERCLOUD_EMAIL -u $DOCKERCLOUD_USER -p $DOCKERCLOUD_PASS
docker tag mirumee/saleor:latest mirumee/saleor:$CIRCLE_SHA1
docker push mirumee/saleor:$CIRCLE_SHA1
docker push mirumee/saleor:latest
curl -X POST https://circleci.com/api/v1.1/project/github/mirumee/saleor-demo?circle-token=$CIRCLE_API_TOKEN
fi
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
.*
**/*.pyc
*.sqlite
media
node_modules
static
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
*.py[cod]
.*
!.babelrc
!.circleci
!.codeclimate.yml
!.coveragerc
!.dockerignore
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ COPY --from=build-nodejs /app/templates /app/templates
WORKDIR /app

RUN useradd --system saleor && \
mkdir -p /app/media /app/static && \
mkdir /app/media /app/static && \
chown -R saleor:saleor /app/media /app/static

USER saleor
Expand Down
38 changes: 0 additions & 38 deletions circle.yml

This file was deleted.

0 comments on commit 83e9166

Please sign in to comment.