Skip to content

Commit

Permalink
Merge pull request #1107 from jumpserver/v4
Browse files Browse the repository at this point in the history
Merge v4 to dev
  • Loading branch information
ibuler committed Jun 24, 2024
2 parents 8950b49 + b2dddc0 commit 4513abf
Show file tree
Hide file tree
Showing 59 changed files with 1,247 additions and 16,732 deletions.
46 changes: 30 additions & 16 deletions .github/workflows/jms-build-test.yml
Original file line number Diff line number Diff line change
@@ -1,32 +1,46 @@
name: "Run Build Test"
on:
push:
branches:
- pr@*
- repr@*
paths:
- 'Dockerfile'
- 'Dockerfile*'
- 'package.json'
- 'yarn.lock'

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
component: [luna]
version: [v4]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: docker/setup-buildx-action@v3

- uses: docker/setup-qemu-action@v2
- name: Prepare Build
run: |
sed -i 's@registry.npmmirror.com@registry.yarnpkg.com@g' yarn.lock
- uses: docker/setup-buildx-action@v2
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/build-push-action@v3
- name: Build Image
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: jumpserver/luna:test
push: true
file: Dockerfile
tags: ghcr.io/jumpserver/${{ matrix.component }}:${{ matrix.version }}
platforms: linux/amd64
build-args: |
VERSION=${{ matrix.version }}
APT_MIRROR=http://deb.debian.org
NPM_REGISTRY=https://registry.yarnpkg.com
outputs: type=image,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true
cache-from: type=gha
cache-to: type=gha,mode=max

- uses: LouisBrunner/checks-action@v1.5.0
if: always()
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: Check Build
conclusion: ${{ job.status }}
18 changes: 18 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Run Luna",
"type": "node",
"request": "launch",
"runtimeExecutable": "bash",
"runtimeArgs": [
"-c",
"source ~/.zshrc && nvm use v16.20.2 && npm start"
],
}
]
}
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ FROM node:16.20-bullseye-slim as stage-build
ARG TARGETARCH
ARG NPM_REGISTRY="https://registry.npmmirror.com"

WORKDIR /data

RUN set -ex \
&& npm config set registry ${NPM_REGISTRY} \
&& yarn config set registry ${NPM_REGISTRY}

ADD package.json yarn.lock /data/
WORKDIR /data

RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=luna \
--mount=type=bind,source=package.json,target=package.json \
--mount=type=bind,source=yarn.lock,target=yarn.lock \
yarn install

ARG VERSION
ENV VERSION=$VERSION

ADD . /data

RUN --mount=type=cache,target=/usr/local/share/.cache/yarn,sharing=locked,id=luna \
sed -i "s@version =.*;@version = '${VERSION}';@g" src/environments/environment.prod.ts \
&& yarn build \
Expand Down
1 change: 1 addition & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"main": "src/main.ts",
"tsConfig": "src/tsconfig.app.json",
"polyfills": "src/polyfills.ts",
"preserveSymlinks": true,
"assets": [
"src/assets",
"src/static",
Expand Down
Loading

0 comments on commit 4513abf

Please sign in to comment.