Skip to content

Commit

Permalink
Merge pull request ElektraInitiative#4712 from Bujuhu/CI/npm
Browse files Browse the repository at this point in the history
[FLOSS T1] CI: Fix npm reproducability issues
  • Loading branch information
markus2330 authored Nov 24, 2022
2 parents 3ab2721 + 608d50b commit d63805f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 4 additions & 0 deletions doc/news/_preparation_next_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,8 @@ This section keeps you up-to-date with the multi-language support provided by El
- <<TODO>>
- <<TODO>>
- <<TODO>>
- Add audit-dependencies script to check for vulnerabilities for npm depndencies _(Juri Schreib @Bujuhu)_ _(Nikola Prvulovic @Dynamichost96)_
- <<TODO>>
- <<TODO>>

## Documentation
Expand Down Expand Up @@ -481,6 +483,8 @@ This section keeps you up-to-date with the multi-language support provided by El
- Pass `--stacktrace` to gradle for the JNA builds. _(Maximilian Irlinger @atmaxinger)_
- <<TODO>>
- <<TODO>>
- Adapt npm build flags to remove reproducability issues _(Juri Schreib @Bujuhu)_ _(Nikola Prvulovic @Dynamichost96)_
- <<TODO>>

### Docker

Expand Down
12 changes: 12 additions & 0 deletions scripts/dev/audit-dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

SCRIPTS_DIR=$(dirname "$0")
. "${SCRIPTS_DIR}/include-common"

cd "$SOURCE/src/tools/webd" || exit 1
npm audit --audit-level="low"

cd "$SOURCE/src/tools/webui" || exit 1
npm audit --audit-level="low"

exit 0
2 changes: 1 addition & 1 deletion src/tools/webd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ else ()
# build elektra-web
install (CODE "message (\"-- Installing: elektra-web > webd\")")
install (
CODE "execute_process (COMMAND npm install --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
CODE "execute_process (COMMAND npm install --no-audit --no-save --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
)
install (
CODE "execute_process (COMMAND npm run build --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
Expand Down
2 changes: 1 addition & 1 deletion src/tools/website/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ else ()

# attempt to install npm dependencies
install (
CODE "execute_process (COMMAND npm install --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
CODE "execute_process (COMMAND npm install --no-audit --no-save --unsafe-perm WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}/${install_directory} OUTPUT_QUIET)"
)

generate_manpage (kdb-run-${tool} FILENAME "${CMAKE_CURRENT_BINARY_DIR}/README.md" GENERATED_FROM
Expand Down

0 comments on commit d63805f

Please sign in to comment.