Compare commits

..

No commits in common. "4dc7ec53e3ead1c6425f77ab80e0507f72bd1da9" and "74d7ceea1bd3b9801563134d948f172b015558ab" have entirely different histories.

4 changed files with 35 additions and 105 deletions

View File

@ -4,73 +4,26 @@ type: docker
name: main name: main
steps: steps:
- name: fetch tags - name: Tag commit
image: alpine/git image: alpine
commands: commands:
- git fetch --tags - echo This would create a tag
- name: update version and changelog
image: registry.riba-interactive.de/conventi:1
- name: commit changelog updates
image: alpine/git
commands:
- git add .
- git commit -m "[CI SKIP] version and changelog update"
- name: tag commit
image: registry.riba-interactive.de/conventi:1
commands:
- export version=$(conventi.sh get_version)
- git tag -am "Tagging new version $version" "$version"
- git push origin "$version"
trigger: trigger:
branch: branch:
- main - main
event:
- push
--- ---
kind: pipeline kind: pipeline
type: docker type: docker
name: tag name: develop
steps: steps:
- name: Build release - name: Tag commit
image: registry.riba-interactive.de/alpine-build:1
commands:
- cmake -S. -Bcmake-build-ci -DCMAKE_BUILD_TYPE=Release
- cd cmake-build-ci
- cmake --build .
- echo "Done"
trigger:
event:
- tag
---
kind: pipeline
type: docker
name: Build and Test
steps:
- name: Build and run tests
image: registry.riba-interactive.de/alpine-build:1
commands:
- cmake -S. -Bcmake-build-ci -DCMAKE_BUILD_TYPE=Debug -DENABLE_TEST_COVERAGE=on
- cd cmake-build-ci
- cmake --build .
- ctest -T Test -T Coverage
- name: Report test and coverage
image: alpine image: alpine
commands: commands:
- echo "Do some curl or so" - echo This would build the app and run test
when:
event:
- pull_request
trigger: trigger:
branch: branch:
- develop - develop
- feature/*
image_pull_secrets:
- dockerconfig
... ...

View File

@ -1,7 +0,0 @@
FROM alpine:3.16.0
RUN apk --no-cache add \
bison \
build-base \
cmake \
flex

View File

@ -1,13 +0,0 @@
FROM alpine:3.16.0
RUN apk --no-cache add \
git \
jq
COPY conventi.sh /usr/local/bin/
VOLUME /conventi
WORKDIR /conventi
ENTRYPOINT ["/usr/local/bin/conventi.sh"]
CMD [""]

View File

@ -199,9 +199,9 @@ get_breaking_change() {
format_entry_line() { format_entry_line() {
line="" line=""
if [ -n "$2" ]; then if [ -n "$2" ]; then
line="**$2:** " line="**$2:**"
fi fi
line="$line$1" line="$line $1"
echo "$line ([$3]($(get_config_url)/commit/$3))" | sed -e '2,$s/^[ ]*/ /' echo "$line ([$3]($(get_config_url)/commit/$3))" | sed -e '2,$s/^[ ]*/ /'
} }
@ -230,39 +230,39 @@ add_changelog_entry_line() {
;; ;;
build) build)
build_lines=$(printf '%s\n* %s\n' "$build_lines" "$2") build_lines="$build_lines\n* $2\n"
;; ;;
chore) chore)
chore_lines=$(printf '%s\n* %s\n' "$chore_lines" "$2") chore_lines="$chore_lines\n* $2\n"
;; ;;
ci) ci)
ci_lines=$(printf '%s\n* %s\n' "$ci_lines" "$2") ci_lines="$ci_lines\n* $2\n"
;; ;;
doc_lines) doc_lines)
doc_lines=$(printf '%s\n* %s\n' "$doc_lines" "$2") doc_lines="$doc_lines\n* $2\n"
;; ;;
style) style)
style_lines=$(printf '%s\n* %s\n' "$style_lines" "$2") style_lines="$style_lines\n* $2\n"
;; ;;
refactor) refactor)
refactor_lines=$(printf '%s\n* %s\n' "$refactor_lines" "$2") refactor_lines="$refactor_lines\n* $2\n"
;; ;;
perf) perf)
perf_lines=$(printf '%s\n* %s\n' "$perf_lines" "$2") perf_lines="$perf_lines\n* $2\n"
;; ;;
test) test)
test_lines=$(printf '%s\n* %s\n' "$test_lines" "$2") test_lines="$test_lines\n* $2\n"
;; ;;
revert) revert)
revert_lines=$(printf '%s\n* %s\n' "$revert_lines" "$2") revert_lines="$revert_lines\n* $2\n"
;; ;;
esac esac
} }
@ -270,43 +270,44 @@ add_changelog_entry_line() {
format_entry() { format_entry() {
entry="" entry=""
if [ -n "$breaking_change_lines" ]; then if [ -n "$breaking_change_lines" ]; then
entry=$(printf '%s\n\n\n### BREAKING CHANGES 🚨\n%s\n' "$entry" "$breaking_change_lines") entry="$entry### BREAKING CHANGES\n$breaking_change_lines\n\n"
fi fi
if [ -n "$bugfix_lines" ]; then if [ -n "$bugfix_lines" ]; then
entry=$(printf '%s\n\n\n### Bug fixes 🩹\n%s\n' "$entry" "$bugfix_lines") entry="$entry### Bug fixes\n$bugfix_lines\n\n"
fi fi
if [ -n "$feature_lines" ]; then if [ -n "$feature_lines" ]; then
entry=$(printf '%s\n\n\n### Features 📦\n%s\n' "$entry" "$feature_lines") #entry="$entry### Features\n$feature_lines\n\n"
entry=$(printf '%s### Features\n%s\n\n' "$entry" "$feature_lines")
fi fi
if [ -n "$revert_lines" ]; then if [ -n "$revert_lines" ]; then
entry=$(printf '%s\n\n\n### Reverts 🔙\n%s\n' "$entry" "$revert_lines") entry="$entry### Reverts\n$revert_lines\n\n"
fi fi
if [ -n "$build_lines" ]; then if [ -n "$build_lines" ]; then
entry=$(printf '%s\n\n\n### Build System 🏗\n%s\n' "$entry" "$build_lines") entry="$entry### Build System\n$build_lines\n\n"
fi fi
if [ -n "$chore_lines" ]; then if [ -n "$chore_lines" ]; then
entry=$(printf '%s\n\n\n### Chores 🧽\n%s\n' "$entry" "$chore_lines") entry="$entry### Chores\n$chore_lines\n\n"
fi fi
if [ -n "$ci_lines" ]; then if [ -n "$ci_lines" ]; then
entry=$(printf '%s\n\n\n### CIs ⚙️\n%s\n' "$entry" "$ci_lines") entry="$entry### CIs\n$ci_lines\n\n"
fi fi
if [ -n "$doc_lines" ]; then if [ -n "$doc_lines" ]; then
entry=$(printf '%s\n\n\n### Docs 📑\n%s\n' "$entry" "$doc_lines") entry="$entry### Docs\n$doc_lines\n\n"
fi fi
if [ -n "$test_lines" ]; then if [ -n "$test_lines" ]; then
entry=$(printf '%s\n\n\n### Tests 🧪\n%s\n' "$entry" "$test_lines") entry="$entry### Tests\n$test_lines\n\n"
fi fi
if [ -n "$style_lines" ]; then if [ -n "$style_lines" ]; then
entry=$(printf '%s\n\n\n### Styles 🖼\n%s\n' "$entry" "$style_lines") entry="$entry### Styles\n$style_lines\n\n"
fi fi
if [ -n "$refactor_lines" ]; then if [ -n "$refactor_lines" ]; then
entry=$(printf '%s\n\n\n### Refactors 🛠\n%s\n' "$entry" "$refactor_lines") entry="$entry### Refactors\n$refactor_lines\n\n"
fi fi
if [ -n "$perf_lines" ]; then if [ -n "$perf_lines" ]; then
entry=$(printf '%s\n\n\n### Performance 🏎\n%s\n' "$entry" "$perf_lines") entry="$entry### Perfs\n$perf_lines\n\n"
fi fi
if [ -n "$entry" ]; then if [ -n "$entry" ]; then
entry=$(printf '## [%s](%s/compare/%s...%s) (%s)%s' "$version" "$(get_config_url)" "$from_hash" "$to_hash" "$(date '+%Y-%m-%d')" "$entry") entry="## [$version]($(get_config_url)/compare/$from_hash...$to_hash) ($(date '+%Y-%m-%d'))\n\n\n$entry"
fi fi
echo "$entry" echo "$entry"
} }
@ -338,17 +339,13 @@ generate_changelog_entry() {
line=$(format_entry_line "$description" "$scope" "$hash") line=$(format_entry_line "$description" "$scope" "$hash")
if [ "$is_breaking" -eq 1 ] && [ -z "$breaking_change" ]; then if [ "$is_breaking" -eq 1 ] && [ -z "$breaking_change" ]; then
if [ -n "$body" ]; then
breaking_change="$body" breaking_change="$body"
else
breaking_change="$description"
fi
fi fi
if [ "$is_breaking" -eq 1 ]; then if [ "$is_breaking" -eq 1 ]; then
is_major=1 is_major=1
breaking_change=$(echo "$breaking_change" | sed -e '2,$s/^[ ]*/ /') breaking_change=$(echo "$breaking_change" | sed -e '2,$s/^[ ]*/ /')
breaking_change_lines=$(printf '%s\n* %s\n' "$breaking_change_lines" "$breaking_change") breaking_change_lines="$breaking_change_lines\n* $breaking_change\n"
fi fi
case "$type" in case "$type" in
@ -389,9 +386,9 @@ new_changelog_entry() {
changelog=$(sed -n '/^----/,//{/^----/!p;}' <$changelog_file) changelog=$(sed -n '/^----/,//{/^----/!p;}' <$changelog_file)
if [ -n "$changelog" ]; then if [ -n "$changelog" ]; then
changelog=$(printf '%s\n%s\n%s' "$changelog_header" "$entry" "$changelog") changelog="$changelog_header\n$entry\n$changelog"
else else
changelog=$(printf '%s\n%s' "$changelog_header" "$entry") changelog="$changelog_header\n$entry"
fi fi
echo "$changelog" >$changelog_file echo "$changelog" >$changelog_file
} }