Skip to content

Commit

Permalink
feat: add webui backend to rock (#621)
Browse files Browse the repository at this point in the history
  • Loading branch information
patriciareinoso authored Aug 7, 2024
1 parent 10ad232 commit 7e63f18
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 119 deletions.
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/scan-rock.yaml@v1.0.0

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:

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

0 comments on commit 7e63f18

Please sign in to comment.