|
1 |
| -## AWS Elastic Beanstalk CLI Setup |
| 1 | +## EBCLI Installer |
2 | 2 |
|
3 |
| -The EB CLI is a command line interface for Elastic Beanstalk that provides interactive commands that simplify creating, updating and monitoring environments from a local repository. |
| 3 | +------ |
4 | 4 |
|
5 |
| -## License |
| 5 | +### 1. Overview |
| 6 | + |
| 7 | +------ |
| 8 | + |
| 9 | +This repository hosts scripts to generate self-contained installations of the [EBCLI](https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli3.html). |
| 10 | + |
| 11 | +------ |
| 12 | + |
| 13 | +### 2. Usage |
| 14 | + |
| 15 | +------ |
| 16 | + |
| 17 | +#### 2.1. Clone this repository: |
| 18 | + |
| 19 | +```bash |
| 20 | +git clone https://github.com/aws/aws-elastic-beanstalk-cli-setup.git |
| 21 | +``` |
| 22 | + |
| 23 | +#### 2.2. Install: |
| 24 | + |
| 25 | +On Bash and Zsh: |
| 26 | + |
| 27 | +```bash |
| 28 | +python aws-elasticbeanstalk-cli-setup/scripts/bundled_installer |
| 29 | +``` |
| 30 | + |
| 31 | +On PowerShell and CMD Prompt: |
| 32 | + |
| 33 | +```bash |
| 34 | +python .\aws-elasticbeanstalk-cli-setup\scripts\bundled_installer |
| 35 | +``` |
| 36 | + |
| 37 | +#### 2.3. Post-installation activities: |
| 38 | + |
| 39 | +The emitted output will contain instructions to add the EBCLI (and Python) executable to the shell's `$PATH` variable, if it is not already in it. Ensure you follow the steps emitted in the output. |
| 40 | + |
| 41 | +#### 2.4. Demo execution of `bundled_installer` |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +### 3. Advanced usage: |
| 46 | + |
| 47 | +To install the EBCLI, `bundled_installer` runs `ebcli_installer.py`. `ebcli_installer.py` has the following capabilities: |
| 48 | + |
| 49 | + - to install a **specific version** of the EBCLI: |
| 50 | + |
| 51 | + ```bash |
| 52 | + python scripts/ebcli_installer.py --version 3.14.13 |
| 53 | + ``` |
| 54 | + |
| 55 | + - to install the EBCLI with a specific **version of Python** (such a `python` need not even exist in `$PATH`) |
| 56 | + |
| 57 | + ```bash |
| 58 | + python scripts/ebcli_installer.py --python-installation /path/to/some/python/on/your/computer |
| 59 | + ``` |
| 60 | + |
| 61 | + - to install the EBCLI **from source** (Git repository, .tar, .zip) |
| 62 | + ```bash |
| 63 | + python scripts/ebcli_installer.py --ebcli-source /path/to/awsebcli.zip |
| 64 | +
|
| 65 | + python scripts/ebcli_installer.py --ebcli-source /path/to/EBCLI/codebase/on/your/computer |
| 66 | + ``` |
| 67 | + - to install the EBCLI at a **specific location** rather than the standard `.ebcli-virtual-env` directory in the user's home. |
| 68 | +
|
| 69 | + ```bash |
| 70 | + python scripts/ebcli_installer.py --location /path/to/ebcli/installation/location |
| 71 | + ``` |
| 72 | +
|
| 73 | +Run the following to view the help text associated with `ebcli_installer.py`: |
| 74 | +
|
| 75 | +```bash |
| 76 | +python scripts/ebcli_installer.py --help |
| 77 | +``` |
| 78 | +
|
| 79 | +### 4. FAQs: |
| 80 | +
|
| 81 | +------ |
| 82 | +
|
| 83 | +#### 4.1. Can I skip Python installation? |
| 84 | +
|
| 85 | +**Yes.** If you already have Python installed on your system, you can simply run the following after step `2.1.`: |
| 86 | +
|
| 87 | +On **Bash** and **Zsh**: |
| 88 | +
|
| 89 | +```bash |
| 90 | +python aws-elasticbeanstalk-cli-setup/scripts/ebcli_installer.py |
| 91 | +``` |
| 92 | +
|
| 93 | +On **PowerShell** and **CMD Prompt**: |
| 94 | +
|
| 95 | +```bash |
| 96 | +python .\aws-elasticbeanstalk-cli-setup\scripts\ebcli_installer.py |
| 97 | +``` |
| 98 | +
|
| 99 | +#### 4.2. For the **seasoned Python developer**, what is the advantage of this mode of installation over regular `pip` inside a `virtualenv`: |
| 100 | +
|
| 101 | +Even within a `virtualenv`, a developer might find the need to install multiple packages whose dependencies are in conflict. For instance, at various points in time, the AWSCLI and the EBCLI have been conflict with one another due to their dependency on `botocore`. [One such instance](https://github.com/aws/aws-cli/issues/3550) was particularly egregious. When there are conflicts, users have to bear the onus of managing separate virtualenvs for each of the conflicting packages, or find a combination of the packages devoid of conflicts. Both these workarounds become unmanageable over time and as the number of packages that are in conflict increases. |
| 102 | +
|
| 103 | +#### 4.3. On OS X (or Linux systems with `brew`), is this better than `brew install awsebcli`? |
| 104 | +
|
| 105 | +**Yes**, for a few reasons: |
| 106 | +
|
| 107 | + - the Beanstalk team does not have control over how `brew` operates. So installation problems will take time to fix as will general queries to be responded to. |
| 108 | + - the `brew install ...` mechanism does not solve the problem of dependency conflicts, which is a primary goal of this project. |
| 109 | +
|
| 110 | +#### 4.3. For the developers who are **new to Python**, does this mode of installation pose challenges? |
| 111 | +
|
| 112 | +The opinion of the Beanstalk team is "**No**". |
| 113 | +
|
| 114 | +Aside from the problem described in `3.2.`, developers new to Python are often confused by the presence of multiple Pythons, and `pip` executables on their system. A common problem that such developers encounter is where they install `eb` with one `pip` executable (presumably using the `sudo` prefix) only to find that only to find that no `eb`-related commands work because the correct set of directories is not properly referenced. |
| 115 | +
|
| 116 | +Normally, for such developers, usage of `virtualenv` is the correct path forward, however, this becomes yet another hurdle before executing with `eb`. |
| 117 | +
|
| 118 | +Another common problem is where users install Python and `pip` though means not recommended by AWS Documentation such as arbitrary PPAs on Ubuntu, or similar unmaintained sources that lack scrutiny. |
| 119 | +
|
| 120 | +#### 4.4. Can I execute the Bash scripts in a Cygwin, git-bash and other Bash-like shells on Windows? |
| 121 | +
|
| 122 | +**No**. At this time, we do not directly support execution on Bash-like environments on Windows. Please use PowerShell or CMD Prompt to install. You may add to `$PATH` the location of the `eb` and `Python` executables. |
| 123 | +
|
| 124 | +#### 4.5. Can I execute the Bash scripts in a `fish` shell? |
| 125 | +**Yes**, but only if you have Bash on your computer. At this time we do not provide specific guidance on how to set `$PATH` in Fish, however, Fish has [detailed documentation](https://fishshell.com/docs/current/tutorial.html#tut_path) for this purpose. |
| 126 | +
|
| 127 | +#### 4.6. I already have Python installed. Can I still execute `bundled_installer`? |
| 128 | +
|
| 129 | +**Yes**. It is safe to execute `bundled_installer` even if you already have a Python installed. The installer will simply skip reinstallation. |
| 130 | +
|
| 131 | +#### 4.7. I already have the EBCLI installed. Can I still execute `ebcli_installer.py`? |
| 132 | +
|
| 133 | +**Yes**. |
| 134 | +
|
| 135 | +There are two cases to consider: |
| 136 | +
|
| 137 | +- `ebcli_installer.py` was previously run, thereby creating `.ebcli-virtual-env` in the user's home directory (or the user's choice of a directory indicated through the `--location` argument). In this case, the EBCLI will simply overwrite `.ebcli-virtual-env` and attempt to install the latest version of the EBCLI in the virtualenv within it. |
| 138 | +
|
| 139 | +- `eb` is in `$PATH`, however, it was not installed by `ebcli_installer.py`. In this case, the installer will install `eb` within `.ebcli-virtual-env` in the user's home directory (or the user's choice of a directory indicated through the `--location` argument) and prompt the user to prefix `/path-to/.ebcli-virtual-env/executables` to `$PATH`. Until you perform this action, the older `eb` executable will continue to be referenced when you type `eb`. |
| 140 | +
|
| 141 | +#### 4.8. How does `ebcli_installer.py` work? |
| 142 | +
|
| 143 | +Upon executing the Python script, it will: |
| 144 | +
|
| 145 | +- create a virtualenv exclusive to the `eb` installation |
| 146 | +- install `eb` inside that virtualenv |
| 147 | +- generate inside the `<installation-location>/executables` directory: |
| 148 | + - a `.py` wrapper for `eb` on Linux/OS X |
| 149 | + - `.bat` and `.ps1` wrappers for `eb` on Windows |
| 150 | +- upon completion, you will be prompted to add `<installation-location>/executables` to `$PATH`, only if the directory is not already in it. |
| 151 | +
|
| 152 | +#### 4.8. How does `bundled_installer` work? |
| 153 | +
|
| 154 | +- On OS X/Linux, `bundled_installer` uses the extremely popular [`pyenv` project](https://github.com/pyenv/pyenv) to install the latest version of Python 3.7. |
| 155 | +- On Windows, it simply downloads the MSI installer of the latest Python from Python's website and silently installs it. |
| 156 | + |
| 157 | +#### 4.9. Are there dependency problems that this mode of installation does not solve? |
| 158 | + |
| 159 | +Unfortunately, **yes**. |
| 160 | + |
| 161 | +Suppose the dependencies of `eb`, say `Dep A` and `Dep B` are in conflict. Because `pip` lacks dependency management capabilities, the resulting `eb` installation might be rendered defective. |
| 162 | + |
| 163 | +#### 4.10. Is it okay to use Python 2.7 to install the EBCLI? |
| 164 | + |
| 165 | +**Yes**, however, note that Python 2.7 will become deprecated on the 1st of January 2020, beyond which point, security updates will cease to come through. |
| 166 | + |
| 167 | +Besides, the latest minor version series, Python 3.7, offers significant improvements over the Python 2.7 series, and it is highly recommended that you use Python 3.7 for the purposes of testing, even though the Beanstalk team tests the EBCLI against Python 2.7. |
| 168 | + |
| 169 | +### 5. License |
6 | 170 |
|
7 | 171 | This library is licensed under the Mozilla Public License Version 2.0.
|
0 commit comments