Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
feat: supported bee version check (#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
AuHau authored Nov 8, 2022
1 parent 86e8649 commit 4b02910
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 11 deletions.
44 changes: 36 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,13 @@
"dockerode": "^3.3.4",
"furious-commander": "^1.7.1",
"node-fetch": "3.0.0-beta.9",
"ora": "^5.3.0"
"ora": "^5.3.0",
"semver": "^7.3.8"
},
"devDependencies": {
"@ethersphere/jest-serial-runner": "^1.0.0",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@ethersphere/jest-serial-runner": "^1.0.0",
"@fluffy-spoon/substitute": "^1.208.0",
"@jest/types": "^29.2.1",
"@types/dockerode": "^3.3.11",
Expand All @@ -74,6 +75,7 @@
"engines": {
"node": ">=12.0.0",
"npm": ">=6.0.0",
"bee": "1.9.0"
"bee": "1.9.0",
"supportedBee": ">=1.9.0"
}
}
9 changes: 9 additions & 0 deletions src/command/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import { waitForBlockchain, waitForQueen, waitForWorkers } from '../utils/wait'
import ora from 'ora'
import { VerbosityLevel } from './root-command/logging'
import { findBeeVersion, stripCommit } from '../utils/config-sources'
import PackageJson from '../../package.json'
import semver from 'semver'

const DEFAULT_REPO = 'ethersphere'

Expand Down Expand Up @@ -101,6 +103,13 @@ export class Start extends RootCommand implements LeafCommand {
}

this.beeVersion = stripCommit(this.beeVersion)
const supportedBeeVersion = PackageJson.engines.supportedBee

if (!semver.satisfies(this.beeVersion, supportedBeeVersion)) {
throw new Error(
`Unsupported Bee version!\nThis version of Bee Factory supports versions: ${supportedBeeVersion}, but you have requested start of ${this.beeVersion}`,
)
}

const dockerOptions = await this.buildDockerOptions()
const docker = new Docker(this.console, this.envPrefix, this.imagePrefix, this.repo)
Expand Down

0 comments on commit 4b02910

Please sign in to comment.