@@ -77,7 +77,11 @@ export class Barque {
77
77
78
78
private config : Config ;
79
79
private mongodbEdition : string ;
80
- private mongodbVersion : string ;
80
+ private mongodbVersions : {
81
+ version : string ;
82
+ notaryKeyName : string ;
83
+ notaryToken : string ;
84
+ } [ ] ;
81
85
82
86
constructor ( config : Config ) {
83
87
if ( config . platform !== Platform . Linux ) {
@@ -87,9 +91,16 @@ export class Barque {
87
91
this . config = config ;
88
92
// hard code mongodb edition to 'org' for now
89
93
this . mongodbEdition = 'org' ;
90
- // linux mongodb versions to release to. This should perhaps be an array of
91
- // [4.3.0, 4.4.0], like mongo-tools
92
- this . mongodbVersion = '4.4.0' ;
94
+ // linux mongodb versions to release to.
95
+ this . mongodbVersions = [ {
96
+ version : '4.4.0' ,
97
+ notaryKeyName : 'server-4.4' ,
98
+ notaryToken : process . env . SIGNING_AUTH_TOKEN_44 ?? '' ,
99
+ } , {
100
+ version : '5.0.0' ,
101
+ notaryKeyName : 'server-5.0' ,
102
+ notaryToken : process . env . SIGNING_AUTH_TOKEN_50 ?? '' ,
103
+ } ] ;
93
104
}
94
105
95
106
/**
@@ -125,7 +136,9 @@ export class Barque {
125
136
throw new Error ( `Curator is unable to upload ${ packageUrl } ,${ ppa } ,${ arch } to barque ${ error } ` ) ;
126
137
}
127
138
128
- publishedPackageUrls . push ( this . computePublishedPackageUrl ( ppa , arch , packageUrl ) ) ;
139
+ for ( const { version } of this . mongodbVersions ) {
140
+ publishedPackageUrls . push ( this . computePublishedPackageUrl ( ppa , arch , version , packageUrl ) ) ;
141
+ }
129
142
}
130
143
return publishedPackageUrls ;
131
144
}
@@ -137,31 +150,33 @@ export class Barque {
137
150
ppa : PPARepository ,
138
151
architecture : string
139
152
) : Promise < any > {
140
- return await execFile (
141
- `${ curatorDirPath } /curator` , [
142
- '--level' , 'debug' ,
143
- 'repo' , 'submit' ,
144
- '--service' , 'https://barque.corp.mongodb.com' ,
145
- '--config' , repoConfig ,
146
- '--distro' , ppa ,
147
- '--arch' , architecture ,
148
- '--edition' , this . mongodbEdition ,
149
- '--version' , this . mongodbVersion ,
150
- '--packages' , packageUrl
151
- ] , {
152
- // curator looks for these options in env
153
- env : {
154
- NOTARY_KEY_NAME : 'server-4.4' ,
155
- NOTARY_TOKEN : process . env . SIGNING_AUTH_TOKEN_44 ,
156
- BARQUE_API_KEY : process . env . BARQUE_API_KEY ,
157
- BARQUE_USERNAME : process . env . BARQUE_USERNAME
158
- }
159
- } ) ;
153
+ for ( const { version, notaryKeyName, notaryToken } of this . mongodbVersions ) {
154
+ return await execFile (
155
+ `${ curatorDirPath } /curator` , [
156
+ '--level' , 'debug' ,
157
+ 'repo' , 'submit' ,
158
+ '--service' , 'https://barque.corp.mongodb.com' ,
159
+ '--config' , repoConfig ,
160
+ '--distro' , ppa ,
161
+ '--arch' , architecture ,
162
+ '--edition' , this . mongodbEdition ,
163
+ '--version' , version ,
164
+ '--packages' , packageUrl
165
+ ] , {
166
+ // curator looks for these options in env
167
+ env : {
168
+ NOTARY_KEY_NAME : notaryKeyName ,
169
+ NOTARY_TOKEN : notaryToken ,
170
+ BARQUE_API_KEY : process . env . BARQUE_API_KEY ,
171
+ BARQUE_USERNAME : process . env . BARQUE_USERNAME
172
+ }
173
+ } ) ;
174
+ }
160
175
}
161
176
162
- computePublishedPackageUrl ( ppa : PPARepository , targetArchitecture : string , packageUrl : string ) : string {
177
+ computePublishedPackageUrl ( ppa : PPARepository , targetArchitecture : string , mongodbVersion : string , packageUrl : string ) : string {
163
178
const packageFileName = packageUrl . split ( '/' ) . slice ( - 1 ) ;
164
- const packageFolderVersion = this . mongodbVersion . split ( '.' ) . slice ( 0 , 2 ) . join ( '.' ) ;
179
+ const packageFolderVersion = mongodbVersion . split ( '.' ) . slice ( 0 , 2 ) . join ( '.' ) ;
165
180
switch ( ppa ) {
166
181
/* eslint-disable no-multi-spaces */
167
182
case 'ubuntu1804' : return `${ Barque . PPA_REPO_BASE_URL } /apt/ubuntu/dists/bionic/mongodb-org/${ packageFolderVersion } /multiverse/binary-${ targetArchitecture } /${ packageFileName } ` ;
0 commit comments