Skip to content

Commit cf9d95d

Browse files
authored
feat: add environment-specific galaxy urls (#239) (#241)
1 parent 675fbf6 commit cf9d95d

File tree

14 files changed

+54
-13
lines changed

14 files changed

+54
-13
lines changed

.github/workflows/dev-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Build Next.js Site
2828
env:
2929
NEXT_PUBLIC_BASE_PATH: ""
30-
run: npm run build:local
30+
run: npm run build:dev
3131

3232
- name: Configure AWS Credentials
3333
uses: aws-actions/configure-aws-credentials@v4

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Build Next.js Site
2929
env:
3030
NEXT_PUBLIC_BASE_PATH: ""
31-
run: npm run build:local
31+
run: npm run build:prod
3232

3333
- name: Configure AWS Credentials
3434
uses: aws-actions/configure-aws-credentials@v3

app/config/config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { setConfig } from "@databiosphere/findable-ui/lib/config/config";
22
import { SiteConfig } from "@databiosphere/findable-ui/lib/config/entities";
3+
import brcAnalyticsDev from "../../site-config/brc-analytics/dev/config";
34
import brcAnalyticsLocal from "../../site-config/brc-analytics/local/config";
5+
import brcAnalyticsProd from "../../site-config/brc-analytics/prod/config";
46

57
const CONFIGS: { [k: string]: SiteConfig } = {
8+
"brc-analytics-dev": brcAnalyticsDev,
69
"brc-analytics-local": brcAnalyticsLocal,
10+
"brc-analytics-prod": brcAnalyticsProd,
711
};
812

913
let appConfig: SiteConfig | null = null;

app/utils/galaxy-api.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import ky from "ky";
22
import { WORKFLOW_ID } from "../apis/catalog/brc-analytics-catalog/common/entities";
3+
import { GALAXY_ENVIRONMENT } from "site-config/common/galaxy";
34

45
interface WorkflowLandingsBody {
56
public: true;
@@ -16,11 +17,9 @@ interface WorkflowLanding {
1617
uuid: string;
1718
}
1819

19-
const WORKFLOW_LANDINGS_API_URL =
20-
"https://test.galaxyproject.org/api/workflow_landings";
21-
22-
const WORKFLOW_LANDING_URL_PREFIX =
23-
"https://test.galaxyproject.org/workflow_landings/";
20+
const { galaxyInstanceUrl } = GALAXY_ENVIRONMENT;
21+
const workflowLandingsApiUrl = `${galaxyInstanceUrl}api/workflow_landings`;
22+
const workflowLandingUrl = `${galaxyInstanceUrl}workflow_landings`;
2423

2524
/**
2625
* Get the URL of the workflow landing page for the given genome workflow.
@@ -44,14 +43,14 @@ export async function getWorkflowLandingUrl(
4443
workflow_id: workflowId,
4544
workflow_target_type: "trs_url",
4645
};
47-
const res = await ky.post<WorkflowLanding>(WORKFLOW_LANDINGS_API_URL, {
46+
const res = await ky.post<WorkflowLanding>(workflowLandingsApiUrl, {
4847
json: body,
4948
retry: {
5049
methods: ["post"],
5150
},
5251
});
5352
const id = (await res.json()).uuid;
54-
return `${WORKFLOW_LANDING_URL_PREFIX}${encodeURIComponent(id)}?public=true`;
53+
return `${workflowLandingUrl}/${encodeURIComponent(id)}?public=true`;
5554
}
5655

5756
function buildFastaUrl(identifier: string): string {

cc-brc-analytics.dev.clevercanary.com-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ npm ci
1111
export NEXT_PUBLIC_BASE_PATH=""
1212

1313
# Build catalog
14-
npm run build:local
14+
npm run build:dev
1515

1616
export BUCKET=s3://tik-brc-analytics.dev/
1717
export SRCDIR=out/

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"scripts": {
66
"dev": "./scripts/dev.sh brc-analytics && ./scripts/set-version.sh dev && next dev",
77
"build:local": "./scripts/build.sh brc-analytics local && ./scripts/set-version.sh && next build",
8+
"build:dev": "./scripts/build.sh brc-analytics dev && ./scripts/set-version.sh && next build",
9+
"build:prod": "./scripts/build.sh brc-analytics prod && ./scripts/set-version.sh && next build",
810
"start": "npx serve out",
911
"lint": "next lint --dir .",
1012
"check-format": "prettier --check .",

psu-brc-analytics.org-build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ npm ci
1111
export NEXT_PUBLIC_BASE_PATH=""
1212

1313
# Build catalog
14-
npm run build:local
14+
npm run build:prod
1515

1616
export BUCKET=s3://izk-brc-analytics.org/
1717
export SRCDIR=out/

site-config/brc-analytics/dev/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NEXT_PUBLIC_SITE_CONFIG='brc-analytics-dev'
2+
NEXT_PUBLIC_GALAXY_ENV="TEST"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { SiteConfig } from "@databiosphere/findable-ui/lib/config/entities";
2+
import { makeConfig } from "../local/config";
3+
4+
const BROWSER_URL = "https://brc-analytics.dev.clevercanary.com";
5+
6+
const config: SiteConfig = makeConfig(BROWSER_URL);
7+
8+
export default config;

site-config/brc-analytics/local/.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
NEXT_PUBLIC_SITE_CONFIG='brc-analytics-local'
2+
NEXT_PUBLIC_GALAXY_ENV="TEST"

0 commit comments

Comments
 (0)