This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
wiki:development:development-workspace [2011/08/08 16:46] morty [Access to X2go Git Repositories] |
wiki:development:development-workspace [2013/03/14 23:40] (current) sunweaver [Build X2Go Packages for Debian] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== How to set up an X2go Development Workspace ====== | + | ====== How to set up an X2Go Development Workspace ====== |
| ===== Get the Code ===== | ===== Get the Code ===== | ||
| Before you can start developing you need the source code. | Before you can start developing you need the source code. | ||
| - | The code is managed in a [[git | GIT repository]]. | + | The code is managed in a [[git| GIT repository]]. |
| - | ===== System Environment ===== | + | |
| - | ==== Install Software | + | ===== Building ===== |
| - | For working with X2go Git you have to install some software on your development workstation. We will presume you develop under Debian: | + | ==== Debian/Ubuntu ==== |
| - | < | + | On Ubuntu |
| - | $ aptitude install git devscripts | + | |
| - | </ | + | |
| - | + | ||
| - | ==== Setup Git Configuration ==== | + | |
| - | + | ||
| - | Now it is time to set up your system environment for working with Git. Main thing is to tell Git who you are. For this edit the file '' | + | |
| < | < | ||
| - | [user] | + | sudo apt-get install devscripts debhelper ubuntu-dev-tools build-essential |
| - | name = < | + | |
| - | email = < | + | |
| - | [color] | + | |
| - | ui = auto | + | |
| </ | </ | ||
| + | More info in general form: [[https:// | ||
| - | ==== Setup devscripts Configuration | + | ==== Getting Build Dependencies |
| + | Each Git has a file'' | ||
| - | We currently use Debian based tools to maintain the projects' | + | The package '' |
| - | < | + | ==== Makefile ==== |
| - | DEBCHANGE_RELEASE_HEURISTIC=changelog | + | |
| - | DEBCHANGE_MULTIMAINT_MERGE=yes | + | |
| - | DEBCHANGE_MAINTTRAILER=yes | + | |
| - | </ | + | |
| - | and these lines to '' | + | Most projects should have a Makefile, that builds the project by running make (This is work in progress). |
| - | < | + | ==== DPKG ==== |
| - | export DEBFULLNAME="< | + | |
| - | export EMAIL="< | + | |
| - | export DEBEMAIL=${EMAIL} | + | |
| - | </ | + | |
| - | + | ||
| - | ===== Cloning X2go Git Projects ===== | + | |
| - | + | ||
| - | To start working on code in X2go Git you first have to clone those Git projects from '' | + | |
| - | + | ||
| - | Before cloning any X2go Git project please create and then change to your development workspace folder on your local system, for example: | + | |
| - | + | ||
| - | < | + | |
| - | $ mkdir -p ~/ | + | |
| - | $ cd ~/ | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | The contributor command (that is if you are someone who wants to work on X2go code and send your improvements as patches) is: | + | |
| - | + | ||
| - | < | + | |
| - | $ git clone git:// | + | |
| - | </ | + | |
| - | + | ||
| - | + | ||
| - | The developer command for cloning an X2go Git project locally to this folder, however, is (please replace < | + | |
| - | + | ||
| - | < | + | |
| - | $ git clone ssh:// | + | |
| - | </ | + | |
| + | An installable package can be built running '' | ||
| - | ===== Working on X2go Code ===== | ||
| - | ==== Development Strategies ==== | + | ===== Development Strategies |
| - | There are a few different approaches for working on X2go code (or Git-hosted code in general). This wiki page will address two of them: HEAD development and local branch development. | + | There are a few different approaches for working on X2Go code (or Git-hosted code in general). This wiki page will address two of them: HEAD development and local branch development. |
| - | === HEAD X2go Development === | + | === HEAD X2Go Development === |
| - | With the term HEAD one refers to the topmost recent code in a code repository. The Git branch that HEAD development gets committed to is the master branch of each X2go Git project. | + | With the term HEAD one refers to the topmost recent code in a code repository. The Git branch that HEAD development gets committed to is the master branch of each X2Go Git project. |
| - | If you are a core X2go developer and the code you are working on is something that is intended to become a core component of X2go then you are likely to directly work on HEAD. | + | If you are a core X2Go developer and the code you are working on is something that is intended to become a core component of X2Go then you are likely to directly work on HEAD. |
| Also bug fixes should be committed to the master branch directly. | Also bug fixes should be committed to the master branch directly. | ||
| Line 89: | Line 47: | ||
| === Development on Local Git Branches === | === Development on Local Git Branches === | ||
| - | However, if you work on a piece of code or a feature, that may or may not become a part of X2go or a piece of code that will break a couple of things when committed to the master branch then you should rather start a local branch to work on that. | + | However, if you work on a piece of code or a feature, that may or may not become a part of X2Go or a piece of code that will break a couple of things when committed to the master branch then you should rather start a local branch to work on that. |
| If you want to branch of from HEAD, use this command: | If you want to branch of from HEAD, use this command: | ||
| Line 106: | Line 64: | ||
| You then continue your work on the < | You then continue your work on the < | ||
| - | You may also upload your local branch to the X2go Git site. Please discuss this first on the x2go-dev mailing list. | + | You may also upload your local branch to the X2Go Git site. Please discuss this first on the x2go-dev mailing list. |
| < | < | ||
| Line 114: | Line 72: | ||
| To incorporate changes from your < | To incorporate changes from your < | ||
| - | Note: The only thing we do not accept on X2go Git are Git merges. | + | Note: The only thing we do not accept on X2Go Git are Git merges. |
| ==== Coding Strategies ==== | ==== Coding Strategies ==== | ||
| - | There are some recommendations that we give when coding | + | There are some recommendations that we give when coding |
| * run '' | * run '' | ||
| Line 134: | Line 92: | ||
| </ | </ | ||
| - | __After__ you have performed some changes on an X2go Git project, please use the '' | + | __After__ you have performed some changes on an X2Go Git project, please use the '' |
| < | < | ||
| Line 174: | Line 132: | ||
| ==== Maintaining Changelogs ==== | ==== Maintaining Changelogs ==== | ||
| - | Currently we use Debian tools to maintain each project' | + | Currently we use Debian tools to maintain each project' |
| - | However, as this is in process and till it has settled, please continue as described below when maintaining the X2go projects' | + | However, as this is in process and till it has settled, please continue as described below when maintaining the X2Go projects' |
| - code your code | - code your code | ||
| Line 187: | Line 145: | ||
| - | ==== Reverting Merge Commits | + | ===== Maintainer Stuff ===== |
| - | If you forget to run '' | + | ==== Install Software ==== |
| - | There is nothing bad about merge commits apart from the fact that the X2go Git system won't allow them being pushed to the server :-/. | + | For working with X2Go Git you have to install |
| - | + | ||
| - | Thus, you probably want to avoid merge commits right from the beginning. However, from time to time it occurs that you crunch your Git log with a merge commit. This is how such a thing can happen: | + | |
| - | + | ||
| - | * change a file | + | |
| - | * commit it locally | + | |
| - | * push it to X2go Git | + | |
| - | * find that the push operation gets rejected :-( | + | |
| - | * then run '' | + | |
| - | * and then uuups... realize: the '' | + | |
| - | + | ||
| - | One possible solution for this is // | + | |
| < | < | ||
| - | # make a temporary backup copy of the master branch | + | $ aptitude install |
| - | $ git checkout -b master-bak-tmp | + | </ |
| - | # go back to master branch | ||
| - | $ git checkout master | ||
| - | # and reset it to that refspec where local Git and server' | ||
| - | $ git reset --hard < | ||
| - | # then take a look at the log of your old local master branch | + | ==== Setup devscripts Configuration ==== |
| - | $ git log master-bak-tmp | + | |
| - | # now cherry-pick your local changes individually from the master-bak-tmp branch | + | We currently use Debian based tools to maintain |
| - | $ git cherry-pick < | + | |
| - | $ git cherry-pick < | + | |
| - | ... | + | |
| - | $ git cherry-pick < | + | |
| - | # finally drop the tmp backup of old master | + | < |
| - | $ git branch -D master-bak-tmp | + | DEBCHANGE_RELEASE_HEURISTIC=changelog |
| + | DEBCHANGE_MULTIMAINT_MERGE=yes | ||
| + | DEBCHANGE_MAINTTRAILER=yes | ||
| </ | </ | ||
| - | ==== Pushing | + | and these lines to '' |
| - | + | ||
| - | Whenever your local X2go Git project is in an acceptable state for the community, feel free to push the code to the X2go Git server: | + | |
| < | < | ||
| - | $ git push | + | export DEBFULLNAME="< |
| + | export EMAIL="< | ||
| + | export DEBEMAIL=${EMAIL} | ||
| </ | </ | ||
| - | < | ||
| - | When working on master' | ||
| - | Keeping back code for too long can result in code conflicts (changes in the same code block of the same file by two different developers). | ||
| - | </ | ||
| - | The update scripts of X2go Git will shout warnings at you while pushing. These warnings relate to | ||
| - | * whitespaces found at the end of lines | ||
| - | * tabs found in the file (for Python: no tabs, for Bash, Perl, C++, etc. tabs are wanted, so you can ignore these if not coding Python) | ||
| - | * no \newline at end of file | ||
| - | You may consider silencing those warnings before committing the next time... | ||
| - | ===== Releasing | + | ==== Releasing |
| - | The X2go version scheme is a four digit version number: ''< | + | The X2Go version scheme is a four digit version number: ''< |
| - | For releasing | + | For releasing |
| - | If you decide for releasing an X2go component, please perform the following steps: | + | If you decide for releasing an X2Go component, please perform the following steps: |
| - Change any string location in the project that reflects the version number: changelog, VERSION.< | - Change any string location in the project that reflects the version number: changelog, VERSION.< | ||
| Line 265: | Line 196: | ||
| $ git push --tags | $ git push --tags | ||
| </ | </ | ||
| - | - Use the '' | + | - Use the '' |
| $ x2go-updatebuildmain HEAD | $ x2go-updatebuildmain HEAD | ||
| </ | </ | ||
| - | - Run '' | + | - Run '' |
| $ x2go-tarballrelease < | $ x2go-tarballrelease < | ||
| </ | </ | ||
| Line 276: | Line 207: | ||
| - Before you continue working on the code you should make sure that the newly released code has been built on Launchpad and also moved to the x2go-stable PPA. | - Before you continue working on the code you should make sure that the newly released code has been built on Launchpad and also moved to the x2go-stable PPA. | ||
| - | ===== Git / Code Administration | + | ==== Git / Code Administration ==== |
| For Git / code administation you have to be able to logon to the host '' | For Git / code administation you have to be able to logon to the host '' | ||
| Line 286: | Line 217: | ||
| As '' | As '' | ||
| - | * create new X2go Git projects | + | * create new X2Go Git projects |
| * edit Git configs | * edit Git configs | ||
| * edit Git descriptions | * edit Git descriptions | ||
| Line 294: | Line 225: | ||
| * upload Debian packages to http:// | * upload Debian packages to http:// | ||
| - | ==== Using X2go Build Scripts ==== | + | ==== Using X2Go Build Scripts ==== |
| - | The X2go project uses a hand full of build scripts that are also hosted in X2go Git: | + | The X2Go project uses a hand full of build scripts that are also hosted in X2Go Git: |
| < | < | ||
| Line 326: | Line 257: | ||
| After extending the PATH variable log off an on to make sure it takes effect (or use your own style of letting it take effect). | After extending the PATH variable log off an on to make sure it takes effect (or use your own style of letting it take effect). | ||
| - | ==== Create new Git Project on X2go Git ==== | ||
| - | |||
| - | If you want to create a new X2go Git project on '' | ||
| - | |||
| - | Then create a local Git project: | ||
| - | |||
| - | < | ||
| - | $ mkdir -p ~/ | ||
| - | $ cd ~/ | ||
| - | $ git init | ||
| - | </ | ||
| - | |||
| - | Then add your first files to the new '' | ||
| - | |||
| - | Then run the following command sequence: | ||
| - | |||
| - | < | ||
| - | $ cd ~/ | ||
| - | $ x2go-gitcreate x2gonewthing | ||
| - | # if the Git creation succeeds (check via http:// | ||
| - | $ rm x2gonewthing -Rfv | ||
| - | $ git clone ssh:// | ||
| - | </ | ||
| - | |||
| - | Now you can start working on your new X2go project as on any of the other already existing X2go Git projects. | ||
| - | |||
| - | ==== Edit Git Configs ==== | ||
| - | |||
| - | As '' | ||
| - | |||
| - | < | ||
| - | $ cd / | ||
| - | $ vim config | ||
| - | </ | ||
| - | |||
| - | ==== Edit Git Descriptions ==== | ||
| - | |||
| - | As '' | ||
| - | |||
| - | < | ||
| - | $ cd / | ||
| - | $ vim description | ||
| - | </ | ||
| - | |||
| - | ==== Edit Git ACLs ==== | ||
| - | |||
| - | Unused feature, may come later... | ||
| ==== Upload Released Tarballs ==== | ==== Upload Released Tarballs ==== | ||
| Line 382: | Line 266: | ||
| </ | </ | ||
| - | ==== Build X2go Packages for Debian ==== | + | ==== Build X2Go Packages for Debian ==== |
| - | + | ||
| - | On '' | + | |
| - | Currently, packages for Debian are built on a non-public machine at DAS-NETZWERKTEAM in Northern Germany and then get uploaded to '' | + | On '' |
| - | ==== Upload | + | ==== Upload |
| - | As '' | + | As '' |
| < | < | ||
| - | ### X2go/DEBIAN | + | ### X2Go/DEBIAN |
| $cfg{" | $cfg{" | ||
| fqdn => " | fqdn => " | ||