diff --git a/airbyte_ui_rock/rockcraft.yaml b/airbyte_ui_rock/rockcraft.yaml index 6cadd37..9cdb1fa 100644 --- a/airbyte_ui_rock/rockcraft.yaml +++ b/airbyte_ui_rock/rockcraft.yaml @@ -16,7 +16,7 @@ services: override: replace summary: "airbyte-webapp service" startup: disabled - command: "cd app && pnpm start" + command: "/bin/pnpm -C airbyte-webapp start" environment: PORT: "8080" @@ -33,8 +33,6 @@ parts: source-type: git source-commit: 34d28a9a8d3092a7e22eec6562946e6ef6ca36ab # v0.60.0 build-packages: - - gradle - - openjdk-21-jdk - jq - curl - nodejs @@ -44,7 +42,7 @@ 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 @@ -52,12 +50,40 @@ parts: 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" diff --git a/src/charm.py b/src/charm.py index d212c7b..2faee0f 100755 --- a/src/charm.py +++ b/src/charm.py @@ -208,7 +208,7 @@ def _update(self, event): "services": { self.name: { "summary": self.name, - "command": "pnpm -C app start", + "command": "/bin/pnpm -C airbyte-webapp start", "startup": "enabled", "override": "replace", # Including config values here so that a change in the diff --git a/tests/unit/test_charm.py b/tests/unit/test_charm.py index 8e2aefb..442fcf5 100644 --- a/tests/unit/test_charm.py +++ b/tests/unit/test_charm.py @@ -130,7 +130,7 @@ def test_ready(self): "services": { APP_NAME: { "summary": APP_NAME, - "command": "cd app/ && pnpm start", + "command": "/bin/pnpm -C airbyte-webapp start", "startup": "enabled", "override": "replace", "environment": {