diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..f0f9848 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,8 @@ +root = true + +[*] +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..365c12a --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,107 @@ +--- +# This is a basic workflow to help you get started with Actions + +name: CI + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events + # but only for the main branch + push: + branches: [main] + pull_request: + branches: ['*'] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs +# that can run sequentially or in parallel +jobs: + ci: + env: + ARTIFACTORY_TOKEN: "${{ secrets.ARTIFACTORY_TOKEN }}" + ARTIFACTORY_REPO: "${{ secrets.ARTIFACTORY_REPO }}" + ARTIFACTORY_URL: "${{ secrets.ARTIFACTORY_URL }}" + collection_namespace: ibm + collection_name: spm_middleware + python_ver: 3.8 + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + scenario: + - websphere-v90-centos-8 + - websphere-v85-centos-7 + - db2111 + - db2115 + - oracle12cR1-centos-7 + - oracle12cR2-centos-7 + - oracle19c-centos-8 + - iim-191-centos-8 + - ihs-v90-centos-8 + - ihs-v80-centos-7 + - ohs-v12.2.1-centos-7 + - ohs-v12.2.1-centos-8 + - ohs-v12.1.3-centos-7 + - liberty-centos-7 + - liberty-centos-8 + - weblogic-centos-7 + - weblogic-centos-8 + defaults: + run: + working-directory: ansible_collections/${{ env.collection_namespace }}/${{ env.collection_name }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: ansible_collections/${{ env.collection_namespace }}/${{ env.collection_name }} + - name: Setup Python v${{ env.python_ver }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env.python_ver }} + # remove android and dotnet to gain more spaces for oracle installation + - name: Maximize build space + run: | + df -h + sudo rm -rf /usr/local/lib/android + sudo rm -rf /usr/share/dotnet + df -h + - name: Setup Python Cache + uses: actions/cache@v2 + with: + key: pip-${{ matrix.scenario }}-${{ hashFiles('ci-requirements.txt') }} + path: | + ~/.cache/pip + !~/.cache/pip/log/debug.log + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -r ci-requirements.txt + - name: Prepare environment + run: | + mkdir -pv ~/.ansible/collections/${{ env.collection_namespace }} + ln -s ansible_collections/${{ env.collection_namespace }}/${{ env.collection_name }} ~/.ansible/collections/${{ env.collection_namespace }}/${{ env.collection_name }} + chmod -v +x ./scripts/* + - name: Sanity checks + run: | + ansible-test sanity --docker -v --color --python ${{ env.python_ver }} + - name: Molecule + run: | + molecule test -s ${{ matrix.scenario }} + # - name: Publish to Galaxy + # env: + # ANSIBLE_GALAXY_SERVER_LIST: release + # ANSIBLE_GALAXY_SERVER_RELEASE_URL: https://galaxy.ansible.com/ + # ANSIBLE_GALAXY_SERVER_RELEASE_TOKEN: "${{ secrets.GALAXY_TOKEN }}" + # run: | + # ansible-galaxy collection build + # ls -l *.tar.gz + # ansible-galaxy collection publish -c -vvv "./${{ env.collection_namespace }}-${{ env.collection_name }}-*.tar.gz" + # - name: Create GitHub Release + # uses: marvinpinto/action-automatic-releases@latest + # with: + # repo_token: "${{ secrets.GITHUB_TOKEN }}" + # prerelease: false + # files: | + # ${{ env.collection_namespace }}-${{ env.collection_name }}-*.tar.gz diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..eba6226 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,71 @@ +--- +# This is a basic workflow to help you get started with Actions +name: release + +# Controls when the workflow will run +on: + # Triggers the workflow on push or pull request events + # but only for the main branch + push: + branches: [main] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs +# that can run sequentially or in parallel +jobs: + release: + env: + collection_namespace: ibm + collection_name: spm_middleware + python_ver: 3.8 + runs-on: ubuntu-latest + defaults: + run: + working-directory: ansible_collections/${{ env.collection_namespace }}/${{ env.collection_name }} + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + path: ansible_collections/${{ env.collection_namespace }}/${{ env.collection_name }} + - name: Setup Python v${{ env.python_ver }} + uses: actions/setup-python@v2 + with: + python-version: ${{ env.python_ver }} + + - name: Setup Python Cache + uses: actions/cache@v2 + with: + key: pip-${{ matrix.scenario }}-${{ hashFiles('ci-requirements.txt') }} + path: | + ~/.cache/pip + !~/.cache/pip/log/debug.log + - name: Install dependencies + run: | + python -m pip install -U pip + python -m pip install -r ci-requirements.txt + - name: Prepare environment + run: | + mkdir -pv ~/.ansible/collections/${{ env.collection_namespace }} + ln -s ansible_collections/${{ env.collection_namespace }}/${{ env.collection_name }} ~/.ansible/collections/${{ env.collection_namespace }}/${{ env.collection_name }} + chmod -v +x ./scripts/* + - name: Not fully ready yet + run: | + echo "Need more test before push to https://galaxy.ansible.com/" + # - name: Publish to Galaxy + # env: + # ANSIBLE_GALAXY_SERVER_LIST: release + # ANSIBLE_GALAXY_SERVER_RELEASE_URL: https://galaxy.ansible.com/ + # ANSIBLE_GALAXY_SERVER_RELEASE_TOKEN: "${{ secrets.GALAXY_TOKEN }}" + # run: | + # ansible-galaxy collection build + # ls -l *.tar.gz + # ansible-galaxy collection publish -c -vvv "./${{ env.collection_namespace }}-${{ env.collection_name }}-*.tar.gz" + # - name: Create GitHub Release + # uses: marvinpinto/action-automatic-releases@latest + # with: + # repo_token: "${{ secrets.GITHUB_TOKEN }}" + # prerelease: false + # files: | + # ${{ env.collection_namespace }}-${{ env.collection_name }}-*.tar.gz diff --git a/galaxy.yml b/galaxy.yml index 964d69c..45c4d2c 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -10,7 +10,7 @@ namespace: ibm name: spm_middleware # The version of the collection. Must be compatible with semantic versioning -version: 1.1.2 +version: 1.1.3 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md