From 54ff72fdc4a1cf74424795d316904a4842b3e512 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 2 Aug 2023 08:17:38 -0700 Subject: [PATCH 1/6] chore: try this --- shared-scripts.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/shared-scripts.sh b/shared-scripts.sh index 314d6ad4d36..83e8d0a7050 100644 --- a/shared-scripts.sh +++ b/shared-scripts.sh @@ -286,6 +286,7 @@ function _runE2ETestsLinux { _loadE2ECache _install_packaged_cli_linux # verify installation + which amplify amplify version source .circleci/local_publish_helpers.sh && startLocalRegistry "$CODEBUILD_SRC_DIR/.circleci/verdaccio.yaml" setNpmRegistryUrlToLocal From 9555a532bad1f956dd86b5ef30a7494bf21cbbe2 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 2 Aug 2023 08:33:39 -0700 Subject: [PATCH 2/6] chore: check what CCI is doing --- .circleci/config.base.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.base.yml b/.circleci/config.base.yml index 0eac836d3e7..1a83ae382d1 100644 --- a/.circleci/config.base.yml +++ b/.circleci/config.base.yml @@ -1469,7 +1469,9 @@ commands: source $BASH_ENV - run: name: Confirm Amplify CLI is installed and available in PATH - command: amplify version + command: | + which amplify + amplify version rename_binary_for_windows: description: 'Rename binary for windows' From c306d776b374cd3e8dfb0f204e83df0784e3731e Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 2 Aug 2023 09:29:03 -0700 Subject: [PATCH 3/6] chore: try this --- packages/amplify-e2e-core/src/utils/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/amplify-e2e-core/src/utils/index.ts b/packages/amplify-e2e-core/src/utils/index.ts index 9a4023a984e..fce8a8d479e 100644 --- a/packages/amplify-e2e-core/src/utils/index.ts +++ b/packages/amplify-e2e-core/src/utils/index.ts @@ -31,9 +31,11 @@ export * from './git-operations'; export * from './help'; /** - * Whether the current environment is CircleCI or not + * Whether the current environment is Amplify CLI CI or not */ -export const isCI = (): boolean => JSON.parse(process.env.CI || 'false') && JSON.parse(process.env.CIRCLECI || 'false'); +export const isCI = (): boolean => + (JSON.parse(process.env.CI || 'false') && JSON.parse(process.env.CIRCLECI || 'false')) || + JSON.parse(process.env.IS_AMPLIFY_CI || 'false'); // eslint-disable-next-line spellcheck/spell-checker export const TEST_PROFILE_NAME = isCI() ? 'amplify-integ-test-user' : 'default'; From 54f8ac2786bc550265cb4e52d13be6e096c82b37 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 2 Aug 2023 10:42:24 -0700 Subject: [PATCH 4/6] chore: undo this --- packages/amplify-e2e-core/src/utils/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/amplify-e2e-core/src/utils/index.ts b/packages/amplify-e2e-core/src/utils/index.ts index 699787c4add..e19aeafe987 100644 --- a/packages/amplify-e2e-core/src/utils/index.ts +++ b/packages/amplify-e2e-core/src/utils/index.ts @@ -32,11 +32,9 @@ export * from './help'; export * from './credentials-rotator'; /** - * Whether the current environment is Amplify CLI CI or not + * Whether the current environment is CircleCI or not */ -export const isCI = (): boolean => - (JSON.parse(process.env.CI || 'false') && JSON.parse(process.env.CIRCLECI || 'false')) || - JSON.parse(process.env.IS_AMPLIFY_CI || 'false'); +export const isCI = (): boolean => JSON.parse(process.env.CI || 'false') && JSON.parse(process.env.CIRCLECI || 'false'); // eslint-disable-next-line spellcheck/spell-checker export const TEST_PROFILE_NAME = isCI() ? 'amplify-integ-test-user' : 'default'; From 1ee1fdb4a0e87dbfcccd6fbe1eb8d92f27b87ebe Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 2 Aug 2023 11:57:37 -0700 Subject: [PATCH 5/6] chore: fix regex --- packages/amplify-app/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-app/src/index.js b/packages/amplify-app/src/index.js index ab57afbdd4d..e50c14fe98f 100644 --- a/packages/amplify-app/src/index.js +++ b/packages/amplify-app/src/index.js @@ -112,7 +112,7 @@ async function installAmplifyCLI() { async function amplifyCLIVersionCheck() { try { const amplifyCLIVersionRaw = await callAmplify(['-v'], { inheritIO: false }); - const amplifyCLIVersionMatch = amplifyCLIVersionRaw.match(/\d+\.\d+\.\d+(-[a-z]+\.[0-9]+)?/g); + const amplifyCLIVersionMatch = amplifyCLIVersionRaw.match(/^\d+\.\d+\.\d/g); const amplifyCLIVersion = Array.isArray(amplifyCLIVersionMatch) && amplifyCLIVersionMatch.length > 0 ? amplifyCLIVersionMatch[0] : undefined; const minCLIVersion = engines['@aws-amplify/cli']; From 9d4fed19316ce8e76b7c056ced4b2f2374bd1482 Mon Sep 17 00:00:00 2001 From: Kamil Sobol Date: Wed, 2 Aug 2023 14:06:21 -0700 Subject: [PATCH 6/6] Update packages/amplify-app/src/index.js Co-authored-by: John Hockett --- packages/amplify-app/src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/amplify-app/src/index.js b/packages/amplify-app/src/index.js index e50c14fe98f..8db7ff296f7 100644 --- a/packages/amplify-app/src/index.js +++ b/packages/amplify-app/src/index.js @@ -112,7 +112,7 @@ async function installAmplifyCLI() { async function amplifyCLIVersionCheck() { try { const amplifyCLIVersionRaw = await callAmplify(['-v'], { inheritIO: false }); - const amplifyCLIVersionMatch = amplifyCLIVersionRaw.match(/^\d+\.\d+\.\d/g); + const amplifyCLIVersionMatch = amplifyCLIVersionRaw.match(/^\d+\.\d+\.\d+/g); const amplifyCLIVersion = Array.isArray(amplifyCLIVersionMatch) && amplifyCLIVersionMatch.length > 0 ? amplifyCLIVersionMatch[0] : undefined; const minCLIVersion = engines['@aws-amplify/cli'];