Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add webui backend to rock #621

Merged
merged 10 commits into from
Aug 7, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:

jobs:
build:
build-nms:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
Expand Down
36 changes: 0 additions & 36 deletions .github/workflows/integration_tests.yaml

This file was deleted.

26 changes: 15 additions & 11 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,22 @@ on:
- cron: "0 0 * * 0"

jobs:
lint-report:
uses: ./.github/workflows/lint-report.yaml
nms-lint-report:
uses: ./.github/workflows/nms-lint-report.yaml

build:
needs: lint-report
uses: ./.github/workflows/build.yaml
build-nms:
needs: nms-lint-report
uses: ./.github/workflows/build-nms.yaml

integration-tests:
needs: build
uses: ./.github/workflows/integration_tests.yaml
build-rock:
needs: build-nms
uses: canonical/sdcore-github-workflows/.github/workflows/build-rock.yaml@v1.0.0

publish:
scan-rock:
needs: build-rock
uses: canonical/sdcore-github-workflows/.github/workflows/[email protected]

publish-rock:
if: github.ref_name == 'main'
needs: integration-tests
uses: ./.github/workflows/publish.yaml
needs: scan-rock
uses: canonical/sdcore-github-workflows/.github/workflows/publish-rock.yaml@v1.0.0
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
workflow_call:

jobs:
lint-report:
nms-lint-report:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
Expand Down
55 changes: 0 additions & 55 deletions .github/workflows/publish.yaml

This file was deleted.

42 changes: 27 additions & 15 deletions rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,7 @@ license: Apache-2.0
platforms:
amd64:
patriciareinoso marked this conversation as resolved.
Show resolved Hide resolved

services:
nms:
command: npm run start
override: replace
startup: enabled
working-dir: app
environment:
WEBUI_ENDPOINT: http://10.1.182.9:5000

parts:

nms:
plugin: nil
source: .
Expand All @@ -27,14 +17,36 @@ parts:
build-snaps:
- node/20/stable
override-build: |
mkdir -p ${CRAFT_PART_INSTALL}/app

craftctl default
npm ci
npm run build

cp -r .next ${CRAFT_PART_INSTALL}/app/
cp -r node_modules ${CRAFT_PART_INSTALL}/app/
cp package.json ${CRAFT_PART_INSTALL}/app/
mkdir -p ${CRAFT_PART_INSTALL}/app
cp -r out/* ${CRAFT_PART_INSTALL}/app/
stage:
- app
prime:
- -app
webui:
after:
- nms
plugin: go
source: https://github.com/omec-project/webconsole.git
source-type: git
source-tag: v1.4.2
build-snaps:
- go/1.21/stable
go-buildtags:
- ui
stage-packages:
- libc6_libs
- base-files_lib
organize:
bin/cmd: bin/webui
override-build: |
rm -rf ${CRAFT_PART_BUILD}/ui/frontend_files/*
cp -r ${CRAFT_STAGE}/app/* ${CRAFT_PART_BUILD}/ui/frontend_files
craftctl default
version:
plugin: nil
override-build: |
Expand Down
Loading