Skip to content

Commit

Permalink
updated readme about gitlab configration and added [VALHALLA SKIP] to…
Browse files Browse the repository at this point in the history
… every commit performed by valhalla
  • Loading branch information
marwin1991 committed Dec 16, 2023
1 parent a3b6370 commit 5bf926b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 7 deletions.
32 changes: 25 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

🌌 valhalla is a toolkit designed to streamline the release of new versions of software. 🌌

- [dockerhub](https://hub.docker.com/repository/docker/logchange/valhalla/)

### 📐 background and basic concept

- **complex releasing process:** Creating a new software release involves a multitude of intricate steps. This
Expand Down Expand Up @@ -90,10 +92,13 @@ extends:
- https://raw.githubusercontent.com/logchange/valhalla/master/valhalla.yml
```

You can point to any URL that is `valhalla.yml` and it will be loaded and then override by values from
current file. Currently, you can only inherit once, co it means if you inherit from a file, that also contains
You can point to any URL that is `valhalla.yml` format, and it will be loaded and then override by values from
current file. Currently, you can only inherit once and from one URL, so it means if you inherit from a file, that also contains
`extends` keyword, it won't be evaluated.

**Proxy**

TODO

### 🖖 string predefined variables

Expand All @@ -107,14 +112,27 @@ current file. Currently, you can only inherit once, co it means if you inherit f

- if using GitLab workflows
for `merge requests workflow` [(link)](https://gitlab.com/gitlab-org/gitlab/-/blob/master/lib/gitlab/ci/templates/Workflows/MergeRequest-Pipelines.gitlab-ci.yml)
you have to add `if: '$CI_COMMIT_BRANCH =~ /^release-*/` to global workflow configuration
you have to add `if: $CI_COMMIT_BRANCH =~ /^release-*/ && $CI_COMMIT_TITLE !~ /.*VALHALLA SKIP.*/` to global workflow configuration

```yml
workflows:
if: '$CI_COMMIT_BRANCH =~ /^release-*/
- if: $CI_COMMIT_BRANCH =~ /^release-*/ && $CI_COMMIT_TITLE !~ /.*VALHALLA SKIP.*/
release:
stage:

# add new stage
stages:
- release
valhalla_release:
stage: release
image: logchange/valhalla:1.1.0
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
when: never
- if: $CI_PIPELINE_SOURCE == "schedule"
when: never
# we run the job only for branch with name release-
# and for commits that DOES NOT include VALHALLA SKIP
# valhalla during committing adds [VALHALLA SKIP] ad the end of commit msg
- if: $CI_COMMIT_BRANCH =~ /^release-*/ && $CI_COMMIT_TITLE !~ /.*VALHALLA SKIP.*/
```
1 change: 1 addition & 0 deletions valhalla/commit/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def commit(self, msg: str, add=True) -> bool:
warn("There is noting to commit!")
return False

msg += "[VALHALLA SKIP]"
commit = self.repository.index.commit(msg)
info(f"Created commit: {commit}")
self.status()
Expand Down

0 comments on commit 5bf926b

Please sign in to comment.