Verified Commit 5782124e authored by Dom Sekotill's avatar Dom Sekotill
Browse files

Add test and release jobs to pipeline

parent 6cfa7834
Loading
Loading
Loading
Loading
+23 −1
Original line number Diff line number Diff line
@@ -37,6 +37,28 @@ Tag Release:
  - if: $CI_COMMIT_TAG =~ /^v[0-9]/
  script:
  - docker-reg $CI_REGISTRY_IMAGE/build:pipeline-$CI_PIPELINE_IID
    retag $CI_REGISTRY_IMAGE:${CI_COMMIT_TAG#v}
    retag $CI_REGISTRY_IMAGE:${VERSION}-py311
  - docker-reg $CI_REGISTRY_IMAGE/build:pipeline-$CI_PIPELINE_IID
    retag $CI_REGISTRY_IMAGE:latest

Check Component:
  stage: test
  image: badouralix/curl-jq
  script:
  - |
    jobs_endpoint="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/pipelines/${CI_PIPELINE_ID}/jobs"
    count=`
      curl --silent "$jobs_endpoint" |
      jq 'map(select(.name | contains("Pre-Commit Hooks"))) | length'
    `
    [ "$count" -eq 1 ] || exit 1

Create Release:
  stage: deploy
  image: registry.gitlab.com/gitlab-org/release-cli:latest
  rules:
  - if: $CI_COMMIT_TAG =~ /^v[0-9]/
  script: echo "Creating release $CI_COMMIT_TAG"
  release:
    tag_name: $CI_COMMIT_TAG
    description: "Release ${CI_COMMIT_TAG#v} of components repository $CI_PROJECT_PATH"