Skip to content

Commit

Permalink
Changes for private S3 packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie Cressey committed Jun 27, 2016
1 parent dafb0fe commit 4bf9dce
Show file tree
Hide file tree
Showing 13 changed files with 35 additions and 633 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016 November Five
Copyright (c) 2016 Jamie Cressey

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
36 changes: 13 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
S3PyPI
PyPiS3
======

S3PyPI is a CLI tool for creating a Python Package Repository in an S3 bucket.

An extended tutorial on using this tool can be found [here](https://novemberfive.co/blog/opensource-pypi-package-repository-tutorial/).
PyPiS3 is a fork of [S3PyPI](https://github.com/novemberfiveco/s3pypi) is a CLI tool for creating a Python Package Repository in an S3 bucket, adapted for use as a private PyPi repository entirely backed by S3 storage.


Installation
Expand All @@ -12,54 +10,46 @@ Installation
Install the latest version:

```bash
pip install --upgrade s3pypi
pip install --upgrade pypis3
```

Install the development version:

```bash
git clone -b develop git@github.com:novemberfiveco/s3pypi.git
cd s3pypi/ && sudo pip install -e .
git clone -b develop git@github.com:jamiecressey/pypis3.git
cd pypis3/ && sudo pip install -e .
```


Setting up S3 and CloudFront
Setting up S3 and S3Auth
----------------------------

Before you can start using ``s3pypi``, you must set up an S3 bucket for your Python Package Repository, with static website hosting enabled. Additionally, you need a CloudFront distribution for serving the packages in your S3 bucket to ``pip`` over HTTPS. Both of these resources can be created using the CloudFormation templates provided in the ``cloudformation/`` directory:

```bash
aws cloudformation create-stack --stack-name STACK_NAME \
--template-body file://cloudformation/s3-pypi.json \
--parameters ParameterKey=ServerCertificateId,ParameterValue=SERVER_CERT_ID \
ParameterKey=DomainName,ParameterValue=DOMAIN_NAME
```

[Managing Your Server Certificates](http://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_server-certs_manage.html)
Before you can start using ``pypis3``, you must set up a S3Auth enabled bucket. Following the steps on their website: http://www.s3auth.com/

Distributing packages
---------------------

You can now use ``s3pypi`` to create Python packages and upload them to your S3 bucket. To hide packages from the public, you can specify a secret subdirectory using the ``--secret`` option:
You can now use ``pypis3`` to create Python packages and upload them to your S3 bucket:

```bash
cd /path/to/your/awesome-project/
s3pypi --bucket mybucket [--secret SECRET]
pypis3 --bucket mybucket --url pypi.example.com
```


Installing packages
-------------------

Install your packages using ``pip`` by pointing the ``--extra-index-url`` to your CloudFront distribution (optionally followed by a secret subdirectory):
Install your packages using ``pip`` by pointing the ``--extra-index-url`` to your S3Auth enabled bucket:

```bash
pip install --upgrade awesome-project --extra-index-url https://pypi.example.com/SECRET/
pip install --upgrade awesome-project --extra-index-url http://pypi.example.com/
```

Alternatively, you can configure the index URL in ``~/.pip/pip.conf``:

```
[global]
extra-index-url = https://pypi.example.com/SECRET/
extra-index-url = http://pypi.example.com
```

29 changes: 0 additions & 29 deletions cloudformation/s3-iam-bucket-policy.json

This file was deleted.

Loading

0 comments on commit 4bf9dce

Please sign in to comment.