ReleaseEngineering/How To/Upload to internal Pypi: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(removed blank lines)
(Updated the page to contain a few more information.)
Line 1: Line 1:
= Overview =
__TOC__
 
== Overview ==
Mozharness no longer uses packages from the PuppetAgain repositories! Instead, it uses http://pypi.pub.build.mozilla.org/pub and http://pypi.pvt.build.mozilla.org/pub, both served from the same directory.
Mozharness no longer uses packages from the PuppetAgain repositories! Instead, it uses http://pypi.pub.build.mozilla.org/pub and http://pypi.pvt.build.mozilla.org/pub, both served from the same directory.


= Steps =
== Steps ==
In order to upload to internal Pypi a package you simply need to run the script bellow :
In order to upload to internal Pypi a package you simply need to run the script bellow :
* https://hg.mozilla.org/build/braindump/file/default/utils/publish_package_our_pypi.sh
* https://hg.mozilla.org/build/braindump/file/default/utils/publish_package_our_pypi.sh
=== Downloading or Updating the repo ===
'''publish_package_our_pypi.sh''' is available on the [https://hg.mozilla.org/build/braindump/file/default/utils/publish_package_our_pypi.sh braindump repository] which can be clone using:
<pre>hg clone https://hg.mozilla.org/build/braindump/</pre>
''Note:'' Make sure that you are using the latest revision of the script. You can update your repo with '''hg pull''' from within the local repository folder.
=== DEBUGGING: Upload failed because of authentification errors. ===
The upload script expects that your machine/vm will have the same username as your Mozilla LDAP. If you aren't sure how to check this, open a new terminal and type:
<pre>echo "Machine username is: $(whoami)"</pre>
If the machine username is not the same as your Mozilla LDAP, we recommend you to either create a new username with your Mozilla LDAP username or change '''$(whoami)''' inside the script to be equal to your LDAP username.
== Uploading to PyPi ==
If your repository is up-to-date and your machine user is the same with your LDAP, all you have to do now is to have a download link from the developer requesting the package upload, make sure the link has an md5 hash in it at the end, download the package and run the following command:
<pre>bash ./publish_package_our_pypi.sh PATH/TO/FILE</pre>


The script will practically copy the file to relengwebadmin and move it where the files are located for pypi internal (/mnt/netapp/relengwebadmin/pypi/pub) then will change the rights and upload the file to  
The script will practically copy the file to relengwebadmin and move it where the files are located for pypi internal (/mnt/netapp/relengwebadmin/pypi/pub) then will change the rights and upload the file to  
http://pypi.pub.build.mozilla.org/pub.
http://pypi.pub.build.mozilla.org/pub.


= See also =
If everything worked fine, you should now have a link that looks like this:
'''http://pypi.pub.build.mozilla.org/pub/FILE-NAME-HERE'''
== See also ==
* [https://bugzilla.mozilla.org/show_bug.cgi?id=1286278 bug 1286278]
* [https://bugzilla.mozilla.org/show_bug.cgi?id=1286278 bug 1286278]

Revision as of 03:33, 4 March 2018

Overview

Mozharness no longer uses packages from the PuppetAgain repositories! Instead, it uses http://pypi.pub.build.mozilla.org/pub and http://pypi.pvt.build.mozilla.org/pub, both served from the same directory.

Steps

In order to upload to internal Pypi a package you simply need to run the script bellow :

Downloading or Updating the repo

publish_package_our_pypi.sh is available on the braindump repository which can be clone using:

hg clone https://hg.mozilla.org/build/braindump/

Note: Make sure that you are using the latest revision of the script. You can update your repo with hg pull from within the local repository folder.

DEBUGGING: Upload failed because of authentification errors.

The upload script expects that your machine/vm will have the same username as your Mozilla LDAP. If you aren't sure how to check this, open a new terminal and type:

echo "Machine username is: $(whoami)"

If the machine username is not the same as your Mozilla LDAP, we recommend you to either create a new username with your Mozilla LDAP username or change $(whoami) inside the script to be equal to your LDAP username.

Uploading to PyPi

If your repository is up-to-date and your machine user is the same with your LDAP, all you have to do now is to have a download link from the developer requesting the package upload, make sure the link has an md5 hash in it at the end, download the package and run the following command:

bash ./publish_package_our_pypi.sh PATH/TO/FILE

The script will practically copy the file to relengwebadmin and move it where the files are located for pypi internal (/mnt/netapp/relengwebadmin/pypi/pub) then will change the rights and upload the file to http://pypi.pub.build.mozilla.org/pub.

If everything worked fine, you should now have a link that looks like this: http://pypi.pub.build.mozilla.org/pub/FILE-NAME-HERE

See also