diff --git a/.github/workflows/docker-push.yml b/.github/workflows/docker-push.yml index 3d0bf4c..e69de29 100644 --- a/.github/workflows/docker-push.yml +++ b/.github/workflows/docker-push.yml @@ -1,36 +0,0 @@ -name: Build and Push Image -on: - release: - types: [released] - -jobs: - build: - name: Build and push image - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v2 - - - name: Build Image - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - image: pryorda/vmware_exporter - tags: latest ${{ github.sha }} ${{ github.event.release.tag_name }} - dockerfiles: | - ./Dockerfile - - # Podman Login action (https://github.com/redhat-actions/podman-login) also be used to log in, - # in which case 'username' and 'password' can be omitted. - - name: Push To dhub - id: push-to-dhub - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} - registry: docker.io - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Print image url - run: echo "Image pushed to ${{ steps.push-to-dhub.outputs.registry-paths }}" diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml deleted file mode 100644 index 5c5a328..0000000 --- a/.github/workflows/python-package.yml +++ /dev/null @@ -1,84 +0,0 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Python Package - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - if: github.event_name == 'pull_request' - runs-on: ubuntu-latest - - strategy: - matrix: - python-version: [3.7] - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - ref: ${{ github.event.pull_request.head.sha }} - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -e . -r requirements.txt -r requirements-tests.txt python-semantic-release - sudo apt-get update && sudo apt-get install -y nodejs npm && sudo npm install -g dockerfilelint - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 vmware_exporter tests --statistics - - name: Lint dockerfile - run: dockerfilelint ./Dockerfile - - name: Test with pytest - run: | - pytest --cov=. -v tests/unit - - uses: codecov/codecov-action@v1 - - name: integration tests - run: | - pytest tests/integration - - name: Setup ruby env - uses: actions/setup-ruby@v1 - with: - ruby-version: 2.7 - - run: | - gem install pre-commit-sign - export COMMIT_MESSAGE=$(git log -1) - ruby validate-signature.rb "${COMMIT_MESSAGE}" - - deploy: - strategy: - matrix: - python-version: [3.7] - - runs-on: ubuntu-latest - if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }} - - steps: - - uses: actions/checkout@v2 - with: - token: ${{ secrets.GH_TOKEN }} - fetch-depth: 0 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: install semantic-release - run: | - pip install python-semantic-release - - name: deploy pip - run: | - git config --global user.name "semantic-release (via github actions)" - git config --global user.email "semantic-release@github-actions" - semantic-release publish - env: # Or as an environment variable - GH_TOKEN: ${{ secrets.GH_TOKEN }} - PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }} diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c7328df --- /dev/null +++ b/.travis.yml @@ -0,0 +1,56 @@ +--- + +language: python +dist: xenial # required for Python >= 3.7 +sudo: required +cache: + directories: + - "$HOME/.cache/pip" + - "$HOME/.pyenv" +matrix: + include: + - name: "Python 3.6 Unit-test" + python: 3.6 + - name: "Python 3.7 Unit-test" + python: 3.7 + - name: "Python 3.7 Docker Unit and Integration-test" + python: 3.7 + services: + - docker + env: + - BUILD_SDIST=true + - INTEGRATION_TEST=true + +install: + - pip install -e . -r requirements.txt -r requirements-tests.txt + - grep -Rl packagecloud /etc/apt/ |sudo xargs rm -vf + - sudo apt-get update && sudo apt-get install -y nodejs npm + - npm install -g dockerfilelint + - if [ $INTEGRATION_TEST == "true" ]; then + pip install python-semantic-release; + fi + +script: + - dockerfilelint ./Dockerfile + - flake8 vmware_exporter tests + - pytest --cov=. -v tests/unit + - if [ $INTEGRATION_TEST == "true" ]; then + pytest tests/integration; + else + echo "Skipped Integration-Tests"; + fi + +after_success: + - codecov + - if [ $INTEGRATION_TEST == "true" ]; then + git config --global user.name "semantic-release (via TravisCI)"; + git config --global user.email "semantic-release@travis"; + semantic-release publish; + semantic-release changelog --post; + fi + +env: + global: + - secure: qC8DzqyxBiBBBUGLuNOO2O6XgmUaLhTi1ArfhYxVDjv5vTJvCNO1DpXfFqXJGR3wrRKe1DOddXildOEL7d7xX6Y3b+k3urnPfqnAM/Hvr0djqDWRPuZl89Fg1mrAvBV3LL/ZsrWKHDc3keD/vTcPAsrnJl3MdS5fMKBwEuDmhpnNdGk0Wty357WxWBaz1JYBoGaqbw0JWAAA5UdfyF3aOybRONXcVqnxqSeR43drBLSdAwBJVVhyv3IYX3HRMCP8vXz43LqWK16z8KVPyrwwzE2WXlq+2FypLtM4A/XOssx4M77MefIMC6ydAimLh33gYtaiuO7+fYipLlOlChNO/pxX43FM+7UuKWaL9MWaUvypmOGo+jp/y6PzbIDz/RH4T8mjaswIe22nyTR/Gbtph/58CISGGEtRNKXjE4/OD1gjodcNS2NkwNQimxjHv30rH4X4Z+JYU+I3iobpmWJ5WJsyMnS3jWkRluRgA+8djuRviK4sdIBwk2qC2AGuZ1c6EJbEN7f3sRIgtQMYd1JAiZVwYmRa08hpulvrZAzxqx/PfkaEOBFQrBwISkD2Oq3MGlDSV+sUe53TmRM1KO9y5fC8XnJHRJv5mw+iWaEIImP2muXufdm101oXNzHbs3hC2kYIFD+u1BoVDgWACUIkj2oRxMJ4p3ynlbccALUc8y0= + - secure: GWTsOe1CGvEi/n7k+c91UisQAf7UcofZKeO8EI6n0abRPQii0rfMIQ7fS2KFUyR7I/nk02YrZcd1etAGTVthc9K3YrUhM68eu+ztlUX6Sr5SM6PseYWkgf+G0I+IIoCpqSjwL/9J4jTP1hvNlP7n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BkFmqUUa34FObzIaGegq4fD3kMKz9N+impQRvNI9WiDqtRvBJTCaP28ibUainxslW4Ep4rcmWo6synf2q6aWTrUPxXl0jvd6eIuCCvWPH7uLXZhL0dYm5ID/9BOCd3TZcvVjBKW0xWkFafNyt2USJto= diff --git a/README.md b/README.md index 5215eaa..4ae89b3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,3 @@ -# Needs new home. Since Broadcom is no longer catering to its opensource/free base, I have decided to move on from maintaining this project. Please create a discussion if you would like to take over managing this project. - - # vmware_exporter VMware vCenter Exporter for Prometheus.