Skip to content

Commit

Permalink
Merge pull request #144 from sinequa/release/11.12.0
Browse files Browse the repository at this point in the history
Release/11.12.0
  • Loading branch information
hebus authored Aug 28, 2024
2 parents f9e5abb + 2492f61 commit eec62c2
Show file tree
Hide file tree
Showing 161 changed files with 13,725 additions and 24,822 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@
"rules": {}
}
]
}
}
65 changes: 65 additions & 0 deletions .github/workflows/deploy-ghes-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Build and deploy the SBA doc on Github Enterprise

on:
#push:
# branches:
# - develop
# Review gh actions docs if you want to further define triggers, paths, etc
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#on

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
# build
build:
name: Build to GitHub Pages
runs-on: self-hosted
steps:
- name: Sudo cleanup (enabled with passwordless sudo)
run: sudo rm -rf ${{github.workspace}}/*

- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v3
with:
node-version: 18
cache: npm

- name: Install dependencies
run: npm run docs:ci
- name: Build website
run: npm run docs:build-internal

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: "./docusaurus/build"

# deployemnt job
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: self-hosted
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
/out-tsc
# Only exists if Bazel was run
/bazel-out
.nx

# dependencies
/**/node_modules
Expand All @@ -23,6 +24,7 @@ speed-measure-plugin*.json
*.launch
.settings/
*.sublime-workspace
.vscode

# IDE - VSCode
.vscode/*
Expand All @@ -46,6 +48,7 @@ testem.log
/cypress/videos
/cypress/screenshots
/docusaurus/.docusaurus
.nx/*

# System Files
.DS_Store
Expand Down
30 changes: 30 additions & 0 deletions .jenkins_function.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -200,4 +200,34 @@ def getNPMpath(pgm) {
return pgmPath
}

// get the full directory name of a file
def GetDirectoryName(pgm) {
println "Get $pgm path"
def dirPath = ""

// def cmd = '\$dPath="ice\\distrib\\programs\\win\\node\\14.16.0\\' + pgm + '"' + "\n"
def cmd = '\$dPath = Split-Path ' + pgm + ' -Resolve'+ "\n"
cmd += "if ( \$null -ne \$dPath ) {" + "\n"
cmd += " Write-Output \$dPath" + "\n"
cmd += "} else {" + "\n"
cmd += 'Write-Output ""' + "\n"
cmd += "}" + "\n"
// println cmd

dirPath = powershell(returnStdout: true, script: cmd)
// remove CR/LF
dirPath = dirPath.trim()

println "Path found: "+ dirPath
return dirPath
}

// run bat with a special PATH
def batEnv(path, cmd) {
bat """
@set PATH=${path};%PATH%
${cmd}
"""
}

return this
82 changes: 45 additions & 37 deletions .jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,28 +42,33 @@ node (params.SBA_NODE) {
// get the branch name
def myBranch = jf.getBranch()

// get the npm path (if empty, the file path does not exist)
// get the npm path
// remove npm path comming from ice
bat "if exist .\\ice ( rmdir /s /q .\\ice )"
// get node executable for the branch
jf.getIceNode(myBranch)
// get the npm path
def myNPM = jf.getNPMpath("npm.cmd")
if (myNPM == "" ) {
// get node executable for the branch
jf.getIceNode(myBranch)
// get the npm path
myNPM = jf.getNPMpath("npm.cmd")
}
if (myNPM == "" ) {
// get node executable from develop
jf.getIceNode("develop")
// get the npm path
myNPM = jf.getNPMpath("npm.cmd")
}
// A path must be found to do something
if (myNPM == "" ) {
currentBuild.result = "FAILURE"
throw err
}
println "npm.cmd used (${myBranch}): ${myNPM}"
println "Version: "
bat "@call ${myNPM} -v"
// Add node path found to path (for angular)
def mynodeDir = jf.GetDirectoryName(myNPM)
println "Node path: " + mynodeDir
cmd = """
@echo Node Path Version:
@echo .in Path
@call node --version
@echo .in ${mynodeDir}
@call ${mynodeDir}\\node --version

@echo npm.cmd used (${myBranch}): ${myNPM}
@echo Version:
@call ${myNPM} -v
"""
jf.batEnv (mynodeDir, cmd)

stage('Clean') {
// delete dependency modules
Expand All @@ -73,7 +78,7 @@ node (params.SBA_NODE) {

// clean the npm cache
echo ".Cache clean force"
bat "@call ${myNPM} cache clean --force"
jf.batEnv( mynodeDir, "@call ${myNPM} cache clean --force")
}

stage('Create user') {
Expand All @@ -82,7 +87,7 @@ node (params.SBA_NODE) {
// add connection infos in .npmrc file
jf.appendFile(fnpmrc, anpmrc)
// check the connection
bat "@call ${myNPM} whoami"
jf.batEnv( mynodeDir, "@call ${myNPM} whoami")
}

stage('copyNpmrc') {
Expand All @@ -94,7 +99,7 @@ node (params.SBA_NODE) {

stage('NPM Install') {
// get the dependency modules
bat "@call ${myNPM} ci"
jf.batEnv( mynodeDir, "@call ${myNPM} ci --legacy-peer-deps")
}

// check if we are in standard case of build or merge/validation (case of PR)
Expand All @@ -104,40 +109,40 @@ node (params.SBA_NODE) {
// validate the build in a PR after a commit
// build sinequa core modules
stage('Build Core') {
echo "${myNPM} run buildcore --if-present"
bat "@call ${myNPM} run buildcore --if-present"
echo "${myNPM} run buildcore --legacy-peer-deps --if-present"
jf.batEnv( mynodeDir, "@call ${myNPM} run buildcore --legacy-peer-deps --if-present")
}
stage('Build Components') {
echo "${myNPM} run buildcomponents --if-present"
bat "@call ${myNPM} run buildcomponents --if-present"
echo "${myNPM} run buildcomponents --legacy-peer-deps --if-present"
jf.batEnv( mynodeDir, "@call ${myNPM} run buildcomponents --legacy-peer-deps --if-present")
}
stage('Build Analytics') {
echo "${myNPM} run buildanalytics --if-present"
bat "@call ${myNPM} run buildanalytics --if-present"
echo "${myNPM} run buildanalytics --legacy-peer-deps --if-present"
jf.batEnv( mynodeDir, "@call ${myNPM} run buildanalytics --legacy-peer-deps --if-present")
}
stage('Test Core') {
echo "${myNPM} run test core -- --watch=false"
bat "@call ${myNPM} run test core -- --watch=false"
jf.batEnv( mynodeDir, "@call ${myNPM} run test core -- --watch=false")
}
stage('Test Components') {
echo "${myNPM} run test components -- --watch=false"
bat "@call ${myNPM} run test components -- --watch=false"
jf.batEnv( mynodeDir, "@call ${myNPM} run test components -- --watch=false")
}
stage('Test Analytics') {
echo "${myNPM} run test analytics -- --watch=false"
bat "@call ${myNPM} run test analytics -- --watch=false"
jf.batEnv( mynodeDir, "@call ${myNPM} run test analytics -- --watch=false")
}
stage('Build HelloSearch') {
echo "${myNPM} run buildhellosearch --if-present"
bat "@call ${myNPM} run buildhellosearch --if-present"
echo "${myNPM} run buildhellosearch --legacy-peer-deps --if-present"
jf.batEnv( mynodeDir, "@call ${myNPM} run buildhellosearch --legacy-peer-deps --if-present")
}
stage('Build Vanilla') {
echo "${myNPM} run buildvanilla --if-present"
bat "@call ${myNPM} run buildvanilla --if-present"
echo "${myNPM} run buildvanilla --legacy-peer-deps --if-present"
jf.batEnv( mynodeDir, "@call ${myNPM} run buildvanilla --legacy-peer-deps --if-present")
}
stage('Build Pepper') {
echo "${myNPM} run buildpepper --if-present"
bat "@call ${myNPM} run buildpepper --if-present"
echo "${myNPM} run buildpepper --legacy-peer-deps --if-present"
jf.batEnv( mynodeDir, "@call ${myNPM} run buildpepper --legacy-peer-deps --if-present")
}

} else {
Expand All @@ -151,7 +156,7 @@ node (params.SBA_NODE) {
// validate the build before merge
// build sinequa core modules
stage('Build Core') {
bat """
cmd = """
echo ".tag core:"
cd ./projects/core
@call ${myNPM} --no-git-tag-version version ${sba_version}
Expand All @@ -163,9 +168,10 @@ node (params.SBA_NODE) {
echo ".publish core:"
@call ${myNPM} publish ./dist/core --tag ${sba_tag}
"""
jf.batEnv( mynodeDir, cmd)
}
stage('Build Components') {
bat """
cmd = """
echo ".tag components and install core:"
cd ./projects/components
@call ${myNPM} --no-git-tag-version version ${sba_version}
Expand All @@ -178,9 +184,10 @@ node (params.SBA_NODE) {
echo ".publish components:"
@call ${myNPM} publish ./dist/components --tag ${sba_tag}
"""
jf.batEnv( mynodeDir, cmd)
}
stage('Build Analytics') {
bat """
cmd = """
echo ".tag analytics and install components:"
cd ./projects/analytics
@call ${myNPM} --no-git-tag-version version ${sba_version}
Expand All @@ -193,6 +200,7 @@ node (params.SBA_NODE) {
echo ".publish analytics:"
@call ${myNPM} publish ./dist/analytics --tag ${sba_tag}
"""
jf.batEnv( mynodeDir, cmd)
}

// get the current branch version
Expand Down
Loading

0 comments on commit eec62c2

Please sign in to comment.