First run the following command to download the dependencies.
yarn install
./tasks db-run
Open the environment variable file.
vi .env/dev
And add the following content.
Note: For the Github credentials follow the backstage doc for authentication and github integration.
set -o allexport
POSTGRES_HOST=localhost
POSTGRES_PORT=5432
POSTGRES_USER=backstage
POSTGRES_PASSWORD=backstage
GITHUB_TOKEN=ghp_xxxx
GITHUB_CLIENT_ID=xxx
GITHUB_CLIENT_SECRET=xxx
set +o allexport
./tasks dev
For building a docker image run the following command.
./tasks build
A docker compose file is created for deploying the app more conveniently. It starts a postgres and backstage.
First, open the environment variable file.
vi .env/docker
And add the following content.
Note: For the Github credentials follow the backstage doc for authentication and github integration.
set -o allexport
POSTGRES_PASSWORD=backstage
GITHUB_TOKEN=ghp_xxxx # Classic personal token with repo and workflow permissions
GITHUB_CLIENT_ID=xxx
GITHUB_CLIENT_SECRET=xxx
DOCKER_IMAGE_TAG=$(git rev-parse --short HEAD)
set +o allexport
Create the network by running the following command.
docker network create backstage
Now it is time to run the image using docker compose using command below.
./tasks docker-up
After testing the docker can be stopped by following command.
./tasks docker-down