mirror of
https://github.com/josegonzalez/python-github-backup.git
synced 2025-12-05 16:18:02 +01:00
fix: correct lint issues and show errors on lint
This commit is contained in:
10
README.rst
10
README.rst
@@ -28,7 +28,7 @@ Using PIP via Github (more likely the latest version)::
|
|||||||
Python scripts are unlikely to be included in your ``$PATH`` by default, this means it cannot be run directly in terminal with ``$ github-backup ...``, you can either add python's install path to your environments ``$PATH`` or call the script directly e.g. using ``$ ~/.local/bin/github-backup``.*
|
Python scripts are unlikely to be included in your ``$PATH`` by default, this means it cannot be run directly in terminal with ``$ github-backup ...``, you can either add python's install path to your environments ``$PATH`` or call the script directly e.g. using ``$ ~/.local/bin/github-backup``.*
|
||||||
|
|
||||||
Basic Help
|
Basic Help
|
||||||
===========
|
==========
|
||||||
|
|
||||||
Show the CLI help output::
|
Show the CLI help output::
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ Cloning all starred size
|
|||||||
Using the ``--all-starred`` argument to clone all starred repositories may use a large amount of storage space, especially if ``--all`` or more arguments are used. e.g. commonly starred repos can have tens of thousands of issues, many large assets and the repo itself etc. Consider just storing links to starred repos in JSON format with ``--starred``.
|
Using the ``--all-starred`` argument to clone all starred repositories may use a large amount of storage space, especially if ``--all`` or more arguments are used. e.g. commonly starred repos can have tens of thousands of issues, many large assets and the repo itself etc. Consider just storing links to starred repos in JSON format with ``--starred``.
|
||||||
|
|
||||||
Incremental Backup
|
Incremental Backup
|
||||||
-------------------
|
------------------
|
||||||
|
|
||||||
Using (``-i, --incremental``) will only request new data from the API **since the last run (successful or not)**. e.g. only request issues from the API since the last run.
|
Using (``-i, --incremental``) will only request new data from the API **since the last run (successful or not)**. e.g. only request issues from the API since the last run.
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ It's therefore recommended to only use the incremental argument if the output/re
|
|||||||
|
|
||||||
|
|
||||||
"bare" is actually "mirror"
|
"bare" is actually "mirror"
|
||||||
--------------------------
|
---------------------------
|
||||||
|
|
||||||
Using the bare clone argument (``--bare``) will actually call git's ``clone --mirror`` command. There's a subtle difference between `bare <https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---bare>`_ and `mirror <https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror>`_ clone.
|
Using the bare clone argument (``--bare``) will actually call git's ``clone --mirror`` command. There's a subtle difference between `bare <https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---bare>`_ and `mirror <https://www.git-scm.com/docs/git-clone#Documentation/git-clone.txt---mirror>`_ clone.
|
||||||
|
|
||||||
@@ -263,13 +263,13 @@ The starred normal repo cloning (``--all-starred``) argument stores starred repo
|
|||||||
|
|
||||||
|
|
||||||
Skip existing on incomplete backups
|
Skip existing on incomplete backups
|
||||||
-------------------------------------------------------
|
-----------------------------------
|
||||||
|
|
||||||
The ``--skip-existing`` argument will skip a backup if the directory already exists, even if the backup in that directory failed (perhaps due to a blocking error). This may result in unexpected missing data in a regular backup.
|
The ``--skip-existing`` argument will skip a backup if the directory already exists, even if the backup in that directory failed (perhaps due to a blocking error). This may result in unexpected missing data in a regular backup.
|
||||||
|
|
||||||
|
|
||||||
Github Backup Examples
|
Github Backup Examples
|
||||||
========
|
======================
|
||||||
|
|
||||||
Backup all repositories, including private ones using a classic token::
|
Backup all repositories, including private ones using a classic token::
|
||||||
|
|
||||||
|
|||||||
19
release
19
release
@@ -1,5 +1,6 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
set -eo pipefail; [[ $RELEASE_TRACE ]] && set -x
|
set -eo pipefail
|
||||||
|
[[ $RELEASE_TRACE ]] && set -x
|
||||||
|
|
||||||
if [[ ! -f setup.py ]]; then
|
if [[ ! -f setup.py ]]; then
|
||||||
echo -e "${RED}WARNING: Missing setup.py${COLOR_OFF}\n"
|
echo -e "${RED}WARNING: Missing setup.py${COLOR_OFF}\n"
|
||||||
@@ -43,13 +44,13 @@ fi
|
|||||||
|
|
||||||
echo -e "\n${GREEN}STARTING RELEASE PROCESS${COLOR_OFF}\n"
|
echo -e "\n${GREEN}STARTING RELEASE PROCESS${COLOR_OFF}\n"
|
||||||
|
|
||||||
set +e;
|
set +e
|
||||||
git status | grep -Eo "working (directory|tree) clean" &>/dev/null
|
git status | grep -Eo "working (directory|tree) clean" &>/dev/null
|
||||||
if [ ! $? -eq 0 ]; then # working directory is NOT clean
|
if [ ! $? -eq 0 ]; then # working directory is NOT clean
|
||||||
echo -e "${RED}WARNING: You have uncomitted changes, you may have forgotten something${COLOR_OFF}\n"
|
echo -e "${RED}WARNING: You have uncomitted changes, you may have forgotten something${COLOR_OFF}\n"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
set -e;
|
set -e
|
||||||
|
|
||||||
echo -e "${YELLOW}--->${COLOR_OFF} Updating local copy"
|
echo -e "${YELLOW}--->${COLOR_OFF} Updating local copy"
|
||||||
git pull -q origin master
|
git pull -q origin master
|
||||||
@@ -62,14 +63,14 @@ minor=$(echo $current_version | awk '{split($0,a,"."); print a[2]}')
|
|||||||
patch=$(echo $current_version | awk '{split($0,a,"."); print a[3]}')
|
patch=$(echo $current_version | awk '{split($0,a,"."); print a[3]}')
|
||||||
|
|
||||||
if [[ "$@" == "major" ]]; then
|
if [[ "$@" == "major" ]]; then
|
||||||
major=$(($major + 1));
|
major=$(($major + 1))
|
||||||
minor="0"
|
minor="0"
|
||||||
patch="0"
|
patch="0"
|
||||||
elif [[ "$@" == "minor" ]]; then
|
elif [[ "$@" == "minor" ]]; then
|
||||||
minor=$(($minor + 1));
|
minor=$(($minor + 1))
|
||||||
patch="0"
|
patch="0"
|
||||||
elif [[ "$@" == "patch" ]]; then
|
elif [[ "$@" == "patch" ]]; then
|
||||||
patch=$(($patch + 1));
|
patch=$(($patch + 1))
|
||||||
fi
|
fi
|
||||||
|
|
||||||
next_version="${major}.${minor}.${patch}"
|
next_version="${major}.${minor}.${patch}"
|
||||||
@@ -77,7 +78,7 @@ next_version="${major}.${minor}.${patch}"
|
|||||||
echo -e "${YELLOW} >${COLOR_OFF} ${MAGENTA}${current_version}${COLOR_OFF} -> ${MAGENTA}${next_version}${COLOR_OFF}"
|
echo -e "${YELLOW} >${COLOR_OFF} ${MAGENTA}${current_version}${COLOR_OFF} -> ${MAGENTA}${next_version}${COLOR_OFF}"
|
||||||
|
|
||||||
echo -e "${YELLOW}--->${COLOR_OFF} Ensuring readme passes lint checks (if this fails, run rst-lint)"
|
echo -e "${YELLOW}--->${COLOR_OFF} Ensuring readme passes lint checks (if this fails, run rst-lint)"
|
||||||
rst-lint README.rst > /dev/null
|
rst-lint README.rst || exit 1
|
||||||
|
|
||||||
echo -e "${YELLOW}--->${COLOR_OFF} Creating necessary temp file"
|
echo -e "${YELLOW}--->${COLOR_OFF} Creating necessary temp file"
|
||||||
tempfoo=$(basename $0)
|
tempfoo=$(basename $0)
|
||||||
@@ -105,7 +106,9 @@ fi
|
|||||||
|
|
||||||
echo -e "${YELLOW}--->${COLOR_OFF} Updating CHANGES.rst for new release"
|
echo -e "${YELLOW}--->${COLOR_OFF} Updating CHANGES.rst for new release"
|
||||||
version_header="$next_version ($(date +%F))"
|
version_header="$next_version ($(date +%F))"
|
||||||
set +e; dashes=$(yes '-'|head -n ${#version_header}|tr -d '\n') ; set -e
|
set +e
|
||||||
|
dashes=$(yes '-' | head -n ${#version_header} | tr -d '\n')
|
||||||
|
set -e
|
||||||
gitchangelog | sed "4s/.*/$version_header/" | sed "5s/.*/$dashes/" >$TMPFILE && mv $TMPFILE CHANGES.rst
|
gitchangelog | sed "4s/.*/$version_header/" | sed "5s/.*/$dashes/" >$TMPFILE && mv $TMPFILE CHANGES.rst
|
||||||
|
|
||||||
echo -e "${YELLOW}--->${COLOR_OFF} Adding changed files to git"
|
echo -e "${YELLOW}--->${COLOR_OFF} Adding changed files to git"
|
||||||
|
|||||||
Reference in New Issue
Block a user