Commit e4568bbd authored by nimrod's avatar nimrod
Browse files

A bunch of templates.

Copied from existing projects.

- bats
- pypi upload
- docker-compose build and run
- gitlab release
- build presentations
parent 7263089a
Loading
Loading
Loading
Loading
Loading

templates/bats.yml

0 → 100644
+11 −0
Original line number Diff line number Diff line
---
bats:
  stage: test
  image: adarnimrod/ci-images:bats
  script:
    - bats tests/ | tee results.tap
  after_script:
    - ./juxr tap --name bats --output results/ -- cat results.tap
  artifacts:
    reports:
      junit: results/*.xml
+25 −0
Original line number Diff line number Diff line
---
.compose-build:
  image: adarnimrod/ci-images:docker
  stage: build
  variables:
    COMPOSE_DOCKER_CLI_BUILD: "1"
    DOCKER_BUILDKIT: "1"
  script:
    - docker-compose build --no-cache --pull
    - docker-compose pull --quiet

.compose-run:
  image: adarnimrod/ci-images:docker
  stage: run
  when: manual
  script:
    - docker-compose up --detach --remove-orphans
    # yamllint disable rule:line-length
    - |
        for i in $(seq 12)
        do
            docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$' || break
            sleep 10
        done
        ! docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$'
+13 −0
Original line number Diff line number Diff line
---
gitlab-release:
  stage: release
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  script:
    - !!str true
  rules:
    - if: $CI_COMMIT_TAG
  release:
    name: Release $CI_COMMIT_TAG
    tag_name: $CI_COMMIT_TAG
    ref: $CI_COMMIT_TAG
    description: Release $CI_COMMIT_TAG
+11 −0
Original line number Diff line number Diff line
---
build:
  stage: build
  image:
    name: adarnimrod/presentation
    entrypoint: [""]
  script:
    - make
  artifacts:
    paths:
      - '*.pdf'
+17 −0
Original line number Diff line number Diff line
---
pypi-upload:
  stage: release
  image: python:slim
  before_script:
    - pip install twine
    - mv "$pypirc" $HOME/.pypirc
  script:
    - python setup.py bdist_wheel
    - twine upload dist/*
  variables: *variables
  cache: *cache
  rules:
    - if: $CI_COMMIT_TAG
  artifacts:
    paths:
      - dist/*.whl