-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path.gitlab-ci-check-commits.yml
35 lines (33 loc) · 1.21 KB
/
.gitlab-ci-check-commits.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
stages:
- test
test:check-commits:
tags:
- hetzner-amd-beefy
stage: test
needs: []
except:
- /^(master|hosted|staging|production|saas-v[0-9.]+|[0-9]+\.[0-9]+\.x|[0-9]+\.[0-9]+\.[0-9]+)$/
image: ${CI_DEPENDENCY_PROXY_DIRECT_GROUP_IMAGE_PREFIX}/alpine
variables:
GIT_STRATEGY: clone # clone entire repo instead of reusing workspace
GIT_DEPTH: 0 # avoid shallow clone, this test requires full git history
before_script:
# Install dependencies
- apk add --no-cache git bash gawk
# Rename the branch we're on, so that it's not in the way for the
# subsequent fetch. It's ok if this fails, it just means we're not on any
# branch.
- git branch -m temp-branch || true
# Git trick: Fetch directly into our local branches instead of remote
# branches.
- git fetch -f origin 'refs/heads/*:refs/heads/*'
# Get last remaining tags, if any.
- git fetch --tags origin
- if [ "${CI_PROJECT_NAME}" = "mendertesting" ]; then
- git clone --shared --local . /tmp/mendertesting
- else
- git clone --depth=1 https://github.com/mendersoftware/mendertesting /tmp/mendertesting
- fi
script:
# Check commit compliance.
- /tmp/mendertesting/check_commits.sh