-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmanifest.xsl
58 lines (45 loc) · 2.77 KB
/
manifest.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
<xsl:template match="/">
<!-- Create the Deveo project -->
curl -X POST \
-H "Accept: application/vnd.deveo.v1" \
-H "Authorization: deveo plugin_key='<xsl:value-of select="$PLUGIN_KEY" />',company_key='<xsl:value-of select="$COMPANY_KEY" />',account_key='<xsl:value-of select="$ACCOUNT_KEY" />'" \
-H "Content-Type: application/json" \
-d '{ "id": "<xsl:value-of select="$DEVEO_PROJECT" />", "name": "<xsl:value-of select="$DEVEO_PROJECT" />" }' \
https://<xsl:value-of select="$DEVEO_URL" />/api/projects
<!-- Create repos to Deveo -->
curl -X POST \
-H "Accept: application/vnd.deveo.v1" \
-H "Authorization: deveo plugin_key='<xsl:value-of select="$PLUGIN_KEY" />',company_key='<xsl:value-of select="$COMPANY_KEY" />',account_key='<xsl:value-of select="$ACCOUNT_KEY" />'" \
-H "Content-Type: application/json" \
-d '{ "id": "platform/manifest", "type": "git" }' \
https://<xsl:value-of select="$DEVEO_URL" />/api/projects/<xsl:value-of select="$DEVEO_PROJECT" />/repositories
<xsl:for-each select="manifest/project">
curl -X POST \
-H "Accept: application/vnd.deveo.v1" \
-H "Authorization: deveo plugin_key='<xsl:value-of select="$PLUGIN_KEY" />',company_key='<xsl:value-of select="$COMPANY_KEY" />',account_key='<xsl:value-of select="$ACCOUNT_KEY" />'" \
-H "Content-Type: application/json" \
-d '{ "id": "<xsl:value-of select="@name"/>", "type": "git" }' \
https://<xsl:value-of select="$DEVEO_URL" />/api/projects/<xsl:value-of select="$DEVEO_PROJECT" />/repositories
</xsl:for-each>
<!-- End of Creating repos to Deveo -->
<!-- Clone repos -->
git clone --bare https://<xsl:value-of select="$ANDROID_URL" />/platform/manifest platform/manifest
<xsl:for-each select="manifest/project">
git clone --bare https://<xsl:value-of select="$ANDROID_URL" />/<xsl:value-of select="@name"/><xsl:text> </xsl:text><xsl:value-of select="@path"/></xsl:for-each>
<!-- End of cloning repos -->
<!-- Push the repos -->
cd platform/manifest
git remote add deveo https://<xsl:value-of select="$DEVEO_USERNAME"/>@<xsl:value-of select="$DEVEO_URL"/>/<xsl:value-of select="$DEVEO_COMPANY"/>/projects/<xsl:value-of select="$DEVEO_PROJECT"/>/repositories/git/platform/manifest
git push --mirror deveo
cd -
<xsl:for-each select="manifest/project">
cd <xsl:value-of select="@path"/>
git remote add deveo https://<xsl:value-of select="$DEVEO_USERNAME"/>@<xsl:value-of select="$DEVEO_URL"/>/<xsl:value-of select="$DEVEO_COMPANY"/>/projects/<xsl:value-of select="$DEVEO_PROJECT"/>/repositories/git/<xsl:value-of select="@name"/>
git push --mirror deveo
cd -
</xsl:for-each>
<!-- End of pushing repos -->
</xsl:template>
</xsl:stylesheet>