Skip to content

Commit

Permalink
Merge pull request #4 from gscho/update-path-with-c7n-org
Browse files Browse the repository at this point in the history
Create c7n-org wrapped in /usr/local/bin
  • Loading branch information
gscho authored Jun 22, 2022
2 parents 65aab3a + abae958 commit 2056ff3
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 13 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/custodian.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ jobs:
run: |
custodian schema
custodian version
echo "export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"" >> ~/.bashrc
source ~/.bashrc
c7n-org --help
- name: Install Specific Version
uses: ./
Expand Down
42 changes: 31 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,48 @@ inputs:
runs:
using: "composite"
steps:
- shell: "bash"
- name: "Install cloud custodian"
shell: "bash"
run: |
python3 -m venv custodian
source custodian/bin/activate
VERSION_ARG=""
if [ "${{ inputs.custodian-version }}" ]; then
VERSION_ARG="== ${{ inputs.custodian-version }}"
fi
pip install -Iv c7n"${VERSION_ARG}"
if [ "${{ inputs.include-azure }}" == true ]; then
pip install c7n_azure
fi
if [ "${{ inputs.include-gcp }}" == true ]; then
pip install c7n_gcp
fi
if [ "${{ inputs.include-c7n-org }}" == true ]; then
pip install c7n-org
fi
pip install --quiet -Iv c7n"${VERSION_ARG}"
dir=$(pwd)
cat << EOF > /usr/local/bin/custodian
#!/bin/bash
source ${dir}/custodian/bin/activate
custodian "\$@"
EOF
chmod +x /usr/local/bin/custodian
- name: "Install azure extension"
if: ${{ inputs.include-azure }}
shell: "bash"
run: |
source custodian/bin/activate
pip install --quiet c7n_azure
- name: "Install gcp extension"
if: ${{ inputs.include-gcp }}
shell: "bash"
run: |
source custodian/bin/activate
pip install --quiet c7n_gcp
- name: "Install c7n-org extension"
if: ${{ inputs.include-c7n-org }}
shell: "bash"
run: |
source custodian/bin/activate
pip install --quiet c7n-org
dir=$(pwd)
cat << EOF > /usr/local/bin/c7n-org
#!/bin/bash
source ${dir}/custodian/bin/activate
c7n-org "\$@"
EOF
chmod +x /usr/local/bin/c7n-org

0 comments on commit 2056ff3

Please sign in to comment.