-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check documentation in the scope of quality pipeline
The new Ci image is pushed (version 3) which contains Python and MkDocs installation. This allows adding a check for documentation building to the testing procedure. This procedure tries to build the HTML docs. If they build successfully, we assume that documentation is good enough. #140
- Loading branch information
Showing
7 changed files
with
66 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
.idea/ | ||
tmp/ | ||
site/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
architect: extsoft | ||
docker: | ||
image: beeshive/elegant-git-ci:2 | ||
image: beeshive/elegant-git-ci:3 | ||
as_root: true | ||
merge: | ||
fast-forward: only | ||
rebase: true | ||
script: ./run-tests | ||
script: ./quality-pipeline.bash testing | ||
release: | ||
script: |- | ||
./quality-pipeline.bash testing | ||
echo "Release ${tag}" | ||
bats --tap src/test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
sudo: required | ||
language: bash | ||
services: docker | ||
script: docker run -t --rm -v $PWD:/eg beeshive/elegant-git-ci:2 ./run-tests | ||
script: docker run -it --rm -v $PWD:/eg beeshive/elegant-git-ci:3 ./quality-pipeline.bash testing | ||
notifications: | ||
email: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,15 @@ | ||
FROM ruby:2.4.1-alpine3.6 | ||
RUN apk update && \ | ||
apk upgrade && \ | ||
apk add --no-cache bats=0.4.0-r2 build-base libffi-dev ncurses git && \ | ||
apk add --no-cache bats=0.4.0-r2 build-base libffi-dev ncurses git python3 && \ | ||
ln -sf $(which python3) /usr/bin/python && \ | ||
ln -sf $(which pip3) /usr/bin/pip && pip install --upgrade pip && \ | ||
gem install pdd | ||
LABEL maintainer="Dmytro Serdiuk <[email protected]>" \ | ||
description="ruby:2.4.1 git:2.13.5 0pdd:0.20.3" \ | ||
version=2 | ||
description="Run the image without arguments to get the desciption." \ | ||
version=3 | ||
COPY docs/requirements.txt entry.bash / | ||
RUN pip install --no-cache -r requirements.txt && rm -r requirements.txt | ||
WORKDIR /eg | ||
ENV EG_ENABLE_TESTING true | ||
CMD ["./quality-pipeline.bash", "--version"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/usr/bin/env bash | ||
# This script is destructive! That's why it will work only if a specific variable is set. | ||
# It's recommended to run it within a docker container only. | ||
# Usage: | ||
# ./quality-pipeline.bash runs quality pipeline | ||
# ./quality-pipeline.bash --version prints tooling version | ||
set -e | ||
|
||
fail() { | ||
echo $@ | ||
exit 1 | ||
} | ||
|
||
pipeline() { | ||
bats --tap tests || fail "Unit tests are failed." | ||
./install.bash /usr/local src && git elegant help || fail "Installation test is failed." | ||
mkdocs build --clean --strict || fail "Unable to build the documentation." | ||
pdd --exclude=.idea/**/* \ | ||
--exclude=site/**/* \ | ||
--verbose --file=/dev/null || fail "Unreadable todo is identified." | ||
} | ||
|
||
say-version() { | ||
echo "<<< $@ >>>" | ||
echo "$($@)" | ||
echo "" | ||
} | ||
|
||
main() { | ||
case $1 in | ||
--version) | ||
say-version "bats --version" | ||
say-version "ruby --version" | ||
say-version "pdd --version" | ||
say-version "python --version" | ||
say-version "pip freeze" | ||
;; | ||
testing) | ||
if [[ -z $EG_ENABLE_TESTING ]]; then | ||
echo "Testing is disabled!" | ||
exit 1 | ||
fi | ||
pipeline | ||
;; | ||
*) | ||
echo "Available commands: --version or testing"; exit 1 | ||
esac | ||
} | ||
|
||
main $@ |