|
| 1 | +version: 2.1 |
| 2 | +orbs: |
| 3 | + anchore: anchore/anchore-engine@1.3.0 |
| 4 | +jobs: |
| 5 | + "test": |
| 6 | + docker: |
| 7 | + - image: circleci/python:3.7.0 |
| 8 | + working_directory: ~/fdk-python |
| 9 | + steps: |
| 10 | + - checkout |
| 11 | + - restore_cache: |
| 12 | + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }} |
| 13 | + - setup_remote_docker: |
| 14 | + docker_layer_caching: true |
| 15 | + - run: |
| 16 | + command: | |
| 17 | + python3 -m venv venv |
| 18 | + . venv/bin/activate |
| 19 | + pip install tox |
| 20 | + pip install -r requirements.txt |
| 21 | + - run: docker version |
| 22 | + - run: docker pull fnproject/fnserver |
| 23 | + - save_cache: |
| 24 | + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }} |
| 25 | + paths: |
| 26 | + - "venv" |
| 27 | + - run: |
| 28 | + command: | |
| 29 | + . venv/bin/activate |
| 30 | + tox -epep8 |
| 31 | + - run: |
| 32 | + command: | |
| 33 | + . venv/bin/activate |
| 34 | + tox -epy3.7 |
| 35 | + "deploy": |
| 36 | + docker: |
| 37 | + - image: circleci/python:3.7.0 |
| 38 | + working_directory: ~/fdk-python |
| 39 | + steps: |
| 40 | + - checkout |
| 41 | + - restore_cache: |
| 42 | + key: deps1-{{ .Branch }}-{{ checksum "requirements.txt" }} |
| 43 | + - setup_remote_docker: |
| 44 | + docker_layer_caching: true |
| 45 | + - deploy: |
| 46 | + # TODO(denismakogon): add pypi release here as well |
| 47 | + command: | |
| 48 | + if [[ "${CIRCLE_BRANCH}" == "master" && -z "${CIRCLE_PR_REPONAME}" ]]; then |
| 49 | + printenv DOCKER_PASS | docker login -u $DOCKER_USER --password-stdin |
| 50 | + ./build-images.sh 3.6 |
| 51 | + ./build-images.sh 3.7.1 |
| 52 | + ./release_images.sh |
| 53 | + fi |
| 54 | +
|
| 55 | + "python36_security_check": |
| 56 | + executor: anchore/anchore_engine |
| 57 | + working_directory: ~/fdk-python |
| 58 | + steps: |
| 59 | + - setup_remote_docker: |
| 60 | + docker_layer_caching: true |
| 61 | + - checkout |
| 62 | + - run: |
| 63 | + name: Python 3.6 build |
| 64 | + command: | |
| 65 | + apk add bash |
| 66 | + ./build-images.sh 3.6 |
| 67 | + - anchore/analyze_local_image: |
| 68 | + image_name: "fnproject/python:3.6-dev fnproject/python:3.6" |
| 69 | + timeout: '500' |
| 70 | + policy_failure: true |
| 71 | + policy_bundle_file_path: .circleci/.anchore/policy_bundle.json |
| 72 | + - anchore/parse_reports |
| 73 | + |
| 74 | + "python371_security_check": |
| 75 | + executor: anchore/anchore_engine |
| 76 | + working_directory: ~/fdk-python |
| 77 | + steps: |
| 78 | + - setup_remote_docker: |
| 79 | + docker_layer_caching: true |
| 80 | + - checkout |
| 81 | + - run: |
| 82 | + name: Python 3.7.1 build |
| 83 | + command: | |
| 84 | + apk add bash |
| 85 | + ./build-images.sh 3.7.1 |
| 86 | + - anchore/analyze_local_image: |
| 87 | + image_name: "fnproject/python:3.7.1-dev fnproject/python:3.7.1" |
| 88 | + timeout: '500' |
| 89 | + policy_failure: true |
| 90 | + policy_bundle_file_path: .circleci/.anchore/policy_bundle.json |
| 91 | + - anchore/parse_reports |
| 92 | + |
| 93 | +workflows: |
| 94 | + version: 2 |
| 95 | + build: |
| 96 | + jobs: |
| 97 | + - "test" |
| 98 | + commit: |
| 99 | + jobs: |
| 100 | + - "test" |
| 101 | + - "deploy" |
| 102 | + nightly: |
| 103 | + triggers: |
| 104 | + - schedule: |
| 105 | + cron: "0 0 * * *" |
| 106 | + filters: |
| 107 | + branches: |
| 108 | + only: |
| 109 | + - master |
| 110 | + jobs: |
| 111 | + - "python36_security_check" |
| 112 | + - "python371_security_check" |
0 commit comments