confs:gitlab

Gitlab

image: docker:stable

before_script:
    - docker info

build:
    stage: build
    script:
        - cat ${PASSWORD} | docker login -u <login> --password-stdin <hub>
        - docker build -t <hub>/<img> .
        - docker push <hub>/<img>

In your README.md you can include an image with:

![pylint](https://NAMESPACE.gitlab.io/pyling.svg)

If you want to make the image into a link you can use:

[![pylint](https://NAMESPACE.gitlab.io/pyling.svg)](LINKTARGET)
  • gitlab-ci.yml:
pylint:
  stage: test
  script:
    - pylint --rcfile=.pylintrc --output-format=text <LIST-OF-FILES-TO-RUN-PYLINT-AGAINST> | tee pylint.txt
    - score=$(sed -n 's/^Your code has been rated at \([-0-9.]*\)\/.*/\1/p' pylint.txt)
    - echo "Pylint score was $score"
    - anybadge --value=$score --file=public/pylint.svg pylint
  artifacts:
    paths:
      - public/pylint.svg

pages:
  stage: deploy
  artifacts:
    paths:
    - public
  only:
  - master
  • confs/gitlab.txt
  • Last modified: 2024/10/14 20:59
  • by 127.0.0.1