Skip to content

Commit

Permalink
Split build and release jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
Radek Lát committed Nov 3, 2021
1 parent b43f03c commit 8343963
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
21 changes: 19 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs: # A basic unit of work in a run
- checkout
- run:
name: Install dev libraries
command: pip3 install --upgrade pip poetry
command: pip3 install poetry
- run:
name: Check if build needed
command: |
Expand Down Expand Up @@ -107,6 +107,16 @@ jobs: # A basic unit of work in a run
name: Build and push docker image
command: |
poetry run inv docker-build
release:
working_directory: << pipeline.parameters.working_directory >>
docker:
- image: circleci/python:<< pipeline.parameters.python_version >>
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python<< pipeline.parameters.python_version >>/site-packages
- restore_cache:
key: << pipeline.parameters.cache_version >>-<< pipeline.parameters.project_name >>-<< pipeline.parameters.python_version >>-{{ checksum "poetry.lock" }}
- gh/setup
- run:
name: Tag release
Expand All @@ -124,9 +134,16 @@ workflows:
name: Build and push docker image
context:
- dockerhub
- github
requires:
- Tests
filters:
branches:
only: main
- release:
context:
- github
requires:
- Build and push docker image
filters:
branches:
only: main
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ FROM python:${PYTHON_VERSION}-slim

WORKDIR /app

RUN apt-get --allow-releaseinfo-change update
RUN apt-get install gcc g++ libssl-dev libffi-dev rustc -y
RUN apt-get --allow-releaseinfo-change update && \
apt-get install gcc g++ libssl-dev libffi-dev rustc -y && \
rm -rf /var/lib/apt/*
RUN python -m pip install --upgrade pip
RUN pip install poetry

Expand Down

0 comments on commit 8343963

Please sign in to comment.