/
buildspec_build_wheel.yml
42 lines (37 loc) · 1.88 KB
/
buildspec_build_wheel.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
39
40
41
42
# Build Spec for AWS CodeBuild CI to build smdebug pip wheels
version: 0.2
env:
variables:
CORE_COMMIT: ""
RULES_COMMIT: ""
stable_release: "disable"
phases:
install:
commands:
- su && apt-get update
- apt-get install sudo -qq -o=Dpkg::Use-Pty=0
- sudo apt-get update -qq -o=Dpkg::Use-Pty=0
- sudo apt-get install unzip -qq -o=Dpkg::Use-Pty=0
- pip install --upgrade pip==20.3.3
- pip install -q pytest==5.3.3 wheel pyYaml pytest-html pre-commit pytest-cov
- pip uninstall -y boto3 && pip uninstall -y aiobotocore && pip uninstall -y botocore
build:
commands:
- cd $CODEBUILD_SRC_DIR && if [ -z "$CORE_COMMIT" ]; then export CORE_COMMIT=$(git log -1 --pretty=%h); fi
- cd $CODEBUILD_SRC_DIR && echo $CORE_COMMIT > smdebug/CORE_COMMIT
- cd $CODEBUILD_SRC_DIR && git checkout $CORE_COMMIT && if [ "$stable_release" = "enable" ]; then python setup.py --release bdist_wheel --universal; else python setup.py bdist_wheel --universal; fi
- cd $CODEBUILD_SRC_DIR_RULES && if [ -z "$RULES_COMMIT" ]; then export RULES_COMMIT=$(git log -1 --pretty=%h); fi
- cd $CODEBUILD_SRC_DIR_RULES && echo $RULES_COMMIT > smdebug_rules/RULES_COMMIT
- cd $CODEBUILD_SRC_DIR_RULES && git checkout $RULES_COMMIT && if [ "$stable_release" = "enable" ]; then python setup.py --release bdist_wheel --universal; else python setup.py bdist_wheel --universal; fi
post_build:
commands:
- if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 0 ]; then echo "ERROR BUILD FAILED " && exit 1 ; fi
- if [ "$CODEBUILD_BUILD_SUCCEEDING" -eq 1 ]; then echo "INFO BUILD SUCCEEDED !!! " ; fi
artifacts:
files:
- $CODEBUILD_SRC_DIR/dist/*.whl
- $CODEBUILD_SRC_DIR/smdebug/CORE_COMMIT
- $CODEBUILD_SRC_DIR_RULES/dist/*.whl
- $CODEBUILD_SRC_DIR_RULES/smdebug_rules/RULES_COMMIT
name: $(date +%F)
discard-paths: yes