Created
November 9, 2018 14:43
-
-
Save rikonor/068ab668abd62ddeddfcc9b623765330 to your computer and use it in GitHub Desktop.
Installing from artifacts-repo vs pypiserver
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set up dir of packages | |
| mkdir packages && cd packages | |
| pip download docker | |
| # Create a tar with all the packages | |
| tar -czf python-packages.tar.gz * | |
| # Upload to artifacts repository | |
| ./upload python-packages.tar.gz | |
| # Download archive | |
| wget http://nexus/python-packages.tar.gz | |
| # Extract packages | |
| tar -xzf python-packages.tar.gz && rm python-packages.tar.gz | |
| # Install package | |
| pip install \ | |
| --no-index \ | |
| --find-links . \ | |
| docker-3.5.1-py2.py3-none-any.whl | |
| # Remove local artifacts | |
| rm * | |
| # Salt state example | |
| get_file: | |
| file.managed: | |
| - name: python-packages.tar.gz | |
| - source: http://nexus/python-packages.tar.gz | |
| - skip_verify: True | |
| extract_archive: | |
| archive.extracted: | |
| - name: /tmp/python-packages | |
| - source: /tmp/python-packages.tar.gz | |
| install docker python library: | |
| pip.installed: | |
| - name: /tmp/python-packages/docker-3.5.1-py2.py3-none-any.whl | |
| - find_links: /tmp/python-packages | |
| - no_index: True | |
| - reload_modules: True | |
| remove_file: | |
| file.absent: | |
| - name: /tmp/python-packages.tar.gz | |
| remove_artifacts: | |
| file.absent: | |
| - name: /tmp/python-packages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Set up dir of packages | |
| mkdir packages && cd packages | |
| pip download docker | |
| # Set up pypiserver | |
| docker run \ | |
| --rm -it \ | |
| -v packages:/data/packages \ | |
| --network pypiserver \ | |
| --name pypiserver \ | |
| pypiserver/pypiserver:v1.2.4 | |
| # Download from pypiserver | |
| pip install \ | |
| --index-url http://pypiserver:8080/simple \ | |
| --trusted-host pypiserver \ | |
| docker | |
| # Salt state example | |
| install docker python library: | |
| pip.installed: | |
| - name: docker | |
| - index_url: http://pypiserver:8080/simple | |
| - trusted_host: pypiserver | |
| - reload_modules: True |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment