Skip to content

Commit

Permalink
attempt fix EB CLI with custom install (#96)
Browse files Browse the repository at this point in the history
customize the EB CLI installation using a modified action from install-eb-cli-action[1]
to work around issue aws/aws-elastic-beanstalk-cli-setup#148

The idea is to install a specific version of python with a specific version of EB CLI to
make a compatible pair.

[1] https://github.com/sparkplug-app/install-eb-cli-action
  • Loading branch information
zaro0508 authored Sep 29, 2023
1 parent d49ee44 commit c68a66e
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
41 changes: 41 additions & 0 deletions .github/actions/install-eb-cli/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This script is copied from https://github.com/sparkplug-app/install-eb-cli-action to allow us
# to use a customize EB CLI install to work around issue https://github.com/aws/aws-elastic-beanstalk-cli-setup/issues/148
# This allows us to use a specific version of python with a specific version of the EB CLI
name: Install EB CLI
description: Installs the Elastic Beanstalk CLI to the GitHub Actions runner
inputs:
version:
description: Version of the EB CLI that will be installed (such as 3.20.3). Will default to latest if not specified.
required: false
python-version:
description: Version of python for the EB CLI
required: false
default: 3.x
type: string
runs:
using: 'composite'
steps:
- uses: actions/checkout@v3
with:
repository: 'aws/aws-elastic-beanstalk-cli-setup'
path: 'aws-elastic-beanstalk-cli-setup'
branch: 'master'
- uses: actions/setup-python@v2
with:
python-version: ${{inputs.python-version}}

- run: pipx install virtualenv
shell: bash

- name: Install latest EB CLI version
if: "${{ inputs.version == '' }}"
run: python $GITHUB_WORKSPACE/aws-elastic-beanstalk-cli-setup/scripts/ebcli_installer.py
shell: bash

- name: Install specific EB CLI version
if: "${{ inputs.version != '' }}"
run: python $GITHUB_WORKSPACE/aws-elastic-beanstalk-cli-setup/scripts/ebcli_installer.py --version ${{ inputs.version }}
shell: bash

- run: echo "~/.ebcli-virtual-env/executables" >> $GITHUB_PATH
shell: bash
8 changes: 2 additions & 6 deletions .github/workflows/aws-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,10 @@ jobs:
role-to-assume: ${{ inputs.role-to-assume }}
role-session-name: GHA-${{ github.repository_owner }}-${{ github.event.repository.name }}-${{ github.run_id }}
role-duration-seconds: ${{ inputs.role-duration-seconds }}
# install specific version of python and EBCLI as a workaround for https://github.com/aws/aws-elastic-beanstalk-cli-setup/issues/148
- name: Install python
uses: actions/setup-python@v4
with:
python-version: '3.8'
- name: Install EB CLI
uses: sparkplug-app/install-eb-cli[email protected]
uses: "./.github/actions/install-eb-cli"
with:
version: 3.19.4
python-version: 3.8
- name: Deploy to Beanstalk
run: ${{ inputs.ebcli-command }}

0 comments on commit c68a66e

Please sign in to comment.