diff options
author | Dickson S. Guedes | 2011-10-12 22:35:19 +0000 |
---|---|---|
committer | Dickson S. Guedes | 2011-10-12 22:35:19 +0000 |
commit | 91ae5ef24352af905d6c8d530fbfaa28e1e15426 (patch) | |
tree | 66440e87fe9cb7a60d6c6a9d6113292218516a97 /README.md | |
parent | da852cd006cfd841fddb78fb363a0c3fb315dfe2 (diff) | |
parent | ef10e820f22f190a2a16dfc06b15a7b6f645b7d4 (diff) |
Added git support.
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 73 |
1 files changed, 55 insertions, 18 deletions
@@ -4,7 +4,7 @@ pgxn utils What is it? -------- -It aims to be a set of task to help PostgreSQL extension's developers to focus more on the problem that they wants to solve than in all structure and files and control files need to PGXS to build the extension. +It aims to be a set of task to help PostgreSQL extension's developers to focus more on the problem that they wants to solve than in the structure and files and control files need to PGXS to build the extension. How to install it? ------------------ @@ -17,24 +17,27 @@ Or you can install it by rubygems: gem install pgxn_utils + How it works? ------------- -It is all about tasks. Let's see what tasks we have: +It is all about tasks. Let's see them: - $ pgxn_utils help + $ pgxn-utils help Tasks: - pgxn_utils bundle [extension_name] # Bundles an extension. - pgxn_utils change [extension_name] # Change META's attributes in current extension. - pgxn_utils help [TASK] # Describe available tasks or one specific task - pgxn_utils release filename # Release a extension - pgxn_utils skeleton extension_name # Creates an extension skeleton in current directory. + pgxn-utils bundle [extension_name] # Bundles the extension in a zip file + pgxn-utils change [extension_name] # Changes META's attributes in current extension + pgxn-utils help [TASK] # Describe available tasks or one specific task + pgxn-utils release filename # Release an extension to PGXN + pgxn-utils skeleton extension_name # Creates an extension skeleton in current directory + # Creating a new extension - $ pgxn_utils skeleton my_cool_extension + $ pgxn-utils skeleton my_cool_extension create my_cool_extension create my_cool_extension/my_cool_extension.control + create my_cool_extension/.gitignore create my_cool_extension/META.json create my_cool_extension/Makefile create my_cool_extension/README.md @@ -44,13 +47,32 @@ It is all about tasks. Let's see what tasks we have: create my_cool_extension/test/expected/base.out create my_cool_extension/test/sql/base.sql +You can start creating an extension with or without version control. By default `pgxn-utils` +supports [git](http://git-scm.org) but it will not create a repository unless you use `--git` +option in the skeleton task. + + $ pgxn-utils skeleton my_cool_versioned_extension --git + create my_cool_versioned_extension + create my_cool_versioned_extension/my_cool_versioned_extension.control + create my_cool_versioned_extension/.gitignore + create my_cool_versioned_extension/META.json + create my_cool_versioned_extension/Makefile + create my_cool_versioned_extension/README.md + create my_cool_versioned_extension/doc/my_cool_versioned_extension.md + create my_cool_versioned_extension/sql/my_cool_versioned_extension.sql + create my_cool_versioned_extension/sql/uninstall_my_cool_versioned_extension.sql + create my_cool_versioned_extension/test/expected/base.out + create my_cool_versioned_extension/test/sql/base.sql + init /tmp/my_cool_versioned_extension + commit initial commit + Thats it! Just start coding! ":) # Changing something Well suppose you want to change the default maintainer's name and the license, well just do: - $ pgxn_utils change my_cool_extension --maintainer "Dickson Guedes" --license bsd + $ pgxn-utils change my_cool_extension --maintainer "Dickson Guedes" --license bsd conflict META.json Overwrite /tmp/my_cool_extension/META.json? (enter "h" for help) [Ynaqdh] d { @@ -82,16 +104,17 @@ Well suppose you want to change the default maintainer's name and the license, w } Retrying... Overwrite /tmp/my_cool_extension/META.json? (enter "h" for help) [Ynaqdh] Y - force META.json + force META.json identical my_cool_extension.control + It will wait you decide what to do. For all switches that you can use with *change*, type: - $ pgxn_utils help change + $ pgxn-utils help change Usage: - pgxn_utils change [extension_name] + pgxn-utils change [extension_name] Options: -p, [--target=TARGET] # Define the target directory @@ -105,7 +128,8 @@ For all switches that you can use with *change*, type: -t, [--tags=one two three] # Defines extension's tags -r, [--release-status=RELEASE_STATUS] # Initial extension's release status - Change META's attributes in current extension. + Changes META's attributes in current extension + # Bundling and Releasing! @@ -113,12 +137,12 @@ Well, since you finished your work you can bundle it to send to [PGXN](http://pg Bundle it: - $ pgxn_utils bundle my_cool_extension - Extension generated at: /home/guedes/extensions/my_cool_extension-0.0.1.zip + $ pgxn-utils bundle my_cool_extension + create /home/guedes/extensions/my_cool_extension-0.0.1.zip and release it: - $ pgxn_utils release my_cool_extension-0.0.1.zip + $ pgxn-utils release my_cool_extension-0.0.1.zip Enter your PGXN username: guedes Enter your PGXN password: ****** Trying to release my_cool_extension-0.0.1.zip ... released successfully! @@ -127,9 +151,22 @@ and release it: You can export `PGXN_USER` and `PGXN_PASSWORD` environment variables to avoid type username and password everytime. +# Git support + +You can start a new extension with git support calling `skeleton` task with +`--git` flag, then in addition to create skeleton, `pgxn-utils` will initialize +a git repository and do a initial commit. + +Once you have your extension in a git repository your `bundle` will use only the +commited files to create the archive, but if your repository is dirty then `pgxn-utils` +will hint you to commit or stash your changes, before bundle. + +You must be careful with new files not added to repository, because they will NOT +be archived. + # Working in progress -* [git](http://git-scm.org) support +* improve [git](http://git-scm.org) support * proxy support * custom templates |