mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-24 02:49:07 +01:00
CI: fix handling shallow clone
This commit is contained in:
parent
0eb73ee5bf
commit
5f36a56d48
1 changed files with 20 additions and 8 deletions
|
@ -124,6 +124,9 @@ build:debian-stable:
|
||||||
- .cache/pip
|
- .cache/pip
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
|
before_script:
|
||||||
|
# Gitlab CI use shallow clone, but we need full history to generate changelog
|
||||||
|
- git fetch --unshallow
|
||||||
script:
|
script:
|
||||||
- ./build-deb.sh --install-build-deps
|
- ./build-deb.sh --install-build-deps
|
||||||
- rm -fr dist/ldapsaisie-*
|
- rm -fr dist/ldapsaisie-*
|
||||||
|
@ -140,6 +143,9 @@ build:debian-sid:
|
||||||
- .cache/pip
|
- .cache/pip
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
before_script:
|
||||||
|
# Gitlab CI use shallow clone, but we need full history to generate changelog
|
||||||
|
- git fetch --unshallow
|
||||||
script:
|
script:
|
||||||
- ./build-deb.sh --install-build-deps --sid
|
- ./build-deb.sh --install-build-deps --sid
|
||||||
- rm -fr dist/ldapsaisie-*
|
- rm -fr dist/ldapsaisie-*
|
||||||
|
@ -171,11 +177,14 @@ build:doc:html:
|
||||||
- apk add make git
|
- apk add make git
|
||||||
- git config user.name $GITLAB_USER_NAME
|
- git config user.name $GITLAB_USER_NAME
|
||||||
- git config user.email $GITLAB_USER_EMAIL
|
- git config user.email $GITLAB_USER_EMAIL
|
||||||
|
# Compute current version
|
||||||
|
# Note: Gitlab CI use shallow clone, be sure to have all commits since latest tag
|
||||||
- |
|
- |
|
||||||
VERSION=$(
|
git fetch --tags
|
||||||
git describe --tags 2> /dev/null || \
|
latest_tag_commit=$(git rev-list --tags --max-count=1)
|
||||||
echo "0.0-$( git log --oneline|wc -l )-$( git describe --tags --always )"
|
commit_date=$(git show -s --format="%ad" --date=short $latest_tag_commit)
|
||||||
)
|
git fetch --shallow-since=$commit_date
|
||||||
|
VERSION=$(git describe --tags)
|
||||||
- cd doc
|
- cd doc
|
||||||
- git fetch origin $DOC_BRANCH
|
- git fetch origin $DOC_BRANCH
|
||||||
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"
|
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"
|
||||||
|
@ -240,11 +249,14 @@ build:doc:append_additional_versions:
|
||||||
- apk add git
|
- apk add git
|
||||||
- git config user.name $GITLAB_USER_NAME
|
- git config user.name $GITLAB_USER_NAME
|
||||||
- git config user.email $GITLAB_USER_EMAIL
|
- git config user.email $GITLAB_USER_EMAIL
|
||||||
|
# Compute current version
|
||||||
|
# Note: Gitlab CI use shallow clone, be sure to have all commits since latest tag
|
||||||
- |
|
- |
|
||||||
VERSION=$(
|
git fetch --tags
|
||||||
git describe --tags 2> /dev/null || \
|
latest_tag_commit=$(git rev-list --tags --max-count=1)
|
||||||
echo "0.0-$( git log --oneline|wc -l )-$( git describe --tags --always )"
|
commit_date=$(git show -s --format="%ad" --date=short $latest_tag_commit)
|
||||||
)
|
git fetch --shallow-since=$commit_date
|
||||||
|
VERSION=$(git describe --tags)
|
||||||
- cd doc
|
- cd doc
|
||||||
- git fetch origin $DOC_BRANCH
|
- git fetch origin $DOC_BRANCH
|
||||||
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"
|
- git rev-parse --verify $DOC_BRANCH && git branch -D $DOC_BRANCH || echo "No existing local git $DOC_BRANCH branch"
|
||||||
|
|
Loading…
Reference in a new issue