@pagopa/dx-cli 0.18.2 → 0.18.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -181,7 +181,7 @@ export class AzureCloudAccountService {
|
|
|
181
181
|
await Promise.all([
|
|
182
182
|
secretClient.setSecret("github-runner-app-id", runnerAppCredentials.id),
|
|
183
183
|
secretClient.setSecret("github-runner-app-installation-id", runnerAppCredentials.installationId),
|
|
184
|
-
secretClient.setSecret("github-runner-app-key", runnerAppCredentials.key),
|
|
184
|
+
secretClient.setSecret("github-runner-app-key", Buffer.from(runnerAppCredentials.key, "utf-8").toString("base64")),
|
|
185
185
|
]);
|
|
186
186
|
logger.debug("Created secrets in key vault {keyVaultName} in subscription {subscriptionId}", { keyVaultName, subscriptionId: cloudAccount.id });
|
|
187
187
|
}
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ResultAsync } from "neverthrow";
|
|
3
3
|
import { GitHubService } from "../../../domain/github.js";
|
|
4
|
-
export declare const checkPreconditions: () => ResultAsync<
|
|
4
|
+
export declare const checkPreconditions: () => ResultAsync<import("execa").Result<{
|
|
5
|
+
environment: {
|
|
6
|
+
NO_COLOR: string;
|
|
7
|
+
TF_IN_AUTOMATION: string;
|
|
8
|
+
TF_INPUT: string;
|
|
9
|
+
};
|
|
10
|
+
shell: true;
|
|
11
|
+
}>, Error>;
|
|
5
12
|
type InitCommandDependencies = {
|
|
6
13
|
gitHubService: GitHubService;
|
|
7
14
|
};
|
|
@@ -36,6 +36,7 @@ const displaySummary = (initResult) => {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
const checkTerraformCliIsInstalled = () => withSpinner("Checking Terraform installation...", "Terraform is installed!", "Please install terraform CLI before running this command. If you use tfenv, run: tfenv install latest && tfenv use latest", tf$ `terraform -version`);
|
|
39
|
+
const checkCorepackIsInstalled = () => withSpinner("Checking Corepack installation...", "Corepack is installed!", "Please install Corepack before running this command.", tf$ `corepack -v`);
|
|
39
40
|
const azureAccountSchema = z.object({
|
|
40
41
|
user: z.object({
|
|
41
42
|
name: z.string().min(1),
|
|
@@ -49,7 +50,10 @@ const ensureAzLogin = async () => {
|
|
|
49
50
|
return user.name;
|
|
50
51
|
};
|
|
51
52
|
const checkAzLogin = () => withSpinner("Check Azure login status...", (userName) => `You are logged in to Azure (${userName})`, "Please log in to Azure CLI using `az login` before running this command.", ensureAzLogin());
|
|
52
|
-
|
|
53
|
+
// TODO(CES-1810): Make these checks concurrent to speed up the preconditions check phase
|
|
54
|
+
export const checkPreconditions = () => checkTerraformCliIsInstalled()
|
|
55
|
+
.andThen(() => checkAzLogin())
|
|
56
|
+
.andThen(() => checkCorepackIsInstalled());
|
|
53
57
|
const createRemoteRepository = ({ repoName, repoOwner, }) => {
|
|
54
58
|
const logger = getLogger(["dx-cli", "init"]);
|
|
55
59
|
const repo$ = tf$({ cwd: path.resolve("infra", "repository") });
|
|
@@ -17,6 +17,7 @@ export default function (plop) {
|
|
|
17
17
|
env,
|
|
18
18
|
extendEnv: false, // Don't include process.env variables
|
|
19
19
|
});
|
|
20
|
+
await pnpm$ `corepack enable`;
|
|
20
21
|
await pnpm$ `corepack use pnpm@latest`;
|
|
21
22
|
await pnpm$ `pnpm -w add -D turbo @changesets/cli @devcontainers/cli`;
|
|
22
23
|
await pnpm$ `pnpm changeset init`;
|