Skip to content

Commit

Permalink
chore: refactor catalog
Browse files Browse the repository at this point in the history
Signed-off-by: OurchitectureIO <[email protected]>
  • Loading branch information
ourchitectureio committed Mar 24, 2024
1 parent a590eac commit 3d0d8d3
Show file tree
Hide file tree
Showing 32 changed files with 17,286 additions and 76 deletions.
8 changes: 4 additions & 4 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ compressionLevel: mixed

enableGlobalCache: true

# Do not track.
enableTelemetry: false

# Only hoist dependencies at the workspace level.
nmHoistingLimits: workspaces

# Use classic npm link behavior.
nodeLinker: node-modules

# Path to the pinned version of yarn.
# Uncomment this when working without the Nexus server running.
# npmAlwaysAuth: false
# npmRegistryServer: "https://registry.yarnpkg.com/"

yarnPath: .yarn/releases/yarn-4.1.1.cjs
22 changes: 18 additions & 4 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
.DEFAULT_GOAL:=all

all: install-dependencies install check
all: install check

.PHONY: start-ournexus
start-ournexus:
@echo "Starting ournexus..."
@yarn workspaces focus @ourchitecture/ournexus
@cd ./src/systems/dev/nexus && make start
@echo "Successfully started ournexus."

.PHONY: install-dependencies
install-dependencies:
install-dependencies: start-ournexus
@echo "Installing monorepo dependencies..."
@npm_config_loglevel=error yarn install --immutable
@yarn workspaces foreach --all --interlaced run install --immutable
Expand All @@ -16,7 +23,7 @@ install-dependencies:
init: install-dependencies

.PHONY: install
install:
install: install-dependencies
@echo "Installing independent projects..."
@cd ./src/systems/dev/backstage/ourstage && make $@
@echo "Successfully installed independent projects."
Expand Down Expand Up @@ -75,6 +82,7 @@ format:
.PHONY: up
up:
@echo "Starting the system..."
@cd ./src/systems/dev/nexus && make $@
@cd ./src/systems/dev/backstage/ourstage && make $@
@echo "Successfully started the system."
.PHONY: start
Expand All @@ -90,12 +98,16 @@ run: up
down:
@echo "Stopping the system..."
@cd ./src/systems/dev/backstage/ourstage && make $@
@echo "Stopping started the system."
@cd ./src/systems/dev/nexus && make $@
@echo "Successfully stopped the system."
.PHONY: stop
stop: down
.PHONY: shutdown
shutdown: down

.PHONY: restart
restart: down up

.PHONY: upgrade
upgrade:
@echo "Upgrading monorepo..."
Expand All @@ -115,6 +127,7 @@ clean:

@echo "Cleaning independent projects..."
@cd ./src/systems/dev/backstage/ourstage && make $@
@cd ./src/systems/dev/nexus && make $@
@echo "Successfully cleaned independent projects."

.PHONY: reset
Expand All @@ -129,6 +142,7 @@ reset: clean

@echo "Resetting independent projects..."
@cd ./src/systems/dev/backstage/ourstage && make $@
@cd ./src/systems/dev/nexus && make $@
@echo "Successfully reset independent projects."

################################################################################
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
},
"workspaces": [
"src/designs/**/*",
"src/systems/dev/nexus",
"src/systems/leadof/**/*"
]
}
1 change: 1 addition & 0 deletions src/systems/dev/backstage/catalog/catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ metadata:
spec:
targets:
- ./groups/catalog-info.yaml
- ./systems/catalog-info.yaml
- ./users/catalog-info.yaml
9 changes: 9 additions & 0 deletions src/systems/dev/backstage/catalog/containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM httpd:2.4.58-alpine3.19@sha256:92535cf7f151901ba91b04186292c3bd5bf82aa6ffa6eb7bc405fefbffedd480

# Copy the files.
COPY . /usr/local/apache2/htdocs/

# Move the configuration file.
# Remove the default "index.html" file.
RUN mv /usr/local/apache2/htdocs/httpd.conf /usr/local/apache2/conf/httpd.conf \
&& rm /usr/local/apache2/htdocs/index.html
2 changes: 1 addition & 1 deletion src/systems/dev/backstage/catalog/groups/catalog-info.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ apiVersion: backstage.io/v1alpha1
kind: Group
metadata:
description: The Ourchitecture team
name: ourchitecture
links:
- title: Ourchitecture.io
url: http://ourchitecture.io
- icon: github
title: Ourchitecture @GitHub
url: http://github.com/ourchitectureio
name: ourchitecture
spec:
children: []
profile:
Expand Down
27 changes: 27 additions & 0 deletions src/systems/dev/backstage/catalog/httpd.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
ServerRoot "/usr/local/apache2"
Listen 3005
LoadModule mpm_event_module modules/mod_mpm_event.so
LoadModule authn_file_module modules/mod_authn_file.so
LoadModule authz_core_module modules/mod_authz_core.so
LoadModule dir_module modules/mod_dir.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
LoadModule unixd_module modules/mod_unixd.so

ServerAdmin [email protected]
ServerName localhost

DocumentRoot "/usr/local/apache2/htdocs"
<Directory "/usr/local/apache2/htdocs">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>

ErrorLog "logs/error_log"
LogLevel warn

<IfModule log_config_module>
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
CustomLog "logs/access_log" combined
</IfModule>
61 changes: 61 additions & 0 deletions src/systems/dev/backstage/catalog/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.PHONY: install
install:
@echo "Installing ourstage catalog..."
@docker build \
--tag localhost/ourstage/catalog:latest \
--file ./containerfile \
./
@echo "Installing started ourstage catalog."

.PHONY: debug
debug: install
@echo "Debugging ourstage catalog..."
@docker run \
--name debug-ourstage-catalog \
--rm \
--interactive \
--tty \
--entrypoint /bin/sh \
--user root \
--network host \
localhost/ourstage/catalog:latest
@echo "Successfully debugged ourstage catalog."

.PHONY: up
up: install
@echo "Starting ourstage catalog..."
@docker run \
--detach \
--name ourstage-catalog \
--network host \
--user root \
localhost/ourstage/catalog:latest
@echo "Ourstage catalog is available at http://localhost:3005."
@echo "Successfully started ourstage catalog."
.PHONY: start
start: up
.PHONY: startup
startup: up
.PHONY: serve
serve: up
.PHONY: run
run: up

.PHONY: logs
logs:
@echo "Getting ourstage catalog logs..."
@docker logs ourstage-catalog
@echo "Successfully got ourstage catalog logs."

.PHONY: down
down:
@echo "Stopping ourstage catalog..."
@docker rm -f ourstage-catalog || true
@echo "Successfully stopped ourstage catalog."
.PHONY: stop
stop: down
.PHONY: shutdown
shutdown: down

.PHONY: restart
restart: down up
Loading

0 comments on commit 3d0d8d3

Please sign in to comment.