"Fossies" - the Fresh Open Source Software Archive

Member "buku-4.4/.circleci/config.yml" (15 Jun 2020, 3509 Bytes) of package /linux/privat/buku-4.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Ansible YAML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the last Fossies "Diffs" side-by-side code changes report for "config.yml": 4.2.2_vs_4.3.

    1 version: 2.1
    2 
    3 executors:
    4   docker-publisher:
    5     environment:
    6       IMAGE_NAME: bukuserver/bukuserver
    7     docker:
    8       - image: circleci/buildpack-deps:stretch
    9 
   10 test-template: &test-template
   11   working_directory: ~/Buku
   12   environment:
   13     CI_FORCE_TEST: 1
   14   steps:
   15     - run:
   16         command: |
   17           apt update && apt install -y --no-install-recommends git
   18           pip install --upgrade setuptools flake8 pylint
   19     - checkout
   20     - run:
   21         command: |
   22           pip install -e .[tests]
   23           pip install -r requirements.txt
   24           python3 -m flake8
   25           echo buku | xargs pylint --rcfile tests/.pylintrc
   26           find . -iname "*.py" ! -path "./api/*" | xargs pylint --rcfile tests/.pylintrc
   27           python3 -m pytest ./tests/test_*.py --cov buku -vv --durations=0
   28 
   29 jobs:
   30   py35:
   31     docker:
   32       - image: python:3.5-slim
   33     <<: *test-template
   34 
   35   py36:
   36     docker:
   37       - image: python:3.6-slim
   38     <<: *test-template
   39 
   40   py37:
   41     docker:
   42       - image: python:3.7-slim
   43     <<: *test-template
   44 
   45   py38:
   46     docker:
   47       - image: python:3.8-slim
   48     <<: *test-template
   49 
   50   package-and-publish:
   51     machine: true
   52     working_directory: ~/Buku
   53     steps:
   54       - checkout
   55       - run:
   56           name: "package with packagecore"
   57           command: |
   58             # Use latest installed python3 from pyenv
   59             export PYENV_VERSION="$(pyenv versions | grep -Po '\b3\.\d+\.\d+' | tail -1)"
   60             pip install packagecore
   61             packagecore -o ./dist/ ${CIRCLE_TAG#v}
   62       - run:
   63           name: "publish to GitHub"
   64           command: |
   65             go get github.com/tcnksm/ghr
   66             ghr -t ${GITHUB_API_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -replace ${CIRCLE_TAG} ./dist/
   67 
   68   build-docker-image:
   69     executor: docker-publisher
   70     steps:
   71       - checkout
   72       - setup_remote_docker
   73       - run:
   74           name: Build Docker image
   75           command: docker build -t $IMAGE_NAME:latest .
   76       - run:
   77           name: Archive Docker image
   78           command: docker save -o image.tar $IMAGE_NAME
   79       - persist_to_workspace:
   80           root: .
   81           paths:
   82             - ./image.tar
   83 
   84   publish-on-docker-hub:
   85     executor: docker-publisher
   86     steps:
   87       - attach_workspace:
   88           at: /tmp/workspace
   89       - setup_remote_docker
   90       - run:
   91           name: Load archived Docker image
   92           command: docker load -i /tmp/workspace/image.tar
   93       - run:
   94           name: Publish Docker Image to Docker Hub
   95           command: |
   96             echo "${DOCKERHUB_PASS}" | docker login -u "${DOCKERHUB_USERNAME}" --password-stdin
   97             docker push ${IMAGE_NAME}:latest
   98 
   99 workflows:
  100   version: 2.1
  101 
  102   test:
  103     jobs: &all-tests
  104       - py35
  105       - py36
  106       - py37
  107       - py38
  108 
  109   nightly:
  110     triggers:
  111       - schedule:
  112           cron: "0 0 * * 6"
  113           filters:
  114             branches:
  115               only:
  116                 - master
  117     jobs: *all-tests
  118 
  119   publish-github-release:
  120     jobs:
  121       - package-and-publish:
  122           filters:
  123             tags:
  124               only: /^v.*/
  125             branches:
  126               ignore: /.*/
  127 
  128   publish-docker-image:
  129     jobs:
  130       - build-docker-image:
  131           filters:
  132             tags:
  133               only: /^v.*/
  134             branches:
  135               ignore: /.*/
  136       - publish-on-docker-hub:
  137           requires:
  138             - build-docker-image
  139           filters:
  140             tags:
  141               only: /^v.*/
  142             branches:
  143               ignore: /.*/
  144