Fix not updated new SDK location (#2287)
* Fix not update new sdk location * Fix gulp constants * Update DevOps pipeline
This commit is contained in:
Родитель
46256048d9
Коммит
08f91ab9fe
|
@ -47,15 +47,6 @@ jobs:
|
|||
customCommand: 'run pack-client$(packageSuffix)'
|
||||
displayName: 'npm run pack-client$(packageSuffix)'
|
||||
|
||||
#Eventually, after moving all packages from old repo structure, we can remove this task completely
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
contents: 'packages/**/*.tgz'
|
||||
targetFolder: $(Build.ArtifactStagingDirectory)
|
||||
flattenFolders: true
|
||||
displayName: 'Copy Packages'
|
||||
|
||||
# for copying packages that have move to the new repo structure
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
contents: 'sdk/**/**/*.tgz'
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
omitted_paths:
|
||||
- documentation/ServicePrincipal/*
|
||||
- "packages/@azure/arm-*"
|
||||
- "sdk/*/arm-*"
|
||||
- "packages/@azure/cognitiveservices-*"
|
||||
- "sdk/cognitiveservices/*"
|
||||
language: js
|
||||
root_check_enabled: True
|
||||
required_readme_sections:
|
||||
|
|
|
@ -37,7 +37,7 @@ if (baseReference !== headReference) {
|
|||
}
|
||||
|
||||
const repositoryFolderPath: string = resolvePath(__dirname, "..");
|
||||
const packagesFolderPath: string = joinPath(repositoryFolderPath, "packages");
|
||||
const packagesFolderPath: string = joinPath(repositoryFolderPath, "sdk");
|
||||
const packageFolderPaths: string[] | undefined = getPackageFolderPaths(packagesFolderPath);
|
||||
|
||||
let exitCode: number = 0;
|
||||
|
@ -64,4 +64,4 @@ if (!packageFolderPaths) {
|
|||
}
|
||||
}
|
||||
}
|
||||
process.exitCode = exitCode;
|
||||
process.exitCode = exitCode;
|
||||
|
|
|
@ -8,6 +8,7 @@ import Octokit, { PullRequestsCreateParams, PullRequestsCreateReviewRequestParam
|
|||
import { Reference, Repository } from 'nodegit';
|
||||
import { Branch, commitChanges, createNewUniqueBranch, getToken, pushBranch, ValidateEachFunction, ValidateFunction } from './git';
|
||||
import { Logger } from './logger';
|
||||
import * as path from "path";
|
||||
|
||||
const _repositoryOwner = "Azure";
|
||||
const _logger = Logger.get();
|
||||
|
@ -118,8 +119,9 @@ export async function getDataFromPullRequest(pullRequestUrl: string): Promise<{
|
|||
const pullRequest: Octokit.Response<Octokit.PullRequestsGetResponse> = await octokit.pullRequests.get(params);
|
||||
const branchName: string = pullRequest.data.head.ref;
|
||||
const files: Octokit.Response<Octokit.PullRequestsGetFilesResponseItem[]> = await octokit.pullRequests.getFiles(params);
|
||||
const path: string = getRootFolder(files.data.map(i => i.filename));
|
||||
const packageName: string | undefined = getPackageNameFromPath(path);
|
||||
const rootPath: string = getRootFolder(files.data.map(i => i.filename));
|
||||
const packageJson = require(path.join(rootPath, "package.json"));
|
||||
const packageName: string | undefined = packageJson.name;
|
||||
|
||||
_logger.logTrace(`Found "${packageName}" package name and ${branchName} branch name`)
|
||||
return { packageName: packageName, branchName: branchName, prId: params.number };
|
||||
|
@ -140,15 +142,6 @@ function parsePullRequestUrl(pullRequestUrl: string): PullRequestsGetParams {
|
|||
};
|
||||
}
|
||||
|
||||
function getPackageNameFromPath(rootFolder: string): string | undefined {
|
||||
if (!rootFolder || !rootFolder.startsWith("packages/") || rootFolder === "packages/" || rootFolder === "packages/@azure/") {
|
||||
_logger.logDebug(`Can't get package name from '${rootFolder}' path`);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return rootFolder.slice("packages/".length);
|
||||
}
|
||||
|
||||
function getRootFolder(changedFiles: string[]): string {
|
||||
const pathsParts = changedFiles.map(changedFile => changedFile.split("/"));
|
||||
let commonParts = [];
|
||||
|
|
|
@ -233,7 +233,7 @@ export async function regenerate(branchName: string, packageName: string, azureS
|
|||
}
|
||||
|
||||
async function bumpMinorVersion(azureSdkForJsRepoPath: string, packageName: string) {
|
||||
const pathToPackageJson = path.resolve(azureSdkForJsRepoPath, "packages", packageName, "package.json");
|
||||
const pathToPackageJson = path.resolve(azureSdkForJsRepoPath, "sdk", packageName, "package.json");
|
||||
const packageJsonContent = await fs.promises.readFile(pathToPackageJson);
|
||||
const packageJson = JSON.parse(packageJsonContent.toString());
|
||||
const versionString = packageJson.version;
|
||||
|
|
|
@ -196,7 +196,7 @@ export async function getPackageInformationFromPackageJsons(azureSdkForJsRoot: s
|
|||
}
|
||||
|
||||
async function getPackageJsons(azureSdkForJsRoot: string): Promise<string[]> {
|
||||
const packagesPath = path.resolve(azureSdkForJsRoot, "packages");
|
||||
const packagesPath = path.resolve(azureSdkForJsRoot, "sdk");
|
||||
const allChildDirectories = await findChildDirectoriesRecursively(packagesPath);
|
||||
const packagesJsonPaths = allChildDirectories
|
||||
.map(dir => path.resolve(dir, "package.json"))
|
||||
|
|
|
@ -205,7 +205,7 @@ function pack(): void {
|
|||
}
|
||||
}
|
||||
|
||||
const packageFolderRoot: string = path.resolve(__dirname, "packages");
|
||||
const packageFolderRoot: string = path.resolve(__dirname, "sdk");
|
||||
_logger.logTrace(`INFO: Searching for package folders in ${packageFolderRoot}`);
|
||||
const packageFolderPaths: string[] | undefined = getPackageFolderPaths(packageFolderRoot);
|
||||
if (!packageFolderPaths) {
|
||||
|
|
|
@ -44,4 +44,4 @@ typedoc/
|
|||
|
||||
# coverage #
|
||||
.nyc_output
|
||||
coverage
|
||||
coverage
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
"rollup-plugin-sourcemaps": "^0.4.2",
|
||||
"uglify-js": "^3.4.9"
|
||||
},
|
||||
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/arm-logic",
|
||||
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/logic/arm-logic",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/azure/azure-sdk-for-js.git"
|
||||
|
|
|
@ -28,4 +28,4 @@ The overall build pipeline looks like the following:
|
|||
Tests follow a similar pipeline, however output folders have the `test-` prefix.
|
||||
|
||||
|
||||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fpackages%2F%40azure%2Ftemplate%2FREADME.png)
|
||||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js/sdk/template/template/README.png)
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
"engine": {
|
||||
"node": ">=6.0.0"
|
||||
},
|
||||
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/packages/@azure/template",
|
||||
"homepage": "https://github.com/azure/azure-sdk-for-js/tree/master/sdk/template/template",
|
||||
"devDependencies": {
|
||||
"@types/mocha": "^5.2.5",
|
||||
"@types/node": "^10.7.1",
|
||||
|
|
Загрузка…
Ссылка в новой задаче