Skip to content

Commit

Permalink
Merge pull request #234 from agrantdeakin/config/circleci-to-codefresh
Browse files Browse the repository at this point in the history
CONFIG: Migrate from CirclieCI to Codefresh [DEVSECOPS-114]
  • Loading branch information
AkshatBajaj committed Jul 1, 2020
2 parents e006403 + 5eb9cbe commit ee81f0f
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 70 deletions.
70 changes: 0 additions & 70 deletions .circleci/config.yml

This file was deleted.

67 changes: 67 additions & 0 deletions codefresh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# More examples of Codefresh YAML can be found at
# https://codefresh.io/docs/docs/yaml-examples/examples/

version: "1.0"
# Stages can help you organize your steps in stages
stages:
- "clone"
- "test"
- "release"

steps:
clone:
title: "Cloning repository"
type: "git-clone"
repo: "a2i2/surround"
# CF_BRANCH value is auto set when pipeline is triggered
# Learn more at codefresh.io/docs/docs/codefresh-yaml/variables/
revision: "${{CF_BRANCH}}"
git: "github"
stage: "clone"

test:
title: "Run Python tests"
type: "freestyle" # Run any command
image: "python:3.6.10" # The image in which command will be executed
working_directory: "${{clone}}" # Running command where code cloned
commands:
# Install surround
- python3 setup.py install

# Run tests
- python3 setup.py test

# Run pylint tests
- pylint setup.py
- find surround/ -iname "*.py" | xargs pylint
- find examples/ -iname "*.py" | xargs pylint

# Run examples
- ls examples/ | xargs -n 1 -I '{}' python3 examples/'{}'/main.py
stage: "test"

release:
title: "Release to Pypi"
type: "freestyle" # Run any command
image: "python:3.6.10" # The image in which command will be executed
working_directory: "${{clone}}" # Running command where code cloned
commands:
# Install required packages
- python3 -m pip install --user --upgrade setuptools wheel twine

# Setup Pypi config
- echo "[pypi]" > ~/.pypirc
- echo "repository=https://upload.pypi.org/legacy/" >> ~/.pypirc
- echo "username=${{PYPI_USERNAME}}" >> ~/.pypirc
- echo "password=${{PYPI_PASSWORD}}" >> ~/.pypirc

# Build package
- VERSION_TAG=$(git tag -l --points-at HEAD) python3 setup.py sdist bdist_wheel

# Upload package for distribution
- python3 -m twine upload --repository pypi dist/*
when:
branch:
only:
- /([0-9]+)\.([0-9]+)\.([0-9]+)?$/
stage: "release"

0 comments on commit ee81f0f

Please sign in to comment.