This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
forked from os/slacker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuildspec.yml
38 lines (37 loc) · 1.88 KB
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
version: 0.2
phases:
install:
commands:
- pip install -q --upgrade -r requirements-cicd.txt
pre_build:
commands:
- mkdir -p ${CODEBUILD_SRC_DIR}/reports/lint ${CODEBUILD_SRC_DIR}/reports/tests
- pylint --exit-zero --jobs=4 --reports=y ./slackest > reports/lint/${CODEBUILD_BUILD_ID}-lint-output.txt
- tail -2 ${CODEBUILD_SRC_DIR}/reports/lint/${CODEBUILD_BUILD_ID}-lint-output.txt | sed 's/Your code has been rated at \([0-9]*.[0-9]*\)\/10/\1/' | sed '/^$/d' > ${CODEBUILD_SRC_DIR}/reports/lint/${CODEBUILD_BUILD_ID}-lint-score.txt
- anybadge -l pylint -v `cat ${CODEBUILD_SRC_DIR}/reports/lint/${CODEBUILD_BUILD_ID}-lint-score.txt` -f ${CODEBUILD_SRC_DIR}/reports/lint/pylint.svg 2=red 4=orange 8=yellow 10=green
- tox # > ${CODEBUILD_SRC_DIR}/reports/tests/${CODEBUILD_BUILD_ID}-test-output.txt
build:
commands:
- mkdir -p dist
- python setup.py sdist bdist_wheel
post_build:
commands:
- twine upload -u $(aws secretsmanager get-secret-value --secret-id PyPI --query SecretString --output text | jq -r '.username') -p $(aws secretsmanager get-secret-value --secret-id PyPI --query SecretString --output text | jq -r '.password') dist/*
- export PYTHONPATH=$(pwd):$PYTHONPATH && mkdir docs && cd docs && sphinx-apidoc ../slackest -F -o . && make html
- aws s3 cp ${CODEBUILD_SRC_DIR}/reports/lint/pylint.svg s3://slackest/pylint.svg
- aws s3 cp --recursive ${CODEBUILD_SRC_DIR}/docs/_build/html/ s3://slackest/
artifacts:
name: slackest-$CODEBUILD_BUILD_ID
files:
- $CODEBUILD_SRC_DIR/dist/*.whl
- $CODEBUILD_SRC_DIR/dist/*.tar.gz
base-directory: dist
discard-paths: yes
secondary-artifacts:
reports:
files:
- $CODEBUILD_SRC_DIR/reports/lint/*
- $CODEBUILD_SRC_DIR/reports/tests/*
name: slackest-reports-$CODEBUILD_BUILD_ID
discard-paths: yes
base-directory: reports