Skip to content

Commit 8f964c4

Browse files
authored
Merge pull request #27 from oracle-devrel/fix-zsh-issue
fix zsh issue
2 parents b4f5fe0 + c0b30e2 commit 8f964c4

13 files changed

+57
-108
lines changed

scripts/build.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { getNamespace, getRegionByName } from "./lib/oci.mjs";
44
import { checkPodmanMachineRunning, buildImage } from "./lib/container.mjs";
55
import { getVersionGradle } from "./lib/gradle.mjs";
66

7-
const shell = process.env.SHELL | "/bin/zsh";
8-
$.shell = shell;
97
$.verbose = false;
108

119
checkPodmanMachineRunning();

scripts/bump.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88
import { bump } from "./lib/npm.mjs";
99
import { bumpGradle, getVersionGradle } from "./lib/gradle.mjs";
1010

11-
const shell = process.env.SHELL | "/bin/zsh";
12-
$.shell = shell;
1311
$.verbose = false;
1412

1513
let properties = await readEnvJson();

scripts/ci.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import {
44
} from "./lib/oci.mjs";
55
import { readEnvJson } from "./lib/utils.mjs";
66

7-
const shell = process.env.SHELL | "/bin/zsh";
8-
$.shell = shell;
97
$.verbose = false;
108

119
let properties = await readEnvJson();

scripts/containerInstances.mjs

Lines changed: 52 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,15 @@
11
#!/usr/bin/env zx
2-
import {
3-
getNamespace,
4-
setVariableFromEnvOrPrompt,
5-
writeEnvJson,
6-
generateRandomString,
7-
readEnvJson,
8-
} from "./lib/utils.mjs";
9-
import {
10-
getRegions,
11-
getTenancyId,
12-
} from "./lib/oci.mjs";
13-
import {
14-
containerLogin,
15-
whichContainerEngine,
16-
checkPodmanMachineRunning,
17-
} from "./lib/container.mjs";
2+
import { readEnvJson } from "./lib/utils.mjs";
183

19-
const shell = process.env.SHELL | "/bin/zsh";
20-
$.shell = shell;
21-
$.verbose = true;
22-
23-
const {
24-
containerRegistryURL,
25-
containerRegistryUser,
26-
containerRegistryToken,
27-
namespace,
28-
regionKey,
29-
adbCompartmentId,
30-
adbName,
31-
adbPassword,
32-
} = await readEnvJson();
4+
$.verbose = true;
5+
6+
const { containerRegistryURL, containerRegistryUser, containerRegistryToken } =
7+
await readEnvJson();
338

349
// const region = env.REGION || await setVariableFromEnvOrPrompt("REGION", "Enter the region: ", getRegions);
3510

3611
const createContainerInstances = async (attributes) => {
37-
38-
const output = await $`oci container-instances container-instance create \
12+
const output = await $`oci container-instances container-instance create \
3913
--display-name "${attributes.displayName}" \
4014
--availability-domain "${attributes.ad_ocid}" \
4115
--compartment-id "${attributes.compartment_ocid}" \
@@ -45,62 +19,60 @@ const createContainerInstances = async (attributes) => {
4519
--containers ${JSON.stringify(containersArgs)} \
4620
--image-pull-secrets ${JSON.stringify(secretsArgs)} \
4721
--vnics ${JSON.stringify(vnicsArgs)} --debug`;
48-
return output;
49-
};
22+
return output;
23+
};
5024

51-
const attributes = {
52-
"displayName": "autoDeploTest",
53-
"compartment_ocid": "xxx",
54-
"ad_ocid": "xxx",
55-
"subnet_ocid": "xxx",
56-
"containerRegistryURL": containerRegistryURL,
57-
"containerRegistryUser": containerRegistryUser,
58-
"region": "xxx",
59-
"servercontainerURL": "xxx.ocir.io/xxx/save-the-wildlife/server:0.0.8",
60-
"webcontainerURL": "xxx.ocir.io/xxx/save-the-wildlife/web:0.0.8",
61-
};
25+
const attributes = {
26+
displayName: "autoDeploTest",
27+
compartment_ocid: "xxx",
28+
ad_ocid: "xxx",
29+
subnet_ocid: "xxx",
30+
containerRegistryURL: containerRegistryURL,
31+
containerRegistryUser: containerRegistryUser,
32+
region: "xxx",
33+
servercontainerURL: "xxx.ocir.io/xxx/save-the-wildlife/server:0.0.8",
34+
webcontainerURL: "xxx.ocir.io/xxx/save-the-wildlife/web:0.0.8",
35+
};
6236

63-
const vnicsArgs = [
64-
{ displayName: "multiplayer vcn", subnetId: `${attributes.subnet_ocid}` },
65-
];
37+
const vnicsArgs = [
38+
{ displayName: "multiplayer vcn", subnetId: `${attributes.subnet_ocid}` },
39+
];
6640

67-
const secretsArgs = [
68-
{
69-
password:btoa(containerRegistryToken),
70-
registryEndpoint:containerRegistryURL,
71-
secretType:"BASIC",
72-
username:btoa(containerRegistryUser)
73-
}
74-
];
41+
const secretsArgs = [
42+
{
43+
password: btoa(containerRegistryToken),
44+
registryEndpoint: containerRegistryURL,
45+
secretType: "BASIC",
46+
username: btoa(containerRegistryUser),
47+
},
48+
];
7549

7650
const containersArgs = [
77-
{
78-
displayName: "ServerContainer2",
79-
imageUrl: `${attributes.servercontainerURL}`,
80-
resourceConfig: {
81-
memoryLimitInGBs: 8,
82-
vcpusLimit: 1.5,
83-
},
51+
{
52+
displayName: "ServerContainer2",
53+
imageUrl: `${attributes.servercontainerURL}`,
54+
resourceConfig: {
55+
memoryLimitInGBs: 8,
56+
vcpusLimit: 1.5,
8457
},
85-
{
86-
displayName: "WebContainer2",
87-
imageUrl: `${attributes.webcontainerURL}`,
88-
resourceConfig: {
89-
memoryLimitInGBs: 8,
90-
vcpusLimit: 1.5,
91-
},
58+
},
59+
{
60+
displayName: "WebContainer2",
61+
imageUrl: `${attributes.webcontainerURL}`,
62+
resourceConfig: {
63+
memoryLimitInGBs: 8,
64+
vcpusLimit: 1.5,
9265
},
93-
];
66+
},
67+
];
68+
69+
const output = await createContainerInstances(attributes);
9470

95-
96-
const output = await createContainerInstances(attributes);
97-
98-
console.log(output);
99-
71+
console.log(output);
10072

101-
const display_name = "test";
102-
const compartment_ocid = "xx";
103-
const ad_ocid = "xxx";
104-
// const subnet_ocid = await setVariableFromEnvOrPrompt("SUBNET_OCID", "Enter the OCID of the subnet: ");
73+
const display_name = "test";
74+
const compartment_ocid = "xx";
75+
const ad_ocid = "xxx";
76+
// const subnet_ocid = await setVariableFromEnvOrPrompt("SUBNET_OCID", "Enter the OCID of the subnet: ");
10577

10678
createContainerInstances();

scripts/deploy.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { exitWithError, getVersion, readEnvJson } from "./lib/utils.mjs";
44
import { getVersionGradle } from "./lib/gradle.mjs";
55
import { downloadAdbWallet, listAdbDatabases } from "./lib/oci.mjs";
66

7-
const shell = process.env.SHELL | "/bin/zsh";
8-
$.shell = shell;
97
$.verbose = false;
108

119
const {

scripts/kustom.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import { getNpmVersion } from "./lib/npm.mjs";
44
import { getNamespace } from "./lib/oci.mjs";
55
import { exitWithError } from "./lib/utils.mjs";
66

7-
const shell = process.env.SHELL | "/bin/zsh";
8-
$.shell = shell;
97
$.verbose = false;
108

119
const { _ } = argv;

scripts/release.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import {
88
getVersionGradle,
99
} from "./lib/gradle.mjs";
1010

11-
const shell = process.env.SHELL | "/bin/zsh";
12-
$.shell = shell;
1311
$.verbose = false;
1412

1513
let properties = await readEnvJson();

scripts/setenv.mjs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ import {
2323
} from "./lib/container.mjs";
2424
import { getVersionGradle } from "./lib/gradle.mjs";
2525

26-
const shell = process.env.SHELL | "/bin/zsh";
27-
$.shell = shell;
2826
$.verbose = false;
2927

3028
const ce = await whichContainerEngine();
@@ -141,8 +139,10 @@ async function adbDetails() {
141139
"Autonomous Database password"
142140
);
143141

144-
const adbDisplayName = await listAdbDatabasesbyname(adbName, adbCompartmentId);
145-
142+
const adbDisplayName = await listAdbDatabasesbyname(
143+
adbName,
144+
adbCompartmentId
145+
);
146146

147147
properties = {
148148
...properties,
@@ -152,8 +152,7 @@ async function adbDetails() {
152152
adbPassword,
153153
adbDisplayName,
154154
};
155-
// console.log("Properties:", properties);
156-
155+
// console.log("Properties:", properties);
157156
}
158157

159158
async function printRegionNames(regions) {

scripts/start_coherence.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import { exitWithError } from "./lib/utils.mjs";
44
import { whichContainerEngine } from "./lib/container.mjs";
55

6-
const shell = process.env.SHELL | "/bin/zsh";
7-
$.shell = shell;
86
$.verbose = false;
97

108
const containerName = "coherence_multiplayer";

scripts/start_redis.mjs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import { exitWithError } from "./lib/utils.mjs";
44
import { whichContainerEngine } from "./lib/container.mjs";
55

6-
const shell = process.env.SHELL | "/bin/zsh";
7-
$.shell = shell;
86
$.verbose = false;
97

108
const containerName = "redis_multiplayer";

0 commit comments

Comments
 (0)