mirror of
https://github.com/werf/actions.git
synced 2026-02-11 05:46:23 +03:00
feat: working within 2 major version
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
This commit is contained in:
@@ -7,8 +7,6 @@ import {String} from 'typescript-string-operations'
|
||||
import {Manager} from './manager'
|
||||
import * as werf from './werf'
|
||||
|
||||
const minimalWerfVersion = 'v1.1.17'
|
||||
|
||||
export async function PrepareEnvironAndRunWerfCommand(
|
||||
args: string[]
|
||||
): Promise<void> {
|
||||
@@ -67,27 +65,15 @@ export function ProcessGitHubContext(): void {
|
||||
|
||||
export function ValidateWerfVersion(version: string): void {
|
||||
const ver = semver.coerce(version)
|
||||
if (ver) {
|
||||
if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) {
|
||||
throw new Error(
|
||||
String.Format(
|
||||
'The arbitrary version ({0}) must be within the MAJOR.MINOR ({1})',
|
||||
version.trim(),
|
||||
werf.MAJOR_MINOR_GROUP
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
if (semver.gte(ver, minimalWerfVersion)) {
|
||||
return
|
||||
}
|
||||
if (ver && ver.major === werf.MAJOR) {
|
||||
return
|
||||
}
|
||||
|
||||
throw new Error(
|
||||
String.Format(
|
||||
'werf version {0} is not supported (expected version must be equal or greater than {1})',
|
||||
'werf version {0} is not supported: the version must be semver and within the MAJOR ({1})',
|
||||
version.trim(),
|
||||
minimalWerfVersion
|
||||
werf.GROUP
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -125,7 +125,7 @@ export class Manager {
|
||||
return this._constructReleaseUrl(version)
|
||||
}
|
||||
|
||||
const url = `${WERF_TUF_SERVER_URL}/targets/channels/${werf.MAJOR_MINOR_GROUP}/${this.channel}`
|
||||
const url = `${WERF_TUF_SERVER_URL}/targets/channels/${werf.GROUP}/${this.channel}`
|
||||
try {
|
||||
const resp = await request
|
||||
.get(url)
|
||||
|
||||
@@ -1,3 +1,2 @@
|
||||
export const MAJOR_MINOR_GROUP = '1.2'
|
||||
export const MAJOR = 1
|
||||
export const MINOR = 2
|
||||
export const GROUP = '2'
|
||||
export const MAJOR = 2
|
||||
|
||||
Reference in New Issue
Block a user