From 97a09ce1b31656b39e2e96c3fd07e828983aa41d Mon Sep 17 00:00:00 2001 From: Christopher Hase Date: Wed, 23 Apr 2025 15:36:53 +0200 Subject: [PATCH] backstage update tutorial --- .../backstage-update-tutorial/_index.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 docs/technical-documentation/product/components/Backstage/backstage-update-tutorial/_index.md diff --git a/docs/technical-documentation/product/components/Backstage/backstage-update-tutorial/_index.md b/docs/technical-documentation/product/components/Backstage/backstage-update-tutorial/_index.md new file mode 100644 index 0000000..59221a6 --- /dev/null +++ b/docs/technical-documentation/product/components/Backstage/backstage-update-tutorial/_index.md @@ -0,0 +1,101 @@ +--- +title: Backstage Update Tutorial +--- + +This document provides a detailed guide on the process to update Backstage locally on your machine from version 1.36.1 to 1.38.1. +Later updates can be performed accordingly. (The fixing of deprecated imports should not be necessary, again.) + +## Table of Contents + +1. [Prerequisites](#prerequisites) +2. [Setting Up Backstage](#setting-up-backstage) +3. [Updating Backstage](#updating-backstage) +4. [Fix deprecated import](#fix-deprecated-import) +5. [Running Backstage](#running-backstage) + +## Prerequisites + +Before you start, make sure you have the following installed on your machine: + +1. **Node.js**: Backstage requires Node.js. You can download it from the [Node.js website](https://nodejs.org/). It is recommended to use the LTS version. +2. **Yarn**: Backstage uses Yarn as its package manager. +3. **Git** +4. **Docker** + +## Setting Up Backstage + +To download the latest version of our Backstage-EDP app, use git to clone it from the OSC repository at https://forgejo.edf-bootstrap.cx.fg1.ffm.osc.live/DevFW-CICD/backstage-edp.git. + +Make sure yarn ist installed locally. In the project path run: + ```bash + yarn install + ``` + +## Updating Backstage + +In the project path run: + ```bash + yarn backstage-cli versions:bump + ``` + +This will update all relevant components to the newest versions. + +## Fix deprecated import + +In a text editor of your choice open the file '/backstage-edp/packages/backend/src/plugins/proxy.ts' and implement the two following changes. + +### Update import + +First, replace the deprecated import + + ```typescript + import { createRouter } from '@backstage/plugin-proxy-backend'; + ``` + +with the following import: + + ```typescript + import { createRouter } from '@roadiehq/backstage-plugin-argo-cd-backend'; + ``` + +### Update method call createRouter() + +Secondly replace the deprecated call of method createRouter() + + ```typescript + return await createRouter({ + logger: env.logger, + config: env.config, + discovery: env.discovery + }); + ``` + +with the following call of method createRouter(): + + ```typescript + return await createRouter({ + logger: env.logger, + config: env.config + }); + ``` + +## Running backstage + +After completing all updates and fixes, run backstage to verify everything was updated correctly. + +In the project path run: + ```bash + docker build --no-cache -t backstage-cnoe . + ``` + +Start the backend from a console: + ```bash + yarn run start-backend + ``` + +Start the frontend from a console: + ```bash + yarn run start + ``` + +The backstage frontend should now open in your browser. \ No newline at end of file