diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..04ec16fc --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +#FROM arm64v8/ubuntu:16.04 + +FROM arm32v7/ubuntu:16.04 + +MAINTAINER ric03uec + +RUN mkdir -p /sample_python + +ADD . /sample_python + +WORKDIR /sample_python + +ENTRYPOINT python app.py diff --git a/README.md b/README.md index ec522d27..8f817b75 100755 --- a/README.md +++ b/README.md @@ -2,3 +2,6 @@ Python Sample ===================== Simple Python sample with tests using Nose and Coverage. + +This sample is built for Shippable, a docker based continuous integration and deployment platform. +change 1 in testing branch diff --git a/pipelines.yml b/pipelines.yml new file mode 100644 index 00000000..00a8852b --- /dev/null +++ b/pipelines.yml @@ -0,0 +1,29 @@ +resources: + - name: sample_python + type: gitRepo + repoPath: ric03uec/sample_python + configuration: + integrationName: ric03uec-github + branches: + only: master + initialVersion: + sha: master + +pipelines: + - name: pipeline_1 + setup: + runtime: host + steps: + - name: test_bash_step + type: bash + configuration: + affinityGroup: test_affinity_group + setup: + runtime: host + triggeredBy: + resources: + - sample_python + execution: + onExecute: + - echo "First run....." + - echo "executing step_A..." diff --git a/shippable.yml b/shippable.yml index 3bdcdf82..22177105 100755 --- a/shippable.yml +++ b/shippable.yml @@ -1,17 +1,98 @@ +# Language setting language: python +# Version number python: - 2.7 + + # - 3.2 + # - 3.3 + # - 3.5 + +#services: +# - cassandra -install: - - pip install -r requirements.txt +#runtime: +# nodePool: shippable_shared_aarch32 + +#matrix: +## include: +# - python: 2.7 +# env: RUNTIME=Ubuntu_14 +# nodePool: dynamic_u14_xlarge +# - python: 2.7 +# env: RUNTIME=Ubuntu_16 +# nodePool: dynamic_u16_xlarge +# - python: 2.7 +# nodePool: shippable_shared_aarch32 + +build: + #cache: true + #cache_dir_list: + # - $SHIPPABLE_BUILD_DIR/shippable.yml + +# pre_ci_boot: +# image_name: ric03uec/sample_python ##replace with your repo and image name +# image_tag: aarch64 + + ci: + - uname -a + - echo "Hello, World!" + - cat $SHIPPABLE_BUILD_DIR/build_number || true + - echo $SHIPPABLE_BUILD_NUMBER > $SHIPPABLE_BUILD_DIR/build_number + #- env + #- env | grep RUNTIME + #- python --version | echo + #- sleep 10 + - mkdir -p shippable/testresults + - mkdir -p shippable/codecoverage + - pip install -r requirements.txt + - nosetests test.py --with-xunit --xunit-file=shippable/testresults/nosetests.xml + - which python && coverage run --branch test.py + - which python && coverage xml -o shippable/codecoverage/coverage.xml test.py + - docker --version + - docker ps -a + - docker images + - sleep 30 + - docker build -t ric03uec/sample_python:arm . + - docker push ric03uec/sample_python:arm +# - python $SHIPPABLE_BUILD_DIR/ttyTest.py + + + push: + - echo "PUSH step done" + - ls -al -# Make folders for the reports -before_script: - - mkdir -p shippable/testresults - - mkdir -p shippable/codecoverage + on_failure: + - echo "The job failed!!!!!" + + on_success: + - echo "The job succeeded!!!!" -script: - - nosetests test.py --with-xunit --xunit-file=shippable/testresults/nosetests.xml - - which python && coverage run --branch test.py - - which python && coverage xml -o shippable/codecoverage/coverage.xml test.py \ No newline at end of file +#integrations: +# notifications: +# - integrationName: email +# type: email +# recipients: +# - devashish@shippable.com +# on_success: always +# on_failure: always +# on_pull_request: never +# on_start: never + +#integrations: +# notifications: +# - integrationName: ric03uec-event1 +# type: webhook +# on_success: always +# on_failure: always +# on_pull_request: never +# on_start: never + +integrations: + hub: + - integrationName: reg_dh_ric03uec + type: dockerRegistryLogin + branches: + only: + - master diff --git a/ttyTest.py b/ttyTest.py new file mode 100644 index 00000000..4fe1dfde --- /dev/null +++ b/ttyTest.py @@ -0,0 +1,4 @@ +#!/usr/bin/python +import sys +print sys.stdin.isatty() +print '--------------------------------'