Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
How to create a local
Android open source
project mirror
1. Obtain necessary
information
Before you set up a local Android open source
project mirror using Deveo, you need to know:
correct at time of publishing
• The current Android Git server address
android.googlesource.com
correct at time of publishing
• Deveo server address
app.deveo.com
• Name for the Deveo project we wish to set
up the local android open source project mirror
• Your Deveo plugin key, company key, and
account key
These can be found in your user preferences
located in the top right...
• Your Deveo username
• Your company name in Deveo
The company name one you type whenever you
log in to Deveo.
2. Create the Deveo project
for our mirror
We will create the project programmatically
through Deveo REST APIs. But first, lets export
the Android open source projec...
export ANDROID_URL=android.googlesource.com
export PLUGIN_KEY=3a12d59d6220aa024cb45b8c7b82db12
export
COMPANY_KEY=c18c6317...
Now use the following curl command to create
a new Deveo project in Deveo:
curl -X POST 
-H "Accept: application/vnd.deveo.v1" 
-H "Authorization: deveo
plugin_key='$PLUGIN_KEY',company_key='$COMPA...
Check the results from the web interface.
There should be a new project in your Deveo
dashboard with the appropriate name.
3. Create the repositories
Create a Git repository in Deveo, using the
following curl snippet:
curl -X POST 
-H "Accept: application/vnd.deveo.v1" 
-H "Authorization: deveo
plugin_key='$PLUGIN_KEY',company_key='$COMPA...
Grab it from:
https://github.com/Deveo/local-android-open-source-
project-mirror
Since it would be tedious to copy-paste t...
4. Clone the original
repositories from official
Android open source
project repository
Clone the repositories using --bare switch in
order to store the repositories within the
hierarchical structure in the loc...
For example:
With the manifest repository, we would do as follows:
cd platform/manifest
git remote add deveo
https://$DEVE...
Get the template here:
https://github.com/Deveo/local-android-open-source-project-mirror
To make this easier, we've used a...
5. Push the repositories to
the Deveo project
To push repositories to Deveo, go to the
directory of the repository, add a new remote
to the repository pointing to the D...
For example, With the manifest repository,
we would do as follows:
cd platform/manifest git remote add
deveo
https://$DEVE...
For this snippet to work we need to export
Deveo username and company name as
command line variables.
For example:
export ...
Like in the previous two steps, our XSL
template based approach takes care of the
heavy lifting and copy-pasting.
Get the ...
6. Test everything works
Now you have all of the repositories pushed to
Deveo, you must test things out following the
official Android open source ...
For example, run this repo command to
initialize a new client from your freshly created
local mirror:
repo init -u
https:/...
How did you get on?
Let us know!
Tweet us @DeveoTeam
Upcoming SlideShare
Loading in …5
×

How to create a local Android open source project mirror in 6 easy steps

1,567 views

Published on

An easy to follow tutorial covering how to use Deveo to create a local Android open source project mirror.

Published in: Software

How to create a local Android open source project mirror in 6 easy steps

  1. 1. How to create a local Android open source project mirror
  2. 2. 1. Obtain necessary information
  3. 3. Before you set up a local Android open source project mirror using Deveo, you need to know:
  4. 4. correct at time of publishing • The current Android Git server address android.googlesource.com
  5. 5. correct at time of publishing • Deveo server address app.deveo.com
  6. 6. • Name for the Deveo project we wish to set up the local android open source project mirror
  7. 7. • Your Deveo plugin key, company key, and account key These can be found in your user preferences located in the top right of the Deveo web interface
  8. 8. • Your Deveo username
  9. 9. • Your company name in Deveo The company name one you type whenever you log in to Deveo.
  10. 10. 2. Create the Deveo project for our mirror
  11. 11. We will create the project programmatically through Deveo REST APIs. But first, lets export the Android open source project Git server URL, Deveo plugin key, company key and your account key, as well as the project name and the Deveo URL as shell variables...
  12. 12. export ANDROID_URL=android.googlesource.com export PLUGIN_KEY=3a12d59d6220aa024cb45b8c7b82db12 export COMPANY_KEY=c18c6317641b13223228b1cd7254e9b8 export ACCOUNT_KEY=462c0f154875824a626c81a26ab3212f export DEVEO_URL=app.deveo.com export DEVEO_PROJECT=my-android-open-source- project-fork export DEVEO_USERNAME=ilmarideveocom REMEMBER TO REPLACE THE EXAMPLE KEYS, URLS ETC. WITH YOUR OWN For example:
  13. 13. Now use the following curl command to create a new Deveo project in Deveo:
  14. 14. curl -X POST -H "Accept: application/vnd.deveo.v1" -H "Authorization: deveo plugin_key='$PLUGIN_KEY',company_key='$COMPAN Y_KEY',account_key='$ACCOUNT_KEY" -H "Content-Type: application/json" -d '{ "id": "$DEVEO_PROJECT", "name": "$DEVEO_PROJECT" }' https://$DEVEO_URL/api/projects
  15. 15. Check the results from the web interface. There should be a new project in your Deveo dashboard with the appropriate name.
  16. 16. 3. Create the repositories
  17. 17. Create a Git repository in Deveo, using the following curl snippet:
  18. 18. curl -X POST -H "Accept: application/vnd.deveo.v1" -H "Authorization: deveo plugin_key='$PLUGIN_KEY',company_key='$COMPANY_K EY',account_key='$ACCOUNT_KEY'" -H "Content-Type: application/json" -d '{ "id": "platform/manifest", "type": "git" }' https://$DEVEO_URL/api/projects/$DEVEO_PROJECT/r epositories
  19. 19. Grab it from: https://github.com/Deveo/local-android-open-source- project-mirror Since it would be tedious to copy-paste the code snippet over and over for each repository in the manifest.xml file, we created an XSL template that can be used to read and create a file containing one curl snippet for each repository.
  20. 20. 4. Clone the original repositories from official Android open source project repository
  21. 21. Clone the repositories using --bare switch in order to store the repositories within the hierarchical structure in the local filesystem.
  22. 22. For example: With the manifest repository, we would do as follows: cd platform/manifest git remote add deveo https://$DEVEO_USERNAME@$DEVEO_URL/$DEVEO_CO MPANY/projects/$DEVEO_PROJECT/repositories/g it/platform/manifest git push --mirror deveo cd -
  23. 23. Get the template here: https://github.com/Deveo/local-android-open-source-project-mirror To make this easier, we've used a similar template based approach for going through all repositories.
  24. 24. 5. Push the repositories to the Deveo project
  25. 25. To push repositories to Deveo, go to the directory of the repository, add a new remote to the repository pointing to the Deveo repository URL, and finally, push the changes using --mirror switch.
  26. 26. For example, With the manifest repository, we would do as follows: cd platform/manifest git remote add deveo https://$DEVEO_USERNAME@$DEVEO_URL/$DEV EO_CO MPANY/projects/$DEVEO_PROJECT/repositor ies/git/platfor m/manifest git push -- mirror deveo cd -
  27. 27. For this snippet to work we need to export Deveo username and company name as command line variables. For example: export DEVEO_USERNAME=ilmarideveocom export DEVEO_COMPANY=deveo
  28. 28. Like in the previous two steps, our XSL template based approach takes care of the heavy lifting and copy-pasting. Get the XSL here: https://github.com/Deveo/local-android-open-source-project-mirror
  29. 29. 6. Test everything works
  30. 30. Now you have all of the repositories pushed to Deveo, you must test things out following the official Android open source project instructions, and using Deveo as the clone URL.
  31. 31. For example, run this repo command to initialize a new client from your freshly created local mirror: repo init -u https://ilmarideveocom@app.deveo.com/dev eo/projects/aosp- testi/repositories/git/platform/manifest
  32. 32. How did you get on? Let us know! Tweet us @DeveoTeam

×