Cronq

Latest version: v0.27.0

Safety actively analyzes 630169 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 13 of 13

0.0.17

--------------------

- Timeout is an int short, use a shorter one. [Philip Cristiano]

12 hours should be enough

0.0.16

--------------------

- V0.0.16. [Philip Cristiano]

- Handle longer running jobs. [Philip Cristiano]

The heartbeat would kick the connection off causing a bunch of problems. This can be dealt with later since it's still a problem, but it takes 1 full day to cause it

0.0.15

--------------------

- Close handler after process ends. [Philip Cristiano]

May be causing a bug where the process appears to hang

0.0.14

--------------------

- Exit on connection error. [Philip Cristiano]

closes 8

- V0.0.13. [Philip Cristiano]

- Runner: Log to /var/log/cronq for each process. [Philip Cristiano]

Uses a watchedFileHandler so it can be log rotated

- Fix typo. [Philip Cristiano]

- Run jobs now in web interface. [Philip Cristiano]

- Support multiple RabbitMQ queues. [Philip Cristiano]

To allow routing of jobs to the correct nodes and splitting of tasks

- Page for each run. [Philip Cristiano]

- Something to read. [Philip Cristiano]

- Fix showing return code. [Philip Cristiano]

- Aggregate job results for web view. [Philip Cristiano]

- Web: Name links to index. [Philip Cristiano]

- Working on web app. [Philip Cristiano]

- Web view. [Philip Cristiano]

- Don't add test job. [Philip Cristiano]

- Working injector and runner together woooo. [Philip Cristiano]

- Runner working. [Philip Cristiano]

- Runner will run a task… constantly at this point. [Philip Cristiano]

- Make: Add upload target. [Philip Cristiano]

- Make: Fix path to Python. [Philip Cristiano]

- Basic project layout. [Philip Cristiano]

- Initial commit. [philipcristiano]




!/usr/bin/env bash
set -eo pipefail; [[ $RELEASE_TRACE ]] && set -x

PACKAGE_NAME='cronq'
INIT_PACKAGE_NAME='cronq'
PUBLIC="true"

Colors
COLOR_OFF="\033[0m" unsets color to term fg color
RED="\033[0;31m" red
GREEN="\033[0;32m" green
YELLOW="\033[0;33m" yellow
MAGENTA="\033[0;35m" magenta
CYAN="\033[0;36m" cyan

ensure wheel is available
pip install wheel > /dev/null

ensure Pygment is available
pip install Pygments > /dev/null

command -v gitchangelog >/dev/null 2>&1 || {
echo -e "${RED}WARNING: Missing gitchangelog binary, please run: pip install gitchangelog==2.2.0${COLOR_OFF}\n"
exit 1
}

command -v rst-lint > /dev/null || {
echo -e "${RED}WARNING: Missing rst-lint binary, please run: pip install restructuredtext_lint${COLOR_OFF}\n"
exit 1
}

if [[ "$" != "major" ]] && [[ "$" != "minor" ]] && [[ "$" != "patch" ]]; then
echo -e "${RED}WARNING: Invalid release type, must specify 'major', 'minor', or 'patch'${COLOR_OFF}\n"
exit 1
fi

echo -e "\n${GREEN}STARTING RELEASE PROCESS${COLOR_OFF}\n"

set +e;
git status | grep -Eo "working (directory|tree) clean" &> /dev/null
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"
exit 1
fi
set -e;

echo -e "${YELLOW}--->${COLOR_OFF} Updating local copy"
git pull -q origin master
git fetch --tags > /dev/null

echo -e "${YELLOW}--->${COLOR_OFF} Retrieving release versions"

current_version=$(cat ${INIT_PACKAGE_NAME}/__init__.py |grep '__version__ ='|sed 's/[^0-9.]//g')
major=$(echo $current_version | awk '{split($0,a,"."); print a[1]}')
minor=$(echo $current_version | awk '{split($0,a,"."); print a[2]}')
patch=$(echo $current_version | awk '{split($0,a,"."); print a[3]}')

if [[ "$" == "major" ]]; then
major=$(($major + 1));
minor="0"
patch="0"
elif [[ "$" == "minor" ]]; then
minor=$(($minor + 1));
patch="0"
elif [[ "$" == "patch" ]]; then
patch=$(($patch + 1));
fi

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} Ensuring readme passes lint checks (if this fails, run rst-lint)"
rst-lint README.rst > /dev/null

echo -e "${YELLOW}--->${COLOR_OFF} Creating necessary temp file"
tempfoo=$(basename $0)
TMPFILE=$(mktemp /tmp/${tempfoo}.XXXXXX) || {
echo -e "${RED}WARNING: Cannot create temp file using mktemp in /tmp dir ${COLOR_OFF}\n"
exit 1
}

find_this="__version__ = '$current_version'"
replace_with="__version__ = '$next_version'"

echo -e "${YELLOW}--->${COLOR_OFF} Updating ${INIT_PACKAGE_NAME}/__init__.py"
sed "s/$find_this/$replace_with/" ${INIT_PACKAGE_NAME}/__init__.py > $TMPFILE && mv $TMPFILE ${INIT_PACKAGE_NAME}/__init__.py

echo -e "${YELLOW}--->${COLOR_OFF} Updating README.rst"
find_this="${PACKAGE_NAME}.git$current_version"
replace_with="${PACKAGE_NAME}.git$next_version"
sed "s/$find_this/$replace_with/" README.rst > $TMPFILE && mv $TMPFILE README.rst
find_this="${PACKAGE_NAME}==$current_version"
replace_with="${PACKAGE_NAME}==$next_version"
sed "s/$find_this/$replace_with/" README.rst > $TMPFILE && mv $TMPFILE README.rst

if [ -f docs/conf.py ]; then
echo -e "${YELLOW}--->${COLOR_OFF} Updating docs"
find_this="version = '${current_version}'"
replace_with="version = '${next_version}'"
sed "s/$find_this/$replace_with/" docs/conf.py > $TMPFILE && mv $TMPFILE docs/conf.py

find_this="release = '${current_version}'"
replace_with="release = '${next_version}'"
sed "s/$find_this/$replace_with/" docs/conf.py > $TMPFILE && mv $TMPFILE docs/conf.py
fi

echo -e "${YELLOW}--->${COLOR_OFF} Updating CHANGES.rst for new release"
version_header="$next_version ($(date +%F))"
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

echo -e "${YELLOW}--->${COLOR_OFF} Adding changed files to git"
git add CHANGES.rst README.rst ${INIT_PACKAGE_NAME}/__init__.py
if [ -f docs/conf.py ]; then git add docs/conf.py; fi

echo -e "${YELLOW}--->${COLOR_OFF} Creating release"
git commit -q -m "Release version $next_version"

echo -e "${YELLOW}--->${COLOR_OFF} Tagging release"
git tag -a $next_version -m "Release version $next_version"

echo -e "${YELLOW}--->${COLOR_OFF} Pushing release and tags to github"
git push -q origin master && git push -q --tags

if [[ "$PUBLIC" == "true" ]]; then
echo -e "${YELLOW}--->${COLOR_OFF} Creating python release"
cp README.rst README
python setup.py sdist bdist_wheel upload > /dev/null
rm README
else
echo -e "${YELLOW}--->${COLOR_OFF} Creating local python dist and wheel for manual release"
python setup.py sdist bdist_wheel > /dev/null
fi

echo -e "\n${CYAN}RELEASED VERSION ${next_version}${COLOR_OFF}\n"

Page 13 of 13

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.