-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added changes for CI/CD pipeline #170
Open
chebroluharika
wants to merge
19
commits into
master
Choose a base branch
from
CI_CD_python
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9dd254a
Added pylint
HarikaChebrolu 691a03a
Changed pylint command
HarikaChebrolu d5c325c
Added email notification after completing workflow
HarikaChebrolu 0af38fc
Added email notification after completing workflow
HarikaChebrolu ed7ca08
Added status of workflow job in mail subject
HarikaChebrolu 8f0ceef
Updated body of message
HarikaChebrolu 219415c
Updated body of message
HarikaChebrolu 7ca65a8
Updated body of message
HarikaChebrolu ba135bc
Updated body of message
HarikaChebrolu 81f2ac8
Updated body of message
HarikaChebrolu e9cba96
Updated body of message
HarikaChebrolu 13164bd
Updated body of message
HarikaChebrolu f1a8f52
Updated body of message
HarikaChebrolu d6baad2
Updated body of message
HarikaChebrolu b8f94ef
Updated body of message
HarikaChebrolu bfc3e94
Updated body of message
HarikaChebrolu 82aa5a4
Updated body of message
HarikaChebrolu 0ef0629
Updated body of message
HarikaChebrolu bb5b09e
Added email notification in CD
HarikaChebrolu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,27 +14,63 @@ jobs: | |
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
|
||
- name: Install dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
|
||
- name: Deploy to GitHub Pages | ||
if: success() | ||
uses: crazy-max/ghaction-github-pages@v2 | ||
with: | ||
target_branch: gh-pages | ||
keep_history: true | ||
build_dir: docs/build/html/. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and publish to PyPi | ||
env: | ||
TWINE_USERNAME: ${{ secrets.pypi_username }} | ||
TWINE_PASSWORD: ${{ secrets.pypi_password }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
|
||
- name: Setup environment for Docker image publish | ||
run: | | ||
echo "GITHUB_REF=${GITHUB_REF:10}" >> $GITHUB_ENV | ||
|
||
- name: Login to Docker Hub | ||
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin | ||
|
||
- name: Build the tagged Docker image | ||
run: docker build . --file Dockerfile --tag hewlettpackardenterprise/hpe-oneview-sdk-for-python:${{ env.GITHUB_REF }}-OV6.2 | ||
|
||
- name: Push the tagged Docker image | ||
run: docker push hewlettpackardenterprise/hpe-oneview-sdk-for-python:${{ env.GITHUB_REF }}-OV6.2 | ||
|
||
- name: Send mail notifier about status of pipeline | ||
uses: dawidd6/action-send-mail@v2 | ||
with: | ||
server_address: smtp-mail.outlook.com | ||
server_port: 587 | ||
username: ${{secrets.MAIL_USERNAME}} | ||
password: ${{secrets.MAIL_PASSWORD}} | ||
subject: OneViewSDK Daily Deployment Results – ${{job.status}} | ||
body: | | ||
Hi All, | ||
OneViewSDK daily deployment on build 6.20.00 is considered a ${{job.status}} for Synergy Composer and VM appliances. | ||
link: https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} | ||
|
||
Thanks, | ||
OneView SDK Deployment Automation | ||
to: [email protected] | ||
from: github-actions | ||
priority: high |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
name: python CI | ||
|
||
on: | ||
- pull_request | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
tox_test: | ||
|
@@ -25,7 +24,12 @@ jobs: | |
python -m pip install --upgrade pip | ||
pip install tox | ||
|
||
- name: Run tox tests | ||
# - name: Analysing the code with pylint | ||
# run: | | ||
# pip install pylint | ||
# pylint $(git ls-files '*.py') | ||
|
||
- name: Run unit tests using tox | ||
run: tox | ||
|
||
Build_and_publish: | ||
|
@@ -49,22 +53,17 @@ jobs: | |
python -m pip install --upgrade pip | ||
pip install tox | ||
|
||
- name: Run tox tests | ||
run: tox | ||
# - name: Analysing the code with pylint | ||
# run: | | ||
# pip install pylint | ||
# pylint $(git ls-files '*.py') | ||
|
||
- name: Deploy to GitHub Pages | ||
if: success() | ||
uses: crazy-max/ghaction-github-pages@v2 | ||
with: | ||
target_branch: gh-pages | ||
keep_history: true | ||
build_dir: docs/build/html/. | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Run unit tests using tox | ||
run: tox | ||
|
||
- name: coveralls | ||
- name: Check coverage | ||
uses: AndreMiras/coveralls-python-action@develop | ||
with: | ||
github-token: ${{ secrets.COVERALLS_TOKEN }} | ||
flag-name: 'Unit Test' | ||
debug: true | ||
debug: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a newline |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since our release version and ov version is same can we use ${{ env.RELEASE_VERSION }} instead of giving the build versione everytime