Skip to content

Commit 7ed736a

Browse files
authored
feat(build): add packages to all relevant PPAs MONGOSH-696 (#870)
1 parent fa0e4c7 commit 7ed736a

File tree

6 files changed

+151
-136
lines changed

6 files changed

+151
-136
lines changed

config/repo-config.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,17 @@ repos:
5858
#
5959
####################
6060

61+
- name: debian92
62+
type: deb
63+
code_name: "stretch"
64+
bucket: repo.mongodb.org
65+
edition: org
66+
component: main
67+
architectures:
68+
- amd64
69+
repos:
70+
- apt/debian/dists/stretch/mongodb-org
71+
6172
- name: debian10
6273
type: deb
6374
code_name: "buster"
@@ -77,6 +88,7 @@ repos:
7788
component: multiverse
7889
architectures:
7990
- amd64
91+
- arm64
8092
repos:
8193
- apt/ubuntu/dists/bionic/mongodb-org
8294

@@ -88,13 +100,53 @@ repos:
88100
component: multiverse
89101
architectures:
90102
- amd64
103+
- arm64
91104
repos:
92105
- apt/ubuntu/dists/focal/mongodb-org
93106

107+
- name: rhel70
108+
type: rpm
109+
edition: org
110+
bucket: repo.mongodb.org
111+
architectures:
112+
- x86_64
113+
repos:
114+
- yum/redhat/7/mongodb-org
115+
- yum/redhat/7Server/mongodb-org
116+
94117
- name: rhel80
95118
type: rpm
96119
edition: org
97120
bucket: repo.mongodb.org
121+
architectures:
122+
- x86_64
123+
- aarch64
98124
repos:
99125
- yum/redhat/8/mongodb-org
100126
- yum/redhat/8Server/mongodb-org
127+
128+
- name: suse12
129+
type: rpm
130+
edition: org
131+
bucket: repo.mongodb.org
132+
architectures:
133+
- x86_64
134+
repos:
135+
- zypper/suse/12/mongodb-org
136+
137+
- name: suse15
138+
type: rpm
139+
edition: org
140+
bucket: repo.mongodb.org
141+
repos:
142+
- zypper/suse/15/mongodb-org
143+
144+
- name: amazon2
145+
type: rpm
146+
edition: org
147+
bucket: repo.mongodb.org
148+
architectures:
149+
- arm64
150+
- x86_64
151+
repos:
152+
- yum/amazon/2/mongodb-org

package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,6 @@
8484
"@types/bl": "^2.1.0",
8585
"@types/chai": "^4.2.5",
8686
"@types/download": "^6.2.4",
87-
"@types/fs-extra": "^9.0.2",
88-
"@types/gunzip-maybe": "^1.4.0",
8987
"@types/mocha": "^5.2.7",
9088
"@types/node": "^14.14.6",
9189
"@types/node-fetch": "^2.5.7",
@@ -113,8 +111,6 @@
113111
"eslint-config-mongodb-js": "^5.0.3",
114112
"eslint-plugin-mocha": "^6.2.2",
115113
"find-up": "^5.0.0",
116-
"fs-extra": "^8.1.0",
117-
"gunzip-maybe": "^1.4.2",
118114
"handlebars": "^4.7.7",
119115
"js-yaml": "^3.13.1",
120116
"karma": "^4.4.1",

packages/build/src/barque.spec.ts

Lines changed: 14 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import { expect } from 'chai';
2-
import fs from 'fs-extra';
2+
import { promises as fs } from 'fs';
33
import nock from 'nock';
44
import fetch from 'node-fetch';
55
import path from 'path';
66
import sinon from 'sinon';
77
import { URL } from 'url';
8-
import { Barque, LATEST_CURATOR } from './barque';
8+
import { Barque, LATEST_CURATOR, getReposAndArch } from './barque';
99
import { ALL_BUILD_VARIANTS, Config } from './config';
1010

1111
describe('Barque', () => {
@@ -55,16 +55,19 @@ describe('Barque', () => {
5555
variant: 'debian-x64',
5656
url: 'https://s3.amazonaws.com/mciuploads/mongosh/5ed7ee5d8683818eb28d9d3b5c65837cde4a08f5/mongodb-mongosh_0.1.0_amd64.deb',
5757
publishedUrls: [
58-
`${Barque.PPA_REPO_BASE_URL}/apt/debian/dists/buster/mongodb-org/4.4/main/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`,
5958
`${Barque.PPA_REPO_BASE_URL}/apt/ubuntu/dists/bionic/mongodb-org/4.4/multiverse/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`,
6059
`${Barque.PPA_REPO_BASE_URL}/apt/ubuntu/dists/focal/mongodb-org/4.4/multiverse/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`,
60+
`${Barque.PPA_REPO_BASE_URL}/apt/debian/dists/buster/mongodb-org/4.4/main/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`,
61+
`${Barque.PPA_REPO_BASE_URL}/apt/debian/dists/stretch/mongodb-org/4.4/main/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`
6162
]
6263
},
6364
{
6465
variant: 'rhel-x64',
6566
url: 'https://s3.amazonaws.com/mciuploads/mongosh/5ed7ee5d8683818eb28d9d3b5c65837cde4a08f5/mongodb-mongosh-0.1.0.el7.x86_64.rpm',
6667
publishedUrls: [
68+
`${Barque.PPA_REPO_BASE_URL}/yum/redhat/7/mongodb-org/4.4/x86_64/RPMS/mongodb-mongosh-0.1.0.el7.x86_64.rpm`,
6769
`${Barque.PPA_REPO_BASE_URL}/yum/redhat/8/mongodb-org/4.4/x86_64/RPMS/mongodb-mongosh-0.1.0.el7.x86_64.rpm`,
70+
`${Barque.PPA_REPO_BASE_URL}/yum/amazon/2/mongodb-org/4.4/x86_64/RPMS/mongodb-mongosh-0.1.0.el7.x86_64.rpm`,
6871
]
6972
}
7073
] as const).forEach(({ variant, url, publishedUrls }) => {
@@ -93,7 +96,7 @@ describe('Barque', () => {
9396
try {
9497
await barque.releaseToBarque('debian-x64', debUrl);
9598
} catch (error) {
96-
expect(error.message).to.include('Curator is unable to upload to barque');
99+
expect(error.message).to.include('Curator is unable to upload https://s3.amazonaws.com/mciuploads/mongosh/5ed7ee5d8683818eb28d9d3b5c65837cde4a08f5/mongodb-mongosh_0.1.0_amd64.deb,ubuntu1804,amd64 to barque');
97100
expect(barque.createCuratorDir).to.have.been.called;
98101
expect(barque.extractLatestCurator).to.have.been.called;
99102
expect(barque.execCurator).to.have.been.called;
@@ -115,56 +118,14 @@ describe('Barque', () => {
115118
});
116119
});
117120

118-
describe('getTargetDistro', () => {
119-
it('determines distro for debian build variant', async() => {
120-
const distro = barque.getTargetDistros('debian-x64');
121-
expect(distro).to.deep.equal(['debian10', 'ubuntu1804', 'ubuntu2004']);
122-
});
123-
124-
it('determines distro for redhat build variant', async() => {
125-
const distro = barque.getTargetDistros('rhel-x64');
126-
expect(distro).to.deep.equal(['rhel80']);
127-
});
128-
129-
ALL_BUILD_VARIANTS
130-
.filter(v => v !== 'debian-x64' && v !== 'rhel-x64')
131-
.forEach(variant => {
132-
it(`throws an error for ${variant}`, async() => {
133-
try {
134-
barque.getTargetDistros(variant);
135-
} catch (e) {
136-
expect(e.message).to.include(variant);
137-
return;
138-
}
139-
expect.fail('Expected error');
140-
});
141-
});
142-
});
143-
144-
describe('getTargetArchitecture', () => {
145-
it('determines arch for debian', async() => {
146-
const distro = barque.getTargetArchitecture('debian-x64');
147-
expect(distro).to.be.equal('amd64');
148-
});
149-
150-
it('determines arch for redhat', async() => {
151-
const distro = barque.getTargetArchitecture('rhel-x64');
152-
expect(distro).to.be.equal('x86_64');
153-
});
154-
155-
ALL_BUILD_VARIANTS
156-
.filter(v => v !== 'debian-x64' && v !== 'rhel-x64')
157-
.forEach(variant => {
158-
it(`throws an error for ${variant}`, async() => {
159-
try {
160-
barque.getTargetArchitecture(variant);
161-
} catch (e) {
162-
expect(e.message).to.include(variant);
163-
return;
164-
}
165-
expect.fail('Expected error');
166-
});
121+
describe('getReposAndArch', () => {
122+
for (const variant of ALL_BUILD_VARIANTS) {
123+
it(`returns results for ${variant}`, () => {
124+
const result = getReposAndArch(variant);
125+
expect(result.ppas).to.be.an('array');
126+
expect(result.arch).to.be.a('string');
167127
});
128+
}
168129
});
169130

170131
describe('createCuratorDir', () => {

0 commit comments

Comments
 (0)