refactored all utils and src

This commit is contained in:
sobolevn 2016-07-02 13:24:32 +03:00
parent fab0b9b1f0
commit c83f41e6e2
No known key found for this signature in database
GPG Key ID: FF672D568AE3C73E
11 changed files with 33 additions and 9 deletions

View File

@ -22,7 +22,10 @@ if [[ -z "$DOCKER_DIST" ]]; then
fi
if [[ ! -z "$(command -v shellcheck)" ]]; then
# This means, that `shellcheck` does exist, so run it:
echo 'running lint'
# If running a native build with lint param, do a lint:
find src -type f -name '*.sh' -print0 | xargs -0 -I {} shellcheck {}
find utils -type f -name '*.sh' -print0 | xargs -0 -I {} shellcheck {}
# TODO: add tests to lint
# see: https://github.com/koalaman/shellcheck/issues/709
fi

View File

@ -2,6 +2,8 @@
set -e
# shellcheck source=./utils/build-utils.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
preinstall_files

View File

@ -7,6 +7,8 @@ set -e
# 2. It does not use `sudo` or anything
# 3. If you would like to install `.deb` package on your system, see `Installation`
# shellcheck source=./utils/build-utils.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
# This folder should contain just one .deb file:
@ -33,4 +35,6 @@ function integration_tests {
integration_tests
# Unit tests:
# shellcheck source=./utils/tests.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/tests.sh"

View File

@ -2,10 +2,12 @@
set -e
# shellcheck source=./utils/build-utils.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
# Variables, which will be used in `bintray.json`:
SCRIPT_VERSION=$(bash ${PWD}/git-secret --version)
SCRIPT_VERSION=$(bash "${PWD}/git-secret" --version)
RELEASE_DATE=$(date +%Y-%m-%d)
# add `\"override\": 1 \` into the `matrixParams`, if needed:

View File

@ -4,11 +4,14 @@ set -e
function update_gh_branch {
local branch_name=$(git branch | grep '*' | sed 's/* //')
git checkout gh-pages
local branch_name
branch_name=$(git branch | grep '\*' | sed 's/* //')
git checkout 'gh-pages'
make
git add _posts
git add '_posts'
git commit -m 'documentation update'
git checkout "$branch_name"
}

View File

@ -2,7 +2,7 @@
set -e
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
BRANCH_NAME=$(git branch | grep '\*' | sed 's/* //')
if [[ "$BRANCH_NAME" == 'master' ]]; then
# Build new web documentation:
@ -12,7 +12,7 @@ fi
if [[ "$BRANCH_NAME" == 'staging' ]]; then
# Compare script version and the latest tag:
NEWEST_TAG=$(git describe --abbrev=0 --tags)
SCRIPT_VERSION=$(bash ${PWD}/git-secret --version)
SCRIPT_VERSION=$(bash "${PWD}/git-secret" --version)
if [[ "$NEWEST_TAG" != "v${SCRIPT_VERSION}" ]]; then
# Create new release:

View File

@ -2,7 +2,7 @@
set -e
BRANCH_NAME=$(git branch | grep '*' | sed 's/* //')
BRANCH_NAME=$(git branch | grep '\*' | sed 's/* //')
if [[ $BRANCH_NAME != '(no branch)' ]]; then
unset GIT_WORK_TREE

View File

@ -28,4 +28,6 @@ function integration_tests {
integration_tests
# Unit tests:
# shellcheck source=./utils/tests.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/tests.sh"

View File

@ -2,6 +2,8 @@
set -e
# shellcheck source=./utils/build-utils.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
# Copying all the required files to the build directory:

View File

@ -7,6 +7,8 @@ set -e
# 2. It does not use `sudo` or anything
# 3. If you would like to install `.rpm` package on your system, see `Installation`
# shellcheck source=./utils/build-utils.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
# This folder should contain just one .rpm file:
@ -30,4 +32,6 @@ function integration_tests {
integration_tests
# Unit tests:
# shellcheck source=./utils/tests.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/tests.sh"

View File

@ -2,10 +2,12 @@
set -e
# shellcheck source=./utils/build-utils.sh
# shellcheck disable=SC1091
source "${SECRET_PROJECT_ROOT}/utils/build-utils.sh"
# Variables, which will be used in `bintray.json`:
SCRIPT_VERSION=$(bash ${PWD}/git-secret --version)
SCRIPT_VERSION=$(bash "${PWD}/git-secret" --version)
RELEASE_DATE=$(date +%Y-%m-%d)
# add `\"override\": 1 \` into the `matrixParams`, if needed: