@ibm-cloud/cd-tools 1.5.2 → 1.5.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.
- package/create-s2s-script.js +6 -6
- package/package.json +1 -1
package/create-s2s-script.js
CHANGED
|
@@ -68,7 +68,7 @@ async function getBearer() {
|
|
|
68
68
|
}
|
|
69
69
|
*/
|
|
70
70
|
|
|
71
|
-
async function createS2sAuthPolicy(item) {
|
|
71
|
+
async function createS2sAuthPolicy(bearer, item) {
|
|
72
72
|
const url = `${CLOUD_PLATFORM}/devops/setup/api/v2/s2s_authorization?${new URLSearchParams({
|
|
73
73
|
toolchainId: TC_ID,
|
|
74
74
|
serviceId: item['serviceId'],
|
|
@@ -110,10 +110,10 @@ async function createS2sAuthPolicy(item) {
|
|
|
110
110
|
|
|
111
111
|
// main
|
|
112
112
|
|
|
113
|
-
|
|
113
|
+
getBearer().then((bearer) => {
|
|
114
|
+
const inputArr = JSON.parse(fs.readFileSync(resolve(INPUT_PATH)));
|
|
114
115
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
await createS2sAuthPolicy(item);
|
|
116
|
+
inputArr.forEach(async (item) => {
|
|
117
|
+
await createS2sAuthPolicy(bearer, item);
|
|
118
|
+
});
|
|
119
119
|
});
|