Skip to content

Commit

Permalink
fix ui rock
Browse files Browse the repository at this point in the history
  • Loading branch information
kelkawi-a committed Sep 6, 2024
1 parent c1444e6 commit 803ebc0
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
38 changes: 32 additions & 6 deletions airbyte_ui_rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ services:
override: replace
summary: "airbyte-webapp service"
startup: disabled
command: "cd app && pnpm start"
command: "/usr/bin/pnpm -C airbyte-webapp start"
environment:
PORT: "8080"

Expand All @@ -33,8 +33,6 @@ parts:
source-type: git
source-commit: 34d28a9a8d3092a7e22eec6562946e6ef6ca36ab # v0.60.0
build-packages:
- gradle
- openjdk-21-jdk
- jq
- curl
- nodejs
Expand All @@ -44,20 +42,48 @@ parts:
override-build: |
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
npm install -g pnpm
npm install -g pnpm --force
cd airbyte-webapp
nvm install
corepack enable && corepack install
pnpm install
pnpm run build
# Copy current directory files to app
cp -r build ${CRAFT_PART_INSTALL}/airbyte-webapp
mkdir -p ${CRAFT_PART_INSTALL}/bin
# Copy build directory files to app
cp -r . ${CRAFT_PART_INSTALL}/airbyte-webapp
cp -r ../airbyte-connector-builder-resources/ ${CRAFT_PART_INSTALL}/airbyte-connector-builder-resources
cp -r /root/.nvm/versions/node/v20.11.0/bin/node ${CRAFT_PART_INSTALL}/node
cp -r /root/.nvm/versions/node/v20.11.0/bin/pnpm ${CRAFT_PART_INSTALL}/pnpm
# Adjust PATH so the copied node version takes precedence
# export PATH=${CRAFT_PART_INSTALL}/bin:$PATH
organize:
node: bin/node
pnpm: bin/pnpm
# /root/.nvm/versions/node/v20.11.0/bin/node: bin/node
# /root/.nvm/versions/node/v20.11.0/bin/pnpm: bin/pnpm
stage:
- airbyte-webapp
- airbyte-connector-builder-resources
- bin/node
- bin/pnpm
permissions:
- path: airbyte-webapp
owner: 584792
group: 584792
mode: "755"
- path: airbyte-connector-builder-resources
owner: 584792
group: 584792
mode: "755"
- path: bin/node
owner: 584792
group: 584792
mode: "755"
- path: bin/pnpm
owner: 584792
group: 584792
mode: "755"
2 changes: 1 addition & 1 deletion src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ def _update(self, event):
"services": {
self.name: {
"summary": self.name,
"command": "pnpm -C app start",
"command": "/usr/bin/pnpm -C airbyte-webapp start",
"startup": "enabled",
"override": "replace",
# Including config values here so that a change in the
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def test_ready(self):
"services": {
APP_NAME: {
"summary": APP_NAME,
"command": "cd app/ && pnpm start",
"command": "/usr/bin/pnpm -C airbyte-webapp start",
"startup": "enabled",
"override": "replace",
"environment": {
Expand Down

0 comments on commit 803ebc0

Please sign in to comment.