Merge branch 'development' of https://github.com/radicallyopensecurity/pentext into development

This commit is contained in:
skyanth
2016-11-28 17:54:06 +01:00
2 changed files with 15 additions and 8 deletions

View File

@@ -30,6 +30,9 @@ BRANCH=master
[[ ! -z $1 ]] && TARGET=$1
[[ ! -z $2 ]] && REPO=$2
# Set the default PDF name based on the target name
TARGETPDF="target/$TARGET-latest.pdf"
# Reading positional parms is a bit ugly, shifting parms or getopt would be nicer
if [[ ! -z $3 ]]; then
if [[ ! $3 == -* ]]; then
@@ -97,23 +100,27 @@ build() {
fi
pushd source &>/dev/null
backwards_compatible
targetpdf=target/$TARGET-latest.pdf
$DOCBUILDER -c -i $TARGET.xml -o ../$targetpdf -x ../xslt/generate_$TARGET.xsl $PARMS
if ([[ $TARGET == "quote" ]] || [[ $TARGET == "offerte" ]]); then
TARGETPDF="target/quote_${REPO/off-/}.pdf"
elif [[ $TARGET == "report" ]]; then
TARGETPDF="target/report_${REPO/pen-/}.pdf"
fi
$DOCBUILDER -c -i $TARGET.xml -o ../$TARGETPDF -x ../xslt/generate_$TARGET.xsl $PARMS
if [[ $? -ne 0 ]]; then
echo "[-] Sorry, failed to parse $TARGET. Use \`builder $TARGET $REPO $NAMESPACE $BRANCH -v\` for more information."
exit 1
fi
popd &>/dev/null
if [ ! -f $targetpdf ]; then
echo "[-] hmmm... failed to build PDF file (could not find $targetpdf)"
if [ ! -f $TARGETPDF ]; then
echo "[-] hmmm... failed to build PDF file (could not find $TARGETPDF)"
exit 1
fi
}
add_to_repo() {
git add target/$TARGET-latest.pdf
git add $TARGETPDF
git add target/waiver_?*.pdf &>/dev/null
git commit -q -m "$targetpdf proudly manufactured using ChatOps" &>/dev/null
git commit -q -m "$TARGETPDF proudly manufactured using ChatOps" &>/dev/null
git push -q >/dev/null
}
@@ -122,5 +129,5 @@ echo "builder v$VERSION - Rocking your world, one build at a time..."
clone_repo
build
add_to_repo
echo "[+] listo! Check out $GITWEB/$NAMESPACE/$REPO/raw/$BRANCH/$targetpdf"
echo "[+] listo! Check out $GITWEB/$NAMESPACE/$REPO/raw/$BRANCH/$TARGETPDF"
exit 0

View File

@@ -9,7 +9,7 @@
<!-- snippet --><p>
Our fixed-fee price quote for the above described <company_svc_short/> is <p_fee/>.- excl. VAT and out-of-pocket expenses.
<company_short/> will send an invoice after completion of this assignment.
<company_short/> will send an invoice after the completion of this assignment.
<client_short/> will pay the agreed amount within 30 days of the invoice date.
</p>
<!-- snippet --><p>