Compare commits
12 commits
unit-test-
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
08cb857664 | ||
|
309d8dc773 | ||
fabdefad82 | |||
|
616b1d9e3e | ||
|
7a7dec7751 | ||
|
28dec3694a | ||
59b50e7f4b | |||
|
a261ef841e | ||
|
109b70ea76 | ||
|
5341de86fb | ||
|
987277f1cf | ||
|
589fed6107 |
7 changed files with 27 additions and 19 deletions
|
@ -3,18 +3,10 @@ stages:
|
||||||
|
|
||||||
unit_tests:
|
unit_tests:
|
||||||
stage: test
|
stage: test
|
||||||
before_script:
|
|
||||||
- 'apk update'
|
|
||||||
- 'apk add make rsync'
|
|
||||||
script:
|
script:
|
||||||
- make test
|
- make test
|
||||||
|
|
||||||
shellcheck:
|
shellcheck:
|
||||||
stage: test
|
stage: test
|
||||||
before_script:
|
|
||||||
- 'apk update'
|
|
||||||
- 'apk add make'
|
|
||||||
- 'wget https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz'
|
|
||||||
- 'tar xf shellcheck-stable.linux.x86_64.tar.xz && mv shellcheck-stable/shellcheck /usr/bin/'
|
|
||||||
script:
|
script:
|
||||||
- make shellcheck
|
- make shellcheck
|
||||||
|
|
14
Makefile
14
Makefile
|
@ -29,7 +29,7 @@ ASCIIDOC=asciidoc
|
||||||
DOCBOOKTOTEXI=docbook2x-texi
|
DOCBOOKTOTEXI=docbook2x-texi
|
||||||
DOCBOOKTOMAN=docbook2x-man
|
DOCBOOKTOMAN=docbook2x-man
|
||||||
XSLTPROC=xsltproc
|
XSLTPROC=xsltproc
|
||||||
XSL=/usr/share/xml/docbook/stylesheet/nwalsh/html/docbook.xsl
|
XSL=/usr/local/share/xsl/docbook/html/docbook.xsl
|
||||||
A2X=a2x
|
A2X=a2x
|
||||||
|
|
||||||
prefix=/usr/packages/ccollect-git
|
prefix=/usr/packages/ccollect-git
|
||||||
|
@ -41,11 +41,7 @@ manlink=/usr/local/man/man1
|
||||||
|
|
||||||
path_dir=/usr/local/bin
|
path_dir=/usr/local/bin
|
||||||
path_destination=${path_dir}/${CCOLLECT_DEST}
|
path_destination=${path_dir}/${CCOLLECT_DEST}
|
||||||
|
docs_archive_name=docs.tar
|
||||||
# where to publish
|
|
||||||
host=localhost
|
|
||||||
dir=/home/users/nico/privat/rechner/netz/seiten/www.nico.schottelius.org/src/software/ccollect
|
|
||||||
docdir=${dir}/documentation
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Asciidoc will be used to generate other formats later
|
# Asciidoc will be used to generate other formats later
|
||||||
|
@ -91,6 +87,8 @@ all:
|
||||||
@echo "info: only generate Texinfo"
|
@echo "info: only generate Texinfo"
|
||||||
@echo "man: only generate manpage{s}"
|
@echo "man: only generate manpage{s}"
|
||||||
@echo "install: install ccollect to ${prefix}"
|
@echo "install: install ccollect to ${prefix}"
|
||||||
|
@echo "shellcheck: shellcheck ccollect script"
|
||||||
|
@echo "test: run unit tests"
|
||||||
|
|
||||||
html: ${HTMLDOCS}
|
html: ${HTMLDOCS}
|
||||||
htm: ${DBHTMLDOCS}
|
htm: ${DBHTMLDOCS}
|
||||||
|
@ -179,9 +177,9 @@ pub:
|
||||||
git push
|
git push
|
||||||
|
|
||||||
publish-doc: documentation
|
publish-doc: documentation
|
||||||
@echo "Transferring files to ${host}"
|
|
||||||
@chmod a+r ${DOCS} ${DOC_ALL}
|
@chmod a+r ${DOCS} ${DOC_ALL}
|
||||||
@tar c ${DOCS} ${DOC_ALL} | ssh ${host} "cd ${dir}; tar xv"
|
@tar cf ${docs_archive_name} ${DOCS} ${DOC_ALL}
|
||||||
|
@echo "Documentation files are in ${docs_archive_name}"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Distribution
|
# Distribution
|
||||||
|
|
19
ccollect
19
ccollect
|
@ -45,8 +45,8 @@ TMP="$(mktemp "/tmp/${__myname}.XXXXXX")"
|
||||||
export TMP
|
export TMP
|
||||||
CONTROL_PIPE="/tmp/${__myname}-control-pipe"
|
CONTROL_PIPE="/tmp/${__myname}-control-pipe"
|
||||||
|
|
||||||
VERSION="2.7"
|
VERSION="2.10"
|
||||||
RELEASE="2019-11-14"
|
RELEASE="2020-08-26"
|
||||||
HALF_VERSION="ccollect ${VERSION}"
|
HALF_VERSION="ccollect ${VERSION}"
|
||||||
FULL_VERSION="ccollect ${VERSION} (${RELEASE})"
|
FULL_VERSION="ccollect ${VERSION} (${RELEASE})"
|
||||||
|
|
||||||
|
@ -824,6 +824,11 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
|
||||||
rsync "$@" "${source}" "${destination_dir}"; ret=$?
|
rsync "$@" "${source}" "${destination_dir}"; ret=$?
|
||||||
_techo "Finished backup (rsync return code: $ret)."
|
_techo "Finished backup (rsync return code: $ret)."
|
||||||
|
|
||||||
|
#
|
||||||
|
# export rsync return code, might be useful in post_exec
|
||||||
|
#
|
||||||
|
export rsync_return_code=$ret
|
||||||
|
|
||||||
#
|
#
|
||||||
# Set modification time (mtime) to current time, if sorting by mtime is enabled
|
# Set modification time (mtime) to current time, if sorting by mtime is enabled
|
||||||
#
|
#
|
||||||
|
@ -856,6 +861,16 @@ while [ "${source_no}" -lt "${no_sources}" ]; do
|
||||||
_techo "Warning: rsync failed with return code $ret."
|
_techo "Warning: rsync failed with return code $ret."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Create symlink to newest backup
|
||||||
|
#
|
||||||
|
# shellcheck disable=SC2010
|
||||||
|
latest_dir="$(ls -${TSORT}p1 "${ddir}" | grep '/$' | head -n 1)" || \
|
||||||
|
_exit_err "Failed to list content of ${ddir}."
|
||||||
|
|
||||||
|
ln -snf "${ddir}${latest_dir}" "${ddir}current" || \
|
||||||
|
_exit_err "Failed to create 'current' symlink."
|
||||||
|
|
||||||
#
|
#
|
||||||
# post_exec
|
# post_exec
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
ccollect - Installing, Configuring and Using
|
ccollect - Installing, Configuring and Using
|
||||||
============================================
|
============================================
|
||||||
Nico Schottelius <nico-ccollect__@__schottelius.org>
|
Nico Schottelius <nico-ccollect__@__schottelius.org>
|
||||||
2.7, for ccollect 2.7, Initial Version from 2006-01-13
|
2.10, for ccollect 2.10, Initial Version from 2006-01-13
|
||||||
:Author Initials: NS
|
:Author Initials: NS
|
||||||
|
|
||||||
|
|
||||||
|
|
1
doc/changes/2.10
Normal file
1
doc/changes/2.10
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Add 'current' symlink to backup destinations (Steffen Zieger)
|
1
doc/changes/2.8
Normal file
1
doc/changes/2.8
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Fix excluding destination dir from removal
|
1
doc/changes/2.9
Normal file
1
doc/changes/2.9
Normal file
|
@ -0,0 +1 @@
|
||||||
|
* Make rsync return code available in post_exec (Steffen Zieger)
|
Loading…
Reference in a new issue