Add Aashish to README

This commit is contained in:
Tuan Dang
2023-02-13 18:55:09 +07:00
parent 9868476965
commit 445fa35ab5
5 changed files with 34 additions and 25 deletions
+2 -3
View File
File diff suppressed because one or more lines are too long
+12 -9
View File
@@ -86,7 +86,7 @@ const getApps = async ({
}); });
break; break;
case INTEGRATION_CIRCLECI: case INTEGRATION_CIRCLECI:
apps = await getAppsCircleci({ apps = await getAppsCircleCI({
accessToken, accessToken,
}); });
break; break;
@@ -333,11 +333,17 @@ const getAppsFlyio = async ({ accessToken }: { accessToken: string }) => {
return apps; return apps;
}; };
const getAppsCircleci = async ({ accessToken }: { accessToken: string }) => { /**
// in place of accessToken we have to send Circle-Token i.e. Personal API token from CircleCi * Return list of projects for CircleCI integration
* @param {Object} obj
* @param {String} obj.accessToken - access token for CircleCI API
* @returns {Object[]} apps -
* @returns {String} apps.name - name of CircleCI apps
*/
const getAppsCircleCI = async ({ accessToken }: { accessToken: string }) => {
let apps: any; let apps: any;
try { try {
let res = ( const res = (
await axios.get( await axios.get(
`${INTEGRATION_CIRCLECI_API_URL}/v1.1/projects`, `${INTEGRATION_CIRCLECI_API_URL}/v1.1/projects`,
{ {
@@ -353,15 +359,12 @@ const getAppsCircleci = async ({ accessToken }: { accessToken: string }) => {
return { return {
name: a?.reponame name: a?.reponame
} }
}) });
} catch (err) { } catch (err) {
console.log(err);
Sentry.setUser(null); Sentry.setUser(null);
Sentry.captureException(err); Sentry.captureException(err);
throw new Error("Failed to get Render services"); throw new Error("Failed to get CircleCI projects");
} }
console.log("hello apps");
return apps; return apps;
}; };
+10 -3
View File
@@ -124,7 +124,7 @@ const syncSecrets = async ({
}); });
break; break;
case INTEGRATION_CIRCLECI: case INTEGRATION_CIRCLECI:
await syncSecretsCircleci({ await syncSecretsCircleCI({
integration, integration,
secrets, secrets,
accessToken, accessToken,
@@ -1185,7 +1185,14 @@ const syncSecretsFlyio = async ({
} }
}; };
const syncSecretsCircleci = async ({ /**
* Sync/push [secrets] to CircleCI project
* @param {Object} obj
* @param {IIntegration} obj.integration - integration details
* @param {Object} obj.secrets - secrets to push to integration (object where keys are secret keys and values are secret values)
* @param {String} obj.accessToken - access token for CircleCI integration
*/
const syncSecretsCircleCI = async ({
integration, integration,
secrets, secrets,
accessToken, accessToken,
@@ -1206,7 +1213,7 @@ const syncSecretsCircleci = async ({
const { slug } = circleciOrganizationDetail; const { slug } = circleciOrganizationDetail;
// inject secrets to CircleCI (one by one) // sync secrets to CircleCI
Object.keys(secrets).forEach( Object.keys(secrets).forEach(
async (key) => async (key) =>
await axios.post( await axios.post(
+9 -9
View File
@@ -125,6 +125,15 @@ const INTEGRATION_OPTIONS = [
clientId: '', clientId: '',
docsLink: '' docsLink: ''
}, },
{
name: 'Circle CI',
slug: 'circleci',
image: 'Circle CI.png',
isAvailable: true,
type: 'pat',
clientId: '',
docsLink: ''
},
{ {
name: 'Azure Key Vault', name: 'Azure Key Vault',
slug: 'azure-key-vault', slug: 'azure-key-vault',
@@ -152,15 +161,6 @@ const INTEGRATION_OPTIONS = [
type: '', type: '',
clientId: '', clientId: '',
docsLink: '' docsLink: ''
},
{
name: 'Circle CI',
slug: 'circleci',
image: 'Circle CI.png',
isAvailable: true,
type: 'pat',
clientId: '',
docsLink: ''
} }
] ]
@@ -54,7 +54,7 @@ export default function CircleCICreateIntegrationPage() {
isError={apiKeyErrorText !== '' ?? false} isError={apiKeyErrorText !== '' ?? false}
> >
<Input <Input
placeholder='rnd_xxx' placeholder=''
value={apiKey} value={apiKey}
onChange={(e) => setApiKey(e.target.value)} onChange={(e) => setApiKey(e.target.value)}
/> />