diff --git a/check-version.js b/check-version.js index 7ed0761c4..61927ae5d 100644 --- a/check-version.js +++ b/check-version.js @@ -1,5 +1,5 @@ const semver = require('semver'); -const { engines } = require('./package'); +const { engines } = require('./package.json'); function checkVersion(version = engines.node) { if (!semver.satisfies(process.version, version)) { diff --git a/codefresh-release.yml b/codefresh-release.yml index fae28dd8b..de23c5c41 100644 --- a/codefresh-release.yml +++ b/codefresh-release.yml @@ -1,16 +1,16 @@ # this pipeline should only be executed on master branch version: '1.0' - +mode: parallel +stages: + - prepare + - docker + - build + - github + - packages + - documentation steps: - - main_clone: - title: 'Cloning main repository...' - type: git-clone - repo: codefresh-io/cli - revision: ${{CF_BRANCH}} - git: cf_github - fail_if_not_master: + stage: prepare title: "Validate running on master branch" image: codefresh/build-cli commands: @@ -20,16 +20,60 @@ steps: branch: ignore: [ master ] + main_clone: + stage: prepare + title: 'Cloning main repository...' + type: git-clone + repo: codefresh-io/cli + revision: ${{CF_BRANCH}} + git: cf_github + when: + steps: + - name: fail_if_not_master + on: + - success + extract_version: + stage: prepare title: "Exporting package.json version" image: codefresh/build-cli commands: - 'export PACKAGE_VERSION=$(jq -r ".version" package.json)' - "echo Current version: $PACKAGE_VERSION" - "cf_export PACKAGE_VERSION" + when: + steps: + - name: main_clone + on: + - success + + install: + stage: prepare + title: "Installing dependencies" + image: codefresh/build-cli + commands: + - "yarn install" + when: + steps: + - name: main_clone + on: + - success + + generate_comletion: + stage: prepare + title: "Generating commands completion tree" + image: codefresh/build-cli + commands: + - "yarn generate-completion" + when: + steps: + - name: install + on: + - success -# in case the candidate image will not be found the release flow will crash and this means that the build pipelines has failed + # in case the candidate image will not be found the release flow will crash and this means that the build pipelines has failed push_step: + stage: docker type: push title: "Push release image" image_name: codefresh/cli @@ -48,8 +92,14 @@ steps: registry: cf-quay title: "push to quay.io" candidate: quay.io/codefresh/cli:${{CF_SHORT_REVISION}} + when: + steps: + - name: extract_version + on: + - success create_manifest_list: + stage: docker type: "codefresh-inc/multiarch-manifester" arguments: image_name: codefresh/cli @@ -72,27 +122,91 @@ steps: tags: - ${{PACKAGE_VERSION}} - latest - - generate_comletion: - title: "Generating commands completion tree" - image: codefresh/build-cli - commands: - - "yarn install" - - "yarn generate-completion" - - deploy_to_npm: - title: "Publishing To Npm" - type: npm-publish - arguments: - NPM_TOKEN: '${{NPM_TOKEN}}' - DIR: ./cli + when: + steps: + - name: push_step + on: + - success compile_executables: + stage: build title: "Compiling executables" image: codefresh/build-cli commands: - "rm -rf dist" - "yarn pkg" + when: + steps: + - name: generate_comletion + on: + - success + + archive_linux: + stage: build + title: "Archiving linux distribution" + image: codefresh/build-cli + commands: + - "rm -rf ./dist/linux" + - "mkdir -p ./dist/linux" + - "cp --force README.md LICENSE ./dist/linux" + - "cp --force ./dist/codefresh-linux ./dist/linux/codefresh" + - "tar -cf codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar README.md LICENSE -C ./dist/linux codefresh" + - "gzip -f codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar" + when: + steps: + - name: compile_executables + on: + - success + + archive_macos: + stage: build + title: "Archiving macos distribution" + image: codefresh/build-cli + commands: + - "rm -rf ./dist/macos" + - "mkdir -p ./dist/macos" + - "cp --force README.md LICENSE ./dist/macos" + - "cp --force ./dist/codefresh-macos ./dist/macos/codefresh" + - "tar -cf codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar README.md LICENSE -C ./dist/macos codefresh" + - "gzip -f codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar" + when: + steps: + - name: compile_executables + on: + - success + + archive_win: + stage: build + title: "Archiving macos distribution" + image: codefresh/build-cli + commands: + - "rm -rf ./dist/win" + - "mkdir -p ./dist/win" + - "cp --force README.md LICENSE ./dist/win" + - "cp --force ./dist/codefresh-win ./dist/win/codefresh.exe" + - "zip codefresh-v${{PACKAGE_VERSION}}-win-x64.zip README.md LICENSE -j ./dist/win/codefresh.exe " + when: + steps: + - name: compile_executables + on: + - success + + archive_alpine: + stage: build + title: "Archiving macos distribution" + image: codefresh/build-cli + commands: + - "rm -rf ./dist/alpine" + - "mkdir -p ./dist/alpine" + - "cp --force README.md LICENSE ./dist/alpine" + - "cp --force ./dist/codefresh-alpine ./dist/alpine/codefresh" + - "tar -cf codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar README.md LICENSE -C ./dist/alpine codefresh" + - "gzip -f codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar" + when: + steps: + - name: compile_executables + on: + - success create_release: title: "Create github release" @@ -100,6 +214,11 @@ steps: fail_fast: false commands: - 'curl --fail -X POST -d ''{"tag_name":"v${{PACKAGE_VERSION}}","target_commitish":"${{CF_REVISION}}","name":"Codefresh V${{PACKAGE_VERSION}}"}'' -H "Content-Type: application/json" -H "Authorization: token ${{GITHUB_TOKEN}}" https://api.github.com/repos/codefresh-io/cli/releases' + when: + steps: + - name: compile_executables + on: + - success get_release: title: "Get github release" @@ -109,57 +228,97 @@ steps: - "export GITHUB_RELEASE_ID=$(curl --fail https://api.github.com/repos/codefresh-io/cli/releases/tags/v${{PACKAGE_VERSION}} | jq -r '.id')" - "echo Github release id: $GITHUB_RELEASE_ID" - "cf_export GITHUB_RELEASE_ID" + when: + steps: + - name: create_release + on: + - success - upload_executables: - title: "Upload executables to github release" + upload_linux: + stage: github + title: "Upload linux executable to github release" image: codefresh/build-cli commands: -# delete all previous .zip/.gz created files and copy readme and license to ./dist - - "rm -rf *.gz" - - "rm -rf *.zip" - - "cp README.md LICENSE ./dist --force" -# upload linux-x64 asset - - "mv ./dist/codefresh-linux ./dist/codefresh" - - "tar -cf codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar README.md LICENSE -C ./dist ./codefresh " - - "gzip codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar" + # upload linux-x64 asset - 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar.gz https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-linux-x64.tar.gz' -# upload macos-x64 asset - - "mv ./dist/codefresh-macos ./dist/codefresh" - - "tar -cf codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar README.md LICENSE -C ./dist ./codefresh " - - "gzip codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar" + when: + steps: + - name: get_release + on: + - success + - name: archive_linux + on: + - success + + upload_macos: + stage: github + title: "Upload macos executable to github release" + image: codefresh/build-cli + commands: + # upload macos-x64 asset - 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar.gz https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-macos-x64.tar.gz' -# upload win-x64 asset - - "mv ./dist/codefresh-win.exe ./dist/codefresh.exe" - - "zip codefresh-v${{PACKAGE_VERSION}}-win-x64.zip README.md LICENSE -j ./dist/codefresh.exe " + when: + steps: + - name: get_release + on: + - success + - name: archive_macos + on: + - success + + upload_win: + stage: github + title: "Upload win executable to github release" + image: codefresh/build-cli + commands: + # upload win-x64 asset - 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-win-x64.zip https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-win-x64.zip' -# upload alpine-x64 asset - - "mv ./dist/codefresh-alpine ./dist/codefresh" - - "tar -cf codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar README.md LICENSE -C ./dist ./codefresh " - - "gzip codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar" - - 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar.gz https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar.gz' + when: + steps: + - name: get_release + on: + - success + - name: archive_win + on: + - success - update_documentation: - title: "Update documentation http://cli.codefresh.io" - image: docker:18.01 + upload_alpine: + stage: github + title: "Upload alpine executable to github release" + image: codefresh/build-cli commands: - - "apk update && apk add git nodejs" - - "npm install" - - "echo cleaning previous public dir and recreating worktree" - - "rm -rf public && git worktree prune && git worktree add -B gh-pages public origin/gh-pages" - - "echo Building public docs" - - "npm run build-public-docs" - - "echo Push new docs to gh-pages detached branch" - - 'git config --global user.email "auto-ci@codefresh.io" && git config --global user.name "Automated CI"' - - 'cd public && git add --all && git commit -m "Publish new documentation for version ${{PACKAGE_VERSION}}" && git push https://${{GITHUB_TOKEN}}@github.com/codefresh-io/cli.git' - environment: - - HUGO_VERSION=0.32.0 + # upload alpine-x64 asset + - 'curl --fail -X POST -H "Content-Type:application/octet-stream" -H "Authorization: token ${{GITHUB_TOKEN}}" --data-binary @codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar.gz https://uploads.github.com/repos/codefresh-io/cli/releases/${{GITHUB_RELEASE_ID}}/assets?name=codefresh-v${{PACKAGE_VERSION}}-alpine-x64.tar.gz' + when: + steps: + - name: get_release + on: + - success + - name: archive_alpine + on: + - success + + deploy_to_npm: + stage: packages + title: "Publishing To Npm" + type: npm-publish + arguments: + NPM_TOKEN: '${{NPM_TOKEN}}' + DIR: ./cli + when: + steps: + - name: generate_comletion + on: + - success + update_brew_formula: + stage: packages title: "Updating homebrew formula" image: codefresh/build-cli commands: - VERSION=v${{PACKAGE_VERSION}} - - curl -L https://github.com/codefresh-io/cli/releases/download/$VERSION/codefresh-$VERSION-macos-x64.tar.gz > $VERSION.tar.gz + - cp --force codefresh-$VERSION-macos-x64.tar.gz $VERSION.tar.gz - echo "compute SHA256 ..." - SHA256="$(shasum -a 256 ./$VERSION.tar.gz | awk '{print $1}')" - echo "generate file from template ..." @@ -171,3 +330,48 @@ steps: \"content\": \"$(openssl base64 -A -in codefresh.rb)\", \ \"sha\": $(curl -X GET https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/codefresh.rb | jq .sha) \ }" https://api.github.com/repos/codefresh-io/homebrew-cli/contents/Formula/codefresh.rb + when: + steps: + - name: archive_macos + on: + - success + + update_documentation: + stage: documentation + title: "Update documentation http://cli.codefresh.io" + image: docker:18.01 + commands: + - "apk update && apk add git nodejs" + - "npm install" + - "echo cleaning previous public dir and recreating worktree" + - "rm -rf public && git worktree prune && git worktree add -B gh-pages public origin/gh-pages" + - "echo Building public docs" + - "npm run build-public-docs" + - "echo Push new docs to gh-pages detached branch" + - 'git config --global user.email "auto-ci@codefresh.io" && git config --global user.name "Automated CI"' + - 'cd public && git add --all && git commit -m "Publish new documentation for version ${{PACKAGE_VERSION}}" && git push https://${{GITHUB_TOKEN}}@github.com/codefresh-io/cli.git' + environment: + - HUGO_VERSION=0.32.0 + when: + steps: + - name: upload_linux + on: + - success + - name: upload_macos + on: + - success + - name: upload_win + on: + - success + - name: upload_alpine + on: + - success + - name: update_brew_formula + on: + - success + - name: deploy_to_npm + on: + - success + - name: create_manifest_list + on: + - success diff --git a/codefresh.yml b/codefresh.yml index 8bbecd8f1..678406560 100644 --- a/codefresh.yml +++ b/codefresh.yml @@ -10,40 +10,64 @@ steps: revision: ${{CF_BRANCH}} git: cf_github + extract_version: + title: "Exporting package.json version" + image: codefresh/build-cli + commands: + - 'export PACKAGE_VERSION=$(jq -r ".version" package.json)' + - "echo Current version: $PACKAGE_VERSION" + - "cf_export PACKAGE_VERSION" + + check_version: + title: 'Checking if version already exists' + image: codefresh/build-cli + fail_fast: false + commands: + - >- + RELEASE_ID="$(curl -s https://api.github.com/repos/codefresh-io/cli/releases/tags/v${{PACKAGE_VERSION}} | jq .id)" + echo "Release id: $RELEASE_ID" + + if [ -z "$RELEASE_ID" ] || [ "$RELEASE_ID" = 'null' ]; then + echo "Version is ok: ${{PACKAGE_VERSION}}" + else + echo "Release already exists ${{PACKAGE_VERSION}}" + exit 1 + fi + when: + condition: + all: + skipVersionCheck: '"${{SKIP_VERSION_CHECK}}" != "true"' + install_dependencies: title: 'Installing testing dependencies' - image: quay.io/codefresh/node-tester-image:12.21.0 + image: codefresh/build-cli commands: - - yarn install --frozen-lockfile + - yarn install --frozen-lockfile parallel_tests: type: parallel steps: eslint: title: 'Running linting logic' - image: quay.io/codefresh/node-tester-image:12.21.0 + image: codefresh/build-cli commands: - yarn eslint - unit-tests: + unit_tests: title: 'Running unit tests' - image: quay.io/codefresh/node-tester-image:12.21.0 + image: codefresh/build-cli commands: - yarn test - e2e-tests: + e2e_tests: title: 'Running e2e tests' - image: quay.io/codefresh/node-tester-image:12.21.0 + image: codefresh/build-cli commands: - - yarn e2e - - extract_version: - title: "Exporting package.json version" - image: codefresh/build-cli - commands: - - 'export PACKAGE_VERSION=$(jq -r ".version" package.json)' - - "echo Current version: $PACKAGE_VERSION" - - "cf_export PACKAGE_VERSION" + - "echo Running e2e on account: ${{CF_ACCOUNT}}" + - CF_API_KEY=${{CF_E2E_API_KEY}} yarn e2e + when: + branch: + ignore: [ master ] build_images: type: parallel @@ -58,7 +82,7 @@ steps: run_arm_build: type: codefresh-run arguments: - PIPELINE_ID: 'codefresh-io/cli/build-arm' + PIPELINE_ID: codefresh-io/cli/build-arm TRIGGER_ID: codefresh-io/cli BRANCH: ${{CF_BRANCH}} DETACH: false @@ -114,9 +138,17 @@ steps: tags: - ${{CF_SHORT_REVISION}} + fail_on_bad_version: + image: codefresh/build-cli + commands: + - exit 1 + when: + condition: + all: + versionCheckFailed: steps.check_version.result == 'failure' + execute_release_pipeline: title: "Execute release pipeline in case version was changed" - fail_fast: false type: codefresh-run arguments: PIPELINE_ID: 'codefresh-io/cli/release' @@ -127,3 +159,6 @@ steps: when: branch: only: [ master ] + condition: + all: + versionCheckSucceeded: steps.check_version.result != 'failure' diff --git a/e2e/README.md b/e2e/README.md new file mode 100644 index 000000000..1362783e3 --- /dev/null +++ b/e2e/README.md @@ -0,0 +1,10 @@ +# Codefresh Cli E2E + +Account -- codefresh-cli-e2e + +If you want to debug e2e: +1) enable debug on the `build` pipeline +2) put breakpoint after `e2e_tests` step +3) then you can see logs of each test under `/codefresh/volume/cli/e2e/scenarios` + +##### Note: try to create projects that do not contain same words (like _cli-e2e_ and _cli-e2e_-test) diff --git a/e2e/data/crud.pip.yaml b/e2e/data/crud.pip.yaml new file mode 100644 index 000000000..c8720f063 --- /dev/null +++ b/e2e/data/crud.pip.yaml @@ -0,0 +1,23 @@ +version: '1.0' +kind: pipeline +metadata: + name: pipeline-crud/crud + project: pipeline-crud + originalYamlString: | + version: '1.0' + steps: + test: + image: alpine + commands: + - echo test +spec: + triggers: [] + stages: [] + variables: [] + contexts: [] + steps: + test: + image: alpine + commands: + - echo test + diff --git a/e2e/data/test-run.pip.yaml b/e2e/data/test-run.pip.yaml new file mode 100644 index 000000000..23d22db95 --- /dev/null +++ b/e2e/data/test-run.pip.yaml @@ -0,0 +1,23 @@ +version: '1.0' +kind: pipeline +metadata: + name: test-run/test-run + project: test-run + originalYamlString: | + version: '1.0' + steps: + test: + image: alpine + commands: + - echo test +spec: + triggers: [] + stages: [] + variables: [] + contexts: [] + steps: + test: + image: alpine + commands: + - echo test + diff --git a/e2e/e2e.spec.sh b/e2e/e2e.spec.sh index 0d7deacdc..bf3420d1a 100644 --- a/e2e/e2e.spec.sh +++ b/e2e/e2e.spec.sh @@ -2,20 +2,15 @@ set -e set -o pipefail -SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd) -CODEFRESH_PATH="$SCRIPT_DIR/../lib/interface/cli/codefresh" - -echo "Using $CODEFRESH_PATH" -function codefresh() { - $CODEFRESH_PATH $@ -} +export SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" &> /dev/null && pwd) +source "$SCRIPT_DIR/helpers.sh" codefresh version echo for executable in $SCRIPT_DIR/scenarios/*.sh do - source $executable > "$executable.log" & + source $executable > "$executable.log" 2>&1 & echo "[$!] Executing: $executable" done echo diff --git a/e2e/helpers.sh b/e2e/helpers.sh new file mode 100644 index 000000000..909d335a9 --- /dev/null +++ b/e2e/helpers.sh @@ -0,0 +1,10 @@ +CODEFRESH_PATH="$SCRIPT_DIR/../lib/interface/cli/codefresh" + +echo "Using $CODEFRESH_PATH" +function codefresh() { + $CODEFRESH_PATH $@ +} + +function exists() { + codefresh get $1 | grep $2 || echo '' +} diff --git a/e2e/scenarios/pipeline-run.sh b/e2e/scenarios/pipeline-run.sh new file mode 100644 index 000000000..f990f8462 --- /dev/null +++ b/e2e/scenarios/pipeline-run.sh @@ -0,0 +1,26 @@ +project=test-run +pipeline="$project/test-run" +pipeline_file="$SCRIPT_DIR/data/test-run.pip.yaml" + +existing_pipeline=`exists pipeline $pipeline` +existing_project=`exists project $project` + +if [ -z "$existing_project" ]; then + echo "Project does not exist: $project" + echo "Creating project: $project" + codefresh create project $project +else + echo "Project already exists: $project" +fi + +if [ -z "$existing_pipeline" ]; then + echo "Pipeline does not exist: $pipeline" + echo "Creating pipeline: $pipeline" + codefresh create -f $pipeline_file +else + echo "Pipeline already exists: $pipeline" +fi + +codefresh run $pipeline +codefresh delete pipeline $pipeline +codefresh delete project $project diff --git a/e2e/scenarios/pipelines.sh b/e2e/scenarios/pipelines.sh index 8909f0d9b..0a94ca784 100644 --- a/e2e/scenarios/pipelines.sh +++ b/e2e/scenarios/pipelines.sh @@ -1 +1,31 @@ +project='pipeline-crud' +pipeline="$project/crud" +pipeline_file="$SCRIPT_DIR/data/crud.pip.yaml" + +existing_project=`exists project $project` +existing_pipeline=`exists pipeline $pipeline` + +if [ -z "$existing_project" ]; then + echo "Project does not exist: $project" + echo "Creating project: $project" + codefresh create project $project +else + echo "Project already exists: $project" +fi + +if [ -z "$existing_pipeline" ]; then + echo "Pipeline does not exist: $pipeline" + echo "Creating pipeline: $pipeline" + codefresh create -f $pipeline_file +else + echo "Pipeline already exists: $pipeline" + codefresh delete pipeline $pipeline + codefresh create -f $pipeline_file +fi + codefresh get pipelines +codefresh get pipeline $pipeline + +codefresh delete pipeline $pipeline +codefresh delete project $project + diff --git a/e2e/scenarios/projects.sh b/e2e/scenarios/projects.sh index 699a09a60..59faddf88 100644 --- a/e2e/scenarios/projects.sh +++ b/e2e/scenarios/projects.sh @@ -1 +1,17 @@ +project='project-crud' + +existing_project=`exists project $project` + +if [ -z "$existing_project" ]; then + echo "Project does not exist: $project" + echo "Creating project: $project" + codefresh create project $project +else + echo "Project already exists: $project" + codefresh delete project $project + codefresh create project $project +fi + codefresh get projects +codefresh get project $project +codefresh delete project $project diff --git a/lib/interface/cli/helpers/helpers.sdk.spec.js b/lib/interface/cli/helpers/helpers.sdk.spec.js index b47513811..849239b2a 100644 --- a/lib/interface/cli/helpers/helpers.sdk.spec.js +++ b/lib/interface/cli/helpers/helpers.sdk.spec.js @@ -67,15 +67,6 @@ describe('helpers using sdk', () => { expect(sdk.logs.showWorkflowLogs).toBeCalled(); await verifyResponsesReturned([DEFAULT_RESPONSE]); // eslint-disable-line }); - it('should not show logs if check version throw an exception', async () => { - const workflowId = 'id'; - jest.spyOn(sdk.logs, 'showWorkflowLogs').mockImplementation(); - versionChecker.checkVersion.mockImplementationOnce(() => { - throw new Error(); - }); - await followLogs(workflowId); - expect(sdk.logs.showWorkflowLogs).not.toBeCalled(); - }); }); describe('auth', () => { diff --git a/lib/interface/cli/helpers/logs.js b/lib/interface/cli/helpers/logs.js index bafab5780..7b5be7b63 100644 --- a/lib/interface/cli/helpers/logs.js +++ b/lib/interface/cli/helpers/logs.js @@ -6,9 +6,8 @@ const CFError = require('cf-errors'); const { sdk } = require('../../../logic'); const Workflow = require('../../../logic/entities/Workflow'); const Output = require('../../../output/Output'); -const { checkVersion } = require('./../../../../check-version'); - -const nodeVersionToValidate = '<=10.x >=8.x'; +const { checkVersion } = require('../../../../check-version'); +const { engines } = require('../../../../package.json'); const END_STATUSES = ['error', 'success', 'terminated']; @@ -56,15 +55,6 @@ async function _fallbackLogs(workflowId, interval, retriesLeft) { } const followLogs = async (workflowId) => { - try { - checkVersion(nodeVersionToValidate); - } catch (error) { - const url = _.get(sdk, 'config.context.url', 'https://g.codefresh.io'); - const buildLink = `${url}/build/${workflowId}`; - // eslint-disable-next-line max-len - console.log(`Your node version (${process.version}) is not compatible with supported node version (${nodeVersionToValidate}) for this command, click the link to see it in codefresh UI : ${buildLink}`); - return; - } try { await sdk.logs.showWorkflowLogs(workflowId, true); } catch (e) {