Skip to content

Commit

Permalink
Merge branch 'main' into upgrade-ubuntu-python-node
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukewh authored Dec 14, 2023
2 parents 229d757 + f907001 commit 71f36f4
Show file tree
Hide file tree
Showing 68 changed files with 959 additions and 5,363 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@ jobs:
- name: Build assets
run: dotrun build

- name: Pull the dashboard
run: yarn extract-dashboard-templates

- name: Test site
run: dotrun serve & curl --head --fail --retry-delay 1 --retry 30 --retry-connrefused http://localhost:8029

Expand Down
6 changes: 0 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# juju-dashboard local development
templates/dashboard
static/js/main.*.js
static/js/main.*.js.LICENSE.txt
static/media

# [generated] Bracketed sections updated by Yeoman generator
# [email protected]

Expand Down
4 changes: 2 additions & 2 deletions .stylelintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"rules": {
"order/properties-alphabetical-order": true,
"at-rule-no-unknown": [ true, {
"ignoreAtRules": ["extend", "include"]
} ],
"ignoreAtRules": ["extend", "include", "mixin"]
} ]
}
}
13 changes: 0 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ ADD package.json .
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn yarn install --production


# Build stage: Build dashboard
# ===
FROM ubuntu:jammy AS build-dashboard
WORKDIR /srv/build
# extract the dashboard archive
ADD *.tar.bz2 .


# Build stage: Run "yarn run build-js"
# ===
FROM yarn-dependencies AS build-js
Expand Down Expand Up @@ -59,13 +51,8 @@ ENV PATH="/root/.local/bin:${PATH}"
# Import code, build assets and mirror list
ADD . .
RUN rm -rf package.json yarn.lock .babelrc webpack.config.js .git/index
COPY --from=build-dashboard /srv/build templates/dashboard
COPY --from=build-js /srv/static/js static/js
COPY --from=build-css /srv/static/css static/css
RUN cp templates/dashboard/static/js/* static/js/.
RUN cp templates/dashboard/static/css/* static/css/.
RUN cp -r templates/dashboard/static/media static/.
RUN rm -r templates/dashboard/static

# Set build ID
ARG BUILD_ID
Expand Down
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,4 @@ Once it's installed, run the project with:
dotrun
```

Once the server has started, you can visit <http://127.0.0.1:8029> in your browser.

### Upgrade the dashboard

Update the current installed dashboard:

```bash
yarn run pull-jaas-dashboard
```

That's it! when the next time the project runs, it will regenerate the local files based on the new dashboard archive.
Once the server has started, you can visit <http://127.0.0.1:8029> in your browser. That's it!
18 changes: 5 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
{
"scripts": {
"start": "yarn run build && yarn run extract-dashboard-templates && yarn run serve",
"start": "yarn run build && yarn run serve",
"build": "yarn run build-css && yarn run build-js",
"extract-dashboard-templates": "./scripts/extract-jaas-dashboard.sh templates/dashboard ./static",
"pull-jaas-dashboard": "./scripts/pull-jaas-dashboard.sh",
"build-css": "sass static/sass/styles.scss static/css/styles.css --load-path=node_modules --style=compressed && postcss --map false --use autoprefixer --replace 'static/css/**/*.css'",
"prebuild-js": "yarn run copy-3rd-party-libs",
"build-js": "webpack",
"clean": "rm -rf node_modules yarn-error.log css static/css *.log *.sqlite _site/ build/ .jekyll-metadata .bundle",
"copy-3rd-party-libs": "yarn run copy-global-nav && yarn run copy-instant-page",
"copy-global-nav": "mkdir -p static/js/src/libs/global-nav && cp node_modules/@canonical/global-nav/dist/global-nav.js static/js/src/libs/global-nav",
"copy-instant-page": "mkdir -p static/js/src/libs/instant-page && cp node_modules/instant.page/instantpage.js static/js/src/libs/instant-page",
"format-python": "black --line-length 79 tests webapp",
"check-prettier": "prettier --check ./static/**.*",
"lint-js": "eslint static/js/src/**/*.js",
Expand All @@ -29,22 +23,20 @@
"@babel/core": "7.20.12",
"@babel/preset-env": "7.20.2",
"@canonical/cookie-policy": "3.4.0",
"@canonical/global-nav": "2.7.0",
"@canonical/latest-news": "1.4.1",
"@canonical/global-nav": "3.6.0",
"@sentry/browser": "5.30.0",
"autoprefixer": "10.4.13",
"babel-loader": "8.3.0",
"braces": "3.0.2",
"concurrently": "5.3.0",
"instant.page": "5.1.1",
"postcss": "8.4.21",
"postcss-cli": "8.3.1",
"sass": "1.57.1",
"vanilla-framework": "2.37.1",
"terser-webpack-plugin": "5.3.6",
"vanilla-framework": "^4.3.0",
"watch-cli": "0.2.3",
"webpack": "5.75.0",
"webpack-cli": "4.10.0",
"terser-webpack-plugin": "5.3.6"
"webpack-cli": "4.10.0"
},
"devDependencies": {
"eslint": "7.32.0",
Expand Down
8 changes: 2 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
canonicalwebteam.flask_base==1.0.6
canonicalwebteam.blog==6.4.0
canonicalwebteam.yaml-responses==1.2.0
canonicalwebteam.discourse-docs==1.0.1
canonicalwebteam.flask_base==1.1.0
canonicalwebteam.image-template==1.3.1
feedparser==6.0.10
Flask-Testing==0.8.1
requests==2.28.2
requests==2.31.0
23 changes: 0 additions & 23 deletions scripts/extract-jaas-dashboard.sh

This file was deleted.

11 changes: 0 additions & 11 deletions scripts/pull-jaas-dashboard.sh

This file was deleted.

39 changes: 0 additions & 39 deletions static/js/accordion.js

This file was deleted.

Loading

0 comments on commit 71f36f4

Please sign in to comment.