Add support for service variables to Railway integration, add docs for Railway

This commit is contained in:
Tuan Dang
2023-04-09 15:00:40 +03:00
parent f6e23127ac
commit 710364e3a1
35 changed files with 307 additions and 16 deletions
+2 -4
View File
@@ -355,10 +355,7 @@ const getAppsRailway = async ({ accessToken }: { accessToken: string }) => {
}
`;
const variables = {
// userId: '<USER_ID_GOES_HERE>', // Replace with the desired user ID or remove if not needed
// teamId: '<TEAM_ID_GOES_HERE>', // Replace with the desired team ID or remove if not needed
};
const variables = {};
const { data: { data: { projects: { edges }}} } = await request.post(INTEGRATION_RAILWAY_API_URL, {
query,
@@ -367,6 +364,7 @@ const getAppsRailway = async ({ accessToken }: { accessToken: string }) => {
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Accept-Encoding': 'application/json'
},
});
+3
View File
@@ -1179,6 +1179,7 @@ const syncSecretsRailway = async ({
accessToken: string;
}) => {
try {
const query = `
mutation UpsertVariables($input: VariableCollectionUpsertInput!) {
variableCollectionUpsert(input: $input)
@@ -1188,6 +1189,7 @@ const syncSecretsRailway = async ({
const input = {
projectId: integration.appId,
environmentId: integration.targetEnvironmentId,
...(integration.targetServiceId ? { serviceId: integration.targetServiceId } : {}),
replace: true,
variables: secrets
};
@@ -1201,6 +1203,7 @@ const syncSecretsRailway = async ({
headers: {
'Authorization': `Bearer ${accessToken}`,
'Content-Type': 'application/json',
'Accept-Encoding': 'application/json'
},
});