2
2
import json
3
3
import argparse
4
4
5
- from utils import (create_rg_template , create_rg_cloud_template , upload_rg_template )
5
+ from utils import (create_rg_template , create_rg_cloud_template , create_rg_ddc_template , upload_rg_template )
6
6
7
7
8
8
CFN_TEMPLATE = '/home/docker/editions.template'
@@ -27,38 +27,66 @@ def main():
27
27
parser .add_argument ('-u' , '--channel_cloud' ,
28
28
dest = 'channel_cloud' , default = "alpha" ,
29
29
help = "Cloud release channel (beta, alpha, rc, nightly)" )
30
+ parser .add_argument ('--channel_ddc' ,
31
+ dest = 'channel_ddc' , default = "alpha" ,
32
+ help = "DDC release channel (beta, alpha, rc, nightly)" )
33
+ parser .add_argument ('--offer_id' ,
34
+ dest = 'offer_id' , default = "docker4azure" ,
35
+ help = "The Azure VHD Offer ID" )
36
+ parser .add_argument ('--cs_vhd_sku' ,
37
+ dest = 'cs_vhd_sku' ,
38
+ help = "The Azure CS VHD SKU (i.e. docker4azure)" )
39
+ parser .add_argument ('--cs_vhd_version' ,
40
+ dest = 'cs_vhd_version' ,
41
+ help = "The Azure CS VHD version (i.e. 1.0.0)" )
42
+ parser .add_argument ('--cs_offer_id' ,
43
+ dest = 'cs_offer_id' ,
44
+ help = "The Azure CS VHD Offer ID" )
30
45
parser .add_argument ("--upload" , action = "store_true" ,
31
46
help = "Upload the Azure template once generated" )
32
47
33
48
args = parser .parse_args ()
34
49
35
50
release_channel = args .channel
36
51
release_cloud_channel = args .channel_cloud
52
+ release_ddc_channel = args .channel_cloud
37
53
docker_version = args .docker_version
38
54
# TODO change to something else? where to get moby version?
39
55
moby_version = docker_version
40
56
edition_version = args .edition_version
41
57
flat_edition_version = edition_version .replace (" " , "" )
42
58
vhd_sku = args .vhd_sku
43
59
vhd_version = args .vhd_version
60
+ offer_id = args .offer_id
61
+ cs_vhd_sku = args .cs_vhd_sku
62
+ cs_vhd_version = args .cs_vhd_version
63
+ cs_offer_id = args .cs_offer_id
64
+
44
65
docker_for_azure_version = u"azure-v{}" .format (flat_edition_version )
45
66
image_name = u"Moby Linux {}" .format (docker_for_azure_version )
46
67
image_description = u"The best OS for running Docker, version {}" .format (moby_version )
47
68
print ("\n Variables" )
48
69
print (u"release_channel={}" .format (release_channel ))
49
70
print (u"release_cloud_channel={}" .format (release_cloud_channel ))
71
+ print (u"release_ddc_channel={}" .format (release_ddc_channel ))
50
72
print (u"docker_version={}" .format (docker_version ))
51
73
print (u"edition_version={}" .format (edition_version ))
52
74
print (u"vhd_sku={}" .format (vhd_sku ))
53
75
print (u"vhd_version={}" .format (vhd_version ))
76
+ print (u"cs_vhd_sku={}" .format (cs_vhd_sku ))
77
+ print (u"cs_vhd_version={}" .format (cs_vhd_version ))
54
78
55
79
print ("Create CloudFormation template.." )
56
80
template_name = u"{}.json" .format (docker_for_azure_version )
57
- base_url = create_rg_template (vhd_sku , vhd_version , release_channel , docker_version ,
81
+ base_url = create_rg_template (vhd_sku , vhd_version , offer_id , release_channel , docker_version ,
58
82
docker_for_azure_version , edition_version , CFN_TEMPLATE , template_name )
59
83
cloud_template_name = u"{}-cloud.json" .format (docker_for_azure_version )
60
84
cloud_url = create_rg_cloud_template (release_cloud_channel , docker_version ,
61
85
docker_for_azure_version , edition_version , base_url , cloud_template_name )
86
+
87
+ ddc_template_name = u"{}-ddc.json" .format (docker_for_azure_version )
88
+ ddc_url = create_rg_ddc_template (cs_vhd_sku , cs_vhd_version , cs_offer_id , release_ddc_channel , docker_version ,
89
+ docker_for_azure_version , edition_version , base_url , ddc_template_name )
62
90
63
91
print ("------------------" )
64
92
print (u"Finshed.. \n " )
@@ -67,7 +95,8 @@ def main():
67
95
print (u"Uploading templates.. \n " )
68
96
s3_url = upload_rg_template (release_channel , template_name , base_url )
69
97
s3_cloud_url = upload_rg_template (release_channel , cloud_template_name , cloud_url )
70
- print (u"Uploaded CloudFormation \n \t URL={0} \n \t CLOUD_URL={1} \n " .format (s3_url , s3_cloud_url ))
98
+ s3_ddc_url = upload_rg_template (release_channel , ddc_template_name , ddc_url )
99
+ print (u"Uploaded CloudFormation \n \t URL={0} \n \t CLOUD_URL={1} \n \t DDC_URL={2} \n " .format (s3_url , s3_cloud_url , s3_ddc_url ))
71
100
72
101
# TODO: git commit, tag release. requires github keys, etc.
73
102
print ("Don't forget to tag the code (git tag -a v{0}-{1} -m {0}; git push --tags)" .format (
0 commit comments