Skip to content
This repository has been archived by the owner on Sep 10, 2023. It is now read-only.

Commit

Permalink
Merge pull request #69 from bradmccoydev/feat/add-argo-cd-plugin-back…
Browse files Browse the repository at this point in the history
…stage-2

feat: add backstage config for argo
  • Loading branch information
bradmccoydev authored Nov 29, 2022
2 parents 1baee5c + 47207c3 commit 5bf376e
Show file tree
Hide file tree
Showing 12 changed files with 160 additions and 168 deletions.
16 changes: 7 additions & 9 deletions app-config.production.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,14 @@ kubernetes:
skipTLSVerify: true
skipMetricsLookup: true

proxy:
'/argocd/api':
target: ${ARGOCD_BASE_URL}/api/v1/
changeOrigin: true
secure: false
headers:
Cookie:
$env: ${ARGOCD_AUTH_TOKEN}
argocd:
baseUrl: ${ARGOCD_BASE_URL}
username: ${ARGOCD_USERNAME}
password: ${ARGOCD_PASSWORD}
appLocatorMethods:
- type: 'config'
instances:
- name: production
url: ${ARGOCD_BASE_URL}

# plugin:
# auth:
Expand Down
16 changes: 7 additions & 9 deletions app-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,14 @@ integrations:
# apiBaseUrl: https://ghe.example.net/api/v3
# token: ${GHE_TOKEN}

proxy:
'/argocd/api':
target: ${ARGOCD_BASE_URL}/api/v1/
changeOrigin: true
secure: false
headers:
Cookie:
$env: ${ARGOCD_AUTH_TOKEN}
argocd:
baseUrl: ${ARGOCD_BASE_URL}
username: ${ARGOCD_USERNAME}
password: ${ARGOCD_PASSWORD}
appLocatorMethods:
- type: 'config'
instances:
- name: production
url: ${ARGOCD_BASE_URL}

# Reference documentation http://backstage.io/docs/features/techdocs/configuration
# Note: After experimenting with basic setup, use CI/CD to generate docs
Expand Down
9 changes: 6 additions & 3 deletions catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
spec:
type: service
owner: user:guest
lifecycle: experimental
lifecycle: production
---
apiVersion: backstage.io/v1alpha1
kind: Component
Expand All @@ -18,17 +18,20 @@ metadata:
spec:
type: service
owner: user:guest
lifecycle: experimental
lifecycle: production
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: ingress-nginx
description: Ortelius Cluster Ingress
annotations:
'backstage.io/kubernetes-id': ingress-nginx
'argocd/app-name': ingress-nginx
tags:
- platform
spec:
type: service
owner: user:guest
lifecycle: experimental
lifecycle: production
---
4 changes: 2 additions & 2 deletions chart/backstage/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: A Helm chart for the Ortelius Backstage Instance

type: application

version: 0.0.15
appVersion: "0.0.15"
version: 0.0.16
appVersion: "0.0.16"

home: "https://ortelius.io"
icon: https://backstage.io/img/twitter-summary.png
Expand Down
10 changes: 10 additions & 0 deletions chart/backstage/templates/backend/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,16 @@ spec:
secretKeyRef:
name: backstage-secrets
key: ARGOCD_URL
- name: ARGOCD_USERNAME
valueFrom:
secretKeyRef:
name: backstage-secrets
key: ARGOCD_USERNAME
- name: ARGOCD_PASSWORD
valueFrom:
secretKeyRef:
name: backstage-secrets
key: ARGOCD_PASSWORD
- name: ARGOCD_AUTH_TOKEN
valueFrom:
secretKeyRef:
Expand Down
1 change: 0 additions & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
"@backstage/theme": "^0.2.16",
"@material-ui/core": "^4.12.2",
"@material-ui/icons": "^4.9.1",
"@roadiehq/backstage-plugin-argo-cd": "^2.2.1",
"history": "^5.0.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand Down
13 changes: 0 additions & 13 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,6 @@ import {
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';
import { EntityKubernetesContent } from '@backstage/plugin-kubernetes';
import {
EntityArgoCDHistoryCard,
isArgocdAvailable,
} from '@roadiehq/backstage-plugin-argo-cd';


const techdocsContent = (
<EntityTechdocsContent>
Expand Down Expand Up @@ -133,14 +128,6 @@ const overviewContent = (
<Grid item md={8} xs={12}>
<EntityHasSubcomponentsCard variant="gridItem" />
</Grid>

<EntitySwitch>
<EntitySwitch.Case if={e => Boolean(isArgocdAvailable(e))}>
<Grid item sm={6}>
<EntityArgoCDHistoryCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
</Grid>
);

Expand Down
1 change: 0 additions & 1 deletion packages/app/src/plugins.ts

This file was deleted.

1 change: 1 addition & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@backstage/plugin-search-backend-module-pg": "^0.4.2",
"@backstage/plugin-search-backend-node": "^1.0.4",
"@backstage/plugin-techdocs-backend": "^1.4.1",
"@roadiehq/backstage-plugin-argo-cd-backend": "^2.6.1",
"app": "link:../app",
"better-sqlite3": "^7.5.0",
"dockerode": "^3.3.1",
Expand Down
3 changes: 3 additions & 0 deletions packages/backend/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { PluginEnvironment } from './types';
import { ServerPermissionClient } from '@backstage/plugin-permission-node';
import { DefaultIdentityClient } from '@backstage/plugin-auth-node';
import kubernetes from './plugins/kubernetes';
import argocd from './plugins/argocd';

function makeCreateEnv(config: Config) {
const root = getRootLogger();
Expand Down Expand Up @@ -79,6 +80,7 @@ async function main() {
const searchEnv = useHotMemoize(module, () => createEnv('search'));
const appEnv = useHotMemoize(module, () => createEnv('app'));
const kubernetesEnv = useHotMemoize(module, () => createEnv('kubernetes'));
const argocdEnv = useHotMemoize(module, () => createEnv('argocd'));

const apiRouter = Router();
apiRouter.use('/catalog', await catalog(catalogEnv));
Expand All @@ -88,6 +90,7 @@ async function main() {
apiRouter.use('/proxy', await proxy(proxyEnv));
apiRouter.use('/search', await search(searchEnv));
apiRouter.use('/kubernetes', await kubernetes(kubernetesEnv));
apiRouter.use('/argocd', await argocd(argocdEnv));

// Add backends ABOVE this line; this 404 handler is the catch-all fallback
apiRouter.use(notFoundHandler());
Expand Down
9 changes: 9 additions & 0 deletions packages/backend/src/plugins/argocd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { createRouter } from '@roadiehq/backstage-plugin-argo-cd-backend';
import { PluginEnvironment } from '../types';

export default async function createPlugin({
logger,
config,
}: PluginEnvironment) {
return await createRouter({ logger, config });
}
Loading

0 comments on commit 5bf376e

Please sign in to comment.