For more information :
http://blog.cobia.net/cobiacomm/2012/04/16/what-is-wso2-appfactory/
Following steps will be useful for a user who is using git as the repository and to checkout the code of the created application and the steps till it is committed.
For The Ubuntu Environment
Following steps will be useful for a user who is using git as the repository and to checkout the code of the created application and the steps till it is committed.
For The Ubuntu Environment
- First step should be installing GIT in to your machine. Therefore the following command should be executed.Command : $ sudo apt-get install git
- Check whether GIT is available in your machine now.Command : $ git init
Response : Initialized empty Git repository in /home/../.git/ - Create a folder to archive the Git projects in to one location in your repository.Command : $ mkdir GITPROJECTS
- Add all the Git projects in to your repository by the following command.Command : GITPROJECTS$ git add .
- To get the GIT to Accept the certificate, type the following command.Command : GITPROJECTS$ export GIT_SSL_NO_VERIFY=1On Windows : (
Right click on My Computer -> Properties -> Advanced System settings -> Environment Variables
Add variable GIT_SSL_NO_VERIFY with value 1
) - To clone the particular project in to your repository, copy the (Clone/Check out) repository URL in the application Dashboard or the Repository page of the App Factory. (Only if you have developer or App Owner rights)
Command :
GITPROJECTS$ git
clone https://git.appfactorypreview.wso2.com/git/MyApp.git
Response :
Cloning into 'MyApp'...
Username
for 'https://git.appfactorypreview.wso2.com': <Developer's username>
e.g., ushani@wso2.com
Password for
'https://ushani@wso2.com@git.appfactorypreview.wso2.com':
*****
remote: Counting
objects: 23, done
remote: Finding
sources: 100% (23/23)
remote: Getting
sizes: 100% (14/14)
remote:
Compressing objects: 100% (13/13)
remote: Total 23
(delta 4), reused 23 (delta 4)
Unpacking
objects: 100% (23/23), done.
- List down and check the projectCommand : GITPROJECTS$ lsResponse : MyApp
- Go inside the project and check for the available branches in the repositoryCommand : GITPROJECTS$ cd MyAppCommand : MyApp$ git branch -rResponse : origin/1.0.0origin/2.0.0origin/3.0.0origin/4.0.0origin/HEAD -> origin/masterorigin/master
- To list down the local branches that you have, following command can be executedCommand : MyApp$ git branch
Response :
* master
(* master means the trunk. The branch that you are currently working
on will have a star next to it and if you have coloring turned on,
will show the current branch in green)
- To create other branches in the local repository, following command should be executed.Command : MyApp$ git branch <version name>e.g, git branch 1.0.0
- Now check the created branchCommand : MyApp$ git branch
Response :
1.0.0
* master
- To switch to 1.0.0, following command should be executed to check out the relevant code in to your local repositoryCommand : MyApp$ git checkout 1.0.0
Response :
Switched to branch '1.0.0'
(*Steps 10 and 11 can be executed together by executing “git
checkout -b 1.0.0”. Then it will branch out 1.0.0 and switch to it.
When you type checkout and give the branch name, the source code you
have in your local repository will be the given version's source code
that is in the App Factory repository. If you type “git branch”
you should see the 11th step response)
- Now it is the coding time. You can import your project in to a specific IDE (E.g., Eclipse) and do coding.
- You can install a toolkit which helps you to show the changes you have done in to your code by installing GITK (Generalized Interface Toolkit - GITK). To install, following command can be executed.Command : Downloads$ sudo apt-get install gitk
(This step can be done as the 2nd step after installing git in your machine. For more reference on git, follow this manual on https://www.kernel.org/pub/software/scm/git/docs/gitk.html)
- After doing code level changes, when you type the following command, GIT window will be opened with the changes or mentioning the about the changes that you have to commitCommand : MyApp$ gitk
- By executing the following command you can view the changes in you terminal.Command : MyApp$ git diff
- To add all the changes following command should be executed.Command : MyApp$ git add *
- Using gitk,
you can view the changes and the difference in a graphical interface
by selecting the particular file or folder. (Use the manual in step
14 for more information)
- Now it is
the time to commit if your build passes locally. Execute the
following command to commit your code. Command :
MyApp$ git
commit -am "Committing changes"
Response :
([1.0.0 9b736e4] Committing changes
Committer: ushani <ushani@ushani...>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:
git config --global user.name "Your Name"
git config --global user.email you@example.com
After doing this, you may fix the identity used for this commit with:
git commit --amend --reset-author
1 file changed, 2 insertions(+) )
(For more information on git commits, rollbacks, applying etc, use the following guide. http://gitref.org/basic/)
- To push the commits, execute, git push <remote>, where <remote> is the current branch’s remote (or origin, if no remote is configured for the current branch.Command : MyApp$ git push origin remotes/origin/1.0.0
(For more information on git commits, rollbacks, applying etc, use the following guide.
http://www.kernel.org/pub/software/scm/git/docs/git-push.html )Response :
Username for 'https://git.appfactorypreview.wso2.com': ushani@wso2.com
Password for 'https://ushani@wso2.com@git.appfactorypreview.wso2.com': *****remote: Updating references: 100% (1/1)To https://git.appfactorypreview.wso2.com/git/MyApp.git
* [new branch] origin/1.0.0 -> origin/1.0.0 - You can pull the committed code by executing the following command to verify the changes are committed. (But not necessary)Command : MyApp$ git pull origin remotes/origin/1.0.0
- Now in App factory, if you have selected the Auto Build and Auto Deploy options for the particular branch version, once you do a commit, within 6 minutes the latest version should be built and deployed in the cloud. Otherwise you have to manually build and deploy it.
- Now you can click on the Launch link and see it in the Developer's environment and if it is fine to go ahead, you can promote it to testing stage by the Governance tab.
No comments:
Post a Comment