Quickstart for upstream commit

Here is a summary of steps required to start pushing code on OpenStack.

Account

As a first step, you need to create an account on launchpad, sign the Contributor License Agreement and upload your SSH key.

You also need to be a  OpenStack Foundation member, the match is based on email address so you need to provide the same on both side.

Then you need to setup git if it’s not already done:

git config --global user.name "Firstname Lastname"
git config --global user.email "your_email@youremail.com"
git config --global gitreview.username yourgerritusername
sudo apt-get install git-review
sudo apt-get install python-pip

Devstack

Devstack will be necessary for the test part and the links with others stack in the project.

git clone https://github.com/openstack-dev/devstack.git

Then you need to setup local.conf. Here is en example :

[[local|localrc]]
ADMIN_PASSWORD=mypassword
DATABASE_PASSWORD=$ADMIN_PASSWORD
RABBIT_PASSWORD=$ADMIN_PASSWORD
SERVICE_PASSWORD=$ADMIN_PASSWORD
SERVICE_TOKEN=a682f596-76f3-11e3-b3b2-e716f9f80e50
FIXED_RANGE=172.16.200.0/24
NETWORK_GATEWAY=172.16.200.1
FLOATING_RANGE=192.168.200.0/24
PUBLIC_NETWORK_GATEWAY=192.168.200.1
HOST_IP=192.168.1.12
disable_service n-net
enable_service q-svc
enable_service q-agt
enable_service q-dhcp
enable_service q-l3
enable_service q-meta
enable_service neutron
# Optional, to enable tempest configuration as part of devstack
RECLONE=yes

# Swift
enable_service tempest s-proxy s-object s-container s-account
SWIFT_HASH=66a3d6b56c1f479c8b4e70ae5c2000f5
SWIFT_REPLICAS=1
SWIFT_DATA_DIR=$DEST/data/swift

To validate the configuration and launch the whole stacks, run:

./stack.sh

Working on a project

We will work on Swift for the example. You should start by pulling the official repo and set the Gerrit configuration with « review ».

mkdir ~/my_swift
cd ~/my_swift
git clone git://git.openstack.org/openstack/swift.git .
git review -s
git checkout -b my_swift

As you’ve just created a new Swift, you need to tell to devstack where it is.

SWIFT_REPO=/opt/stack/my_swift
SWIFT_BRANCH=my_swift

Tests

The unitary tests are managed by tox and the integrating tests are managed by devstack.

Commit

Then the commit itself is made as usually, you simply need to have an Change-Id (–amend) to push the commit for the review.

git commit -a
git commit --amend
git review

And then, the image result:

commit-OS

More info

All this information comes from wiki.openstack.org :

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *