Skip to content

Commit

Permalink
final touches/cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Mar 6, 2021
1 parent 5c97861 commit f82ab06
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
9 changes: 1 addition & 8 deletions .conducto.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,5 @@ name = Apprise
desc = Push Notifications that work with just about every platform!
init = pipeline.py

[pr]
[pr common]
command = python pipeline.py all_checks

[push "release artifact"]
filter = {tag} == v*
command = python pipeline.py all_checks --tag {tag}

[delete]
command = python pipeline.py clean_if_exists --env {branch}
20 changes: 16 additions & 4 deletions pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from inspect import cleandoc


def all_checks() -> co.Serial:
def all_checks(release=None) -> co.Serial:
"""
Define our Full Conducto Pipeline
"""
Expand Down Expand Up @@ -41,18 +41,18 @@ def all_checks() -> co.Serial:
coverage_template = cleandoc('''
pip install -r requirements.txt -r dev-requirements.txt || exit 1
mkdir --verbose -p {share} && \\
mkdir --verbose -p {share}/coverage && \\
coverage run --parallel -m pytest && \\
find . -mindepth 1 -maxdepth 1 -type f \\
-name '.coverage.*' \\
-exec mv --verbose -- {{}} {share} \;''')
-exec mv --verbose -- {{}} {share}/coverage \;''')

# pull generated file from the pipeline and place it back into
# our working directory
coverage_report_template = cleandoc('''
pip install coverage || exit 1
find {share} -mindepth 1 -maxdepth 1 -type f \\
find {share}/coverage -mindepth 1 -maxdepth 1 -type f \\
-name '.coverage.*' \\
-exec mv --verbose -- {{}} . \;
Expand Down Expand Up @@ -116,6 +116,14 @@ def all_checks() -> co.Serial:
if [ -x /usr/bin/dnf ]; then
# EL8 and Newer
dnf builddep -y rpm/*.rpm || exit 1
if [ ! -z "$PRODUCT_RELEASE" ]; then
# Prepare Artifacts
mkdir --verbose -p {share}/artifacts && \\
find dist -mindepth 1 -maxdepth 1 -type f \\
-exec mv --verbose -- {{}} {share}/artifacts \;'
fi
else
# EL7 Backwards Compatibility
yum-builddep -y rpm/*.rpm || exit 1
Expand All @@ -132,6 +140,10 @@ def all_checks() -> co.Serial:
'path_map': {'.': repo},
}

if release:
# Prepare release details into Environment
image_kwargs.update({'env': {'PRODUCT_RELEASE': release}})

# Our base image is always the first entry defined in our dockerfiles
base_image = co.Image(
dockerfile=dockerfiles[0][1], context=context, **image_kwargs)
Expand Down

0 comments on commit f82ab06

Please sign in to comment.