github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/sawtooth-core-master/ci/sawtooth-publish-python-sdk (about) 1 # Copyright 2017 Intel Corporation 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # http://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 # ------------------------------------------------------------------------------ 15 16 # Description: 17 # Builds an environment to publish the Sawtooth Python SDK to PyPI. 18 # Two variables, $PYPI_USER and $PYPI_PASS, must be passed in at runtime 19 # using Docker's -e option. 20 21 FROM ubuntu:xenial 22 23 RUN apt-get update \ 24 && apt-get install -y \ 25 ca-certificates \ 26 python3 \ 27 python3-pip \ 28 && apt-get clean \ 29 && rm -rf /var/lib/apt/lists/* \ 30 && pip3 install --upgrade setuptools \ 31 && echo '[distutils]\n\ 32 index-servers =\n\ 33 pypi\n\ 34 \n\ 35 [pypi]\n\ 36 username=@USER@\n\ 37 password=@PASS@\n\ 38 ' > /root/.pypirc 39 40 CMD sed -i'' -e "s/@USER@/$PYPI_USER/g" /root/.pypirc \ 41 && sed -i'' -e "s/@PASS@/$PYPI_PASS/g" /root/.pypirc \ 42 && cd /project/sawtooth-core/sdk/python \ 43 && python3 setup.py sdist upload -r pypi \ 44 && cd /project/sawtooth-core/signing \ 45 && python3 setup.py sdist upload -r pypi