Skip to content

Commit

Permalink
Define workflows for the project
Browse files Browse the repository at this point in the history
Before stashing changes, the documentation will be generated. After
making a commit, the full CI flow will be triggered.

After a release, either a pull request for brew formulae will be
submitted or the instructions will be printed.

Also, the `version` file is removed before running a CI task in order to
prevent a failure of the version test. For unit tests, the file is not
expected. But after the installation, the file will be in the project's
directory.
  • Loading branch information
extsoft committed Oct 19, 2019
1 parent 3384c8f commit e2be239
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
tmp/
site/
version
1 change: 1 addition & 0 deletions .workflows/amend-work-after
1 change: 1 addition & 0 deletions .workflows/amend-work-ahead
22 changes: 22 additions & 0 deletions .workflows/release-work-after
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash
# add release notes
open https://github.com/bees-hive/elegant-git/releases/new
# update formulae
TAG=$(git describe)
COMMIT=$(git log --pretty=%H -1)

if type brew >/dev/null 2>&1 ; then
info-text "Updating Homebrew formulae..."
brew bump-formula-pr --no-audit --tag=${TAG} --revision=${COMMIT} elegant-git
else
error-text "brew binary is not available."
error-text "Please make a manual formulae update."
cat <<MESSAGE
Instructions:
open https://github.com/bees-hive/homebrew-hive/blob/master/Formula/elegant-git.rb
update
git tag: ${TAG}
git commit: ${COMMIT}
MESSAGE
fi
2 changes: 2 additions & 0 deletions .workflows/save-work-after
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
./workflows ci
2 changes: 2 additions & 0 deletions .workflows/save-work-ahead
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env bash
./workflows generate-docs
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ something which should be quickly available, please propose changes here.
**Table of contents**

- [Architecture](#architecture)
- [Development environment](#development-environment)
- [Coding rules](#coding-rules)
- [Debug mode](#debug-mode)
- [Testing procedure](#testing-procedure)
Expand Down Expand Up @@ -79,6 +80,12 @@ it. Each command file has to provide the following BASH functions:
- `command-description` prints a command description (line length is limited to 80 characters)
- `default` executes given command

### Development environment
The following tools are needed for successful development:
- Docker >= 19.03.2 is used for running tests
- Python 3.x is needed for documentation previews
- Elegant Git automates testing process and documentation generation

### Coding rules
We enforce having a consistent implementation by following the next strict rules:
- add `#!/usr/bin/env bash` at the beginning of each script
Expand Down
3 changes: 3 additions & 0 deletions workflows
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ repository() {
}

ci() {
if [[ -f version ]]; then
rm -v version
fi
docker run --rm -v $PWD:/eg ${WORKER_IMAGE} .workflows/ci-pipeline.bash testing
}

Expand Down

0 comments on commit e2be239

Please sign in to comment.