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

fix: Fixes github test build #149

Merged
merged 1 commit into from
Sep 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
!.yarnrc.yml
!.yarn/plugins
!.yarn/releases
!.yarn/patches

**/node_modules/
**/site/
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
node: [ '12', '14' ]
node: [ '16', '18' ]
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand All @@ -29,7 +29,7 @@ jobs:
echo "deb [signed-by=/usr/share/keyrings/nginx-archive-keyring.gpg] http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" | sudo tee /etc/apt/sources.list.d/nginx.list
echo -e "Package: *\nPin: origin nginx.org\nPin: release o=nginx\nPin-Priority: 900\n" | sudo tee /etc/apt/preferences.d/99nginx
sudo apt-get update -y
sudo apt-get install -y nginx=1.18.0-2~focal nginx-module-njs=1.18.0.0.4.4-2~focal
sudo apt-get install -y nginx=1.24.0-1~focal nginx-module-njs=1.24.0+0.8.1-1~focal
- name: Show NJS versions for debugging
run: sudo apt-cache showpkg nginx-module-njs
- name: Set up node/yarn
Expand Down
7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ RUN npm install -g yarn
COPY package.json yarn.lock ./
COPY .yarnrc.yml ./
ADD packages/ packages/
ADD docker/ docker/
ADD .yarn/plugins .yarn/plugins
ADD .yarn/releases .yarn/releases
ADD .yarn/patches .yarn/patches

RUN yarn install
RUN yarn build:online
RUN yarn build

# Build stage to extract envsubst
FROM registry.access.redhat.com/ubi8/ubi-minimal:8.8 as envsubst
Expand Down Expand Up @@ -69,9 +71,10 @@ RUN mkdir -p /usr/share/nginx/html/online/osconsole && \
chown 998 /usr/share/nginx/html/online/osconsole/config.json && \
chmod g=u /usr/share/nginx/html/online/osconsole/config.json

COPY docker/nginx.js docker/rbac.js docker/js-yaml.js docker/jwt-decode.js /etc/nginx/conf.d/
## Copies these to / then nginx.sh will link to them on running of the container
COPY docker/nginx.conf docker/nginx-gateway.conf.template docker/nginx-gateway-k8s.conf.template docker/osconsole/config.sh docker/nginx.sh docker/ACL.yaml /

COPY --from=builder /hawtio-online/docker/dist/nginx.js /etc/nginx/conf.d/
COPY --from=builder /hawtio-online/packages/online-shell/build /usr/share/nginx/html/online/
COPY --from=envsubst /usr/bin/envsubst /usr/local/bin/

Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"docker"
],
"scripts": {
"build": "yarn build:online",
"build": "yarn build:online && yarn build:docker",
"build:docker": "yarn workspace @hawtio/online-docker build",
"start:online": "yarn build:mgmt && yarn start:shell",
"build:online": "yarn build:mgmt && yarn build:shell",
"start:shell": "yarn workspace @hawtio/online-shell start",
Expand All @@ -38,8 +39,9 @@
"license": "license-reporter merge --mpn='hawtio-online' --mlx='./packages/online/licenses/licenses.xml,./packages/integration/licenses/licenses.xml' --mo=licenses.xml -o=docker/licenses",
"gen:proxying": "./scripts/generate-proxying.sh",
"gen:serving": "./scripts/generate-serving.sh",
"test:docker": "jasmine docker/*.spec.js",
"test:nginx": "cd docker/ && HAWTIO_ONLINE_RBAC_ACL= njs test.js",
"test": "yarn test:docker && yarn test:nginx",
"test:docker": "yarn workspace @hawtio/online-docker test",
"test:nginx": "yarn workspace @hawtio/online-docker njs:test",
"deploy:k8s:namespace": "kubectl apply --kustomize deploy/k8s/namespace/",
"deploy:k8s:cluster": "kubectl apply --kustomize deploy/k8s/cluster/",
"deploy:openshift:namespace": "oc apply --kustomize deploy/openshift/namespace/",
Expand Down
Loading