Skip to content

Commit

Permalink
Fix job for cleaning envs (#3958)
Browse files Browse the repository at this point in the history
  • Loading branch information
karola312 authored Jul 20, 2023
1 parent ce1854b commit 153ea5b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/cleanEnvironments.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ const fetch = require("node-fetch");

const program = new Command();

const pathToCloudAPI = "https://staging-cloud.saleor.io/platform/api/";

program
.name("cleanEnvironments")
.description("Clean environments")
Expand Down Expand Up @@ -31,7 +33,7 @@ async function getEnvironmentsForReleaseTesting(token) {

async function getEnvironments(token) {
const response = await fetch(
`https://staging-cloud.saleor.io/api/organizations/saleor/environments/`,
`${pathToCloudAPI}organizations/saleor/environments/`,
{
method: "GET",
headers: {
Expand All @@ -46,7 +48,7 @@ async function getEnvironments(token) {

async function cleanEnvironment(environment, snapshot, token) {
const response = await fetch(
`https://staging-cloud.saleor.io/api/organizations/saleor/environments/${environment.key}/restore/`,
`${pathToCloudAPI}organizations/saleor/environments/${environment.key}/restore/`,
{
method: "PUT",
body: JSON.stringify({ restore_from: snapshot }),
Expand Down Expand Up @@ -82,7 +84,7 @@ async function waitUntilTaskInProgress(taskId, environment) {

while (true) {
const response = await fetch(
`https://staging-cloud.saleor.io/api/service/task-status/${taskId}/`,
`${pathToCloudAPI}service/task-status/${taskId}/`,
{
method: "GET",
headers: {
Expand Down

0 comments on commit 153ea5b

Please sign in to comment.