Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions config/repo-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,17 @@ repos:
#
####################

- name: debian92
type: deb
code_name: "stretch"
bucket: repo.mongodb.org
edition: org
component: main
architectures:
- amd64
repos:
- apt/debian/dists/stretch/mongodb-org

- name: debian10
type: deb
code_name: "buster"
Expand All @@ -77,6 +88,7 @@ repos:
component: multiverse
architectures:
- amd64
- arm64
repos:
- apt/ubuntu/dists/bionic/mongodb-org

Expand All @@ -88,13 +100,53 @@ repos:
component: multiverse
architectures:
- amd64
- arm64
repos:
- apt/ubuntu/dists/focal/mongodb-org

- name: rhel70
type: rpm
edition: org
bucket: repo.mongodb.org
architectures:
- x86_64
repos:
- yum/redhat/7/mongodb-org
- yum/redhat/7Server/mongodb-org

- name: rhel80
type: rpm
edition: org
bucket: repo.mongodb.org
architectures:
- x86_64
- aarch64
repos:
- yum/redhat/8/mongodb-org
- yum/redhat/8Server/mongodb-org

- name: suse12
type: rpm
edition: org
bucket: repo.mongodb.org
architectures:
- x86_64
repos:
- zypper/suse/12/mongodb-org

- name: suse15
type: rpm
edition: org
bucket: repo.mongodb.org
repos:
- zypper/suse/15/mongodb-org

- name: amazon2
type: rpm
edition: org
bucket: repo.mongodb.org
architectures:
- arm64
- x86_64
repos:
- yum/amazon/2/mongodb-org
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@
"@types/bl": "^2.1.0",
"@types/chai": "^4.2.5",
"@types/download": "^6.2.4",
"@types/fs-extra": "^9.0.2",
"@types/gunzip-maybe": "^1.4.0",
"@types/mocha": "^5.2.7",
"@types/node": "^14.14.6",
"@types/node-fetch": "^2.5.7",
Expand Down Expand Up @@ -113,8 +111,6 @@
"eslint-config-mongodb-js": "^5.0.3",
"eslint-plugin-mocha": "^6.2.2",
"find-up": "^5.0.0",
"fs-extra": "^8.1.0",
"gunzip-maybe": "^1.4.2",
"handlebars": "^4.7.7",
"js-yaml": "^3.13.1",
"karma": "^4.4.1",
Expand Down
67 changes: 14 additions & 53 deletions packages/build/src/barque.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { expect } from 'chai';
import fs from 'fs-extra';
import { promises as fs } from 'fs';
import nock from 'nock';
import fetch from 'node-fetch';
import path from 'path';
import sinon from 'sinon';
import { URL } from 'url';
import { Barque, LATEST_CURATOR } from './barque';
import { Barque, LATEST_CURATOR, getReposAndArch } from './barque';
import { ALL_BUILD_VARIANTS, Config } from './config';

describe('Barque', () => {
Expand Down Expand Up @@ -55,16 +55,19 @@ describe('Barque', () => {
variant: 'debian-x64',
url: 'https://s3.amazonaws.com/mciuploads/mongosh/5ed7ee5d8683818eb28d9d3b5c65837cde4a08f5/mongodb-mongosh_0.1.0_amd64.deb',
publishedUrls: [
`${Barque.PPA_REPO_BASE_URL}/apt/debian/dists/buster/mongodb-org/4.4/main/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`,
`${Barque.PPA_REPO_BASE_URL}/apt/ubuntu/dists/bionic/mongodb-org/4.4/multiverse/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`,
`${Barque.PPA_REPO_BASE_URL}/apt/ubuntu/dists/focal/mongodb-org/4.4/multiverse/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`,
`${Barque.PPA_REPO_BASE_URL}/apt/debian/dists/buster/mongodb-org/4.4/main/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`,
`${Barque.PPA_REPO_BASE_URL}/apt/debian/dists/stretch/mongodb-org/4.4/main/binary-amd64/mongodb-mongosh_0.1.0_amd64.deb`
]
},
{
variant: 'rhel-x64',
url: 'https://s3.amazonaws.com/mciuploads/mongosh/5ed7ee5d8683818eb28d9d3b5c65837cde4a08f5/mongodb-mongosh-0.1.0.el7.x86_64.rpm',
publishedUrls: [
`${Barque.PPA_REPO_BASE_URL}/yum/redhat/7/mongodb-org/4.4/x86_64/RPMS/mongodb-mongosh-0.1.0.el7.x86_64.rpm`,
`${Barque.PPA_REPO_BASE_URL}/yum/redhat/8/mongodb-org/4.4/x86_64/RPMS/mongodb-mongosh-0.1.0.el7.x86_64.rpm`,
`${Barque.PPA_REPO_BASE_URL}/yum/amazon/2/mongodb-org/4.4/x86_64/RPMS/mongodb-mongosh-0.1.0.el7.x86_64.rpm`,
]
}
] as const).forEach(({ variant, url, publishedUrls }) => {
Expand Down Expand Up @@ -93,7 +96,7 @@ describe('Barque', () => {
try {
await barque.releaseToBarque('debian-x64', debUrl);
} catch (error) {
expect(error.message).to.include('Curator is unable to upload to barque');
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');
expect(barque.createCuratorDir).to.have.been.called;
expect(barque.extractLatestCurator).to.have.been.called;
expect(barque.execCurator).to.have.been.called;
Expand All @@ -115,56 +118,14 @@ describe('Barque', () => {
});
});

describe('getTargetDistro', () => {
it('determines distro for debian build variant', async() => {
const distro = barque.getTargetDistros('debian-x64');
expect(distro).to.deep.equal(['debian10', 'ubuntu1804', 'ubuntu2004']);
});

it('determines distro for redhat build variant', async() => {
const distro = barque.getTargetDistros('rhel-x64');
expect(distro).to.deep.equal(['rhel80']);
});

ALL_BUILD_VARIANTS
.filter(v => v !== 'debian-x64' && v !== 'rhel-x64')
.forEach(variant => {
it(`throws an error for ${variant}`, async() => {
try {
barque.getTargetDistros(variant);
} catch (e) {
expect(e.message).to.include(variant);
return;
}
expect.fail('Expected error');
});
});
});

describe('getTargetArchitecture', () => {
it('determines arch for debian', async() => {
const distro = barque.getTargetArchitecture('debian-x64');
expect(distro).to.be.equal('amd64');
});

it('determines arch for redhat', async() => {
const distro = barque.getTargetArchitecture('rhel-x64');
expect(distro).to.be.equal('x86_64');
});

ALL_BUILD_VARIANTS
.filter(v => v !== 'debian-x64' && v !== 'rhel-x64')
.forEach(variant => {
it(`throws an error for ${variant}`, async() => {
try {
barque.getTargetArchitecture(variant);
} catch (e) {
expect(e.message).to.include(variant);
return;
}
expect.fail('Expected error');
});
describe('getReposAndArch', () => {
for (const variant of ALL_BUILD_VARIANTS) {
it(`returns results for ${variant}`, () => {
const result = getReposAndArch(variant);
expect(result.ppas).to.be.an('array');
expect(result.arch).to.be.a('string');
});
}
});

describe('createCuratorDir', () => {
Expand Down
Loading