Switched over to to dedicated NodeJS container build environment
All checks were successful
audioshowkit/pipeline/head This commit looks good

This commit is contained in:
Harrison Deng 2024-11-14 03:36:48 +00:00
parent e3361e25f5
commit 1efd0f4588
3 changed files with 13 additions and 26 deletions

View File

@ -1,11 +0,0 @@
FROM mcr.microsoft.com/devcontainers/anaconda:1-3
# Copy environment.yml (if found) to a temp location so we update the environment. Also
# copy "noop.txt" so the COPY instruction does not fail if no environment.yml exists.
COPY environment.yml* .devcontainer/noop.txt /tmp/conda-tmp/
RUN if [ -f "/tmp/conda-tmp/environment.yml" ]; then umask 0002 && /opt/conda/bin/conda env update -n base -f /tmp/conda-tmp/environment.yml; fi \
&& rm -rf /tmp/conda-tmp
# [Optional] Uncomment this section to install additional OS packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

View File

@ -1,11 +1,9 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the // For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/anaconda // README at: https://github.com/devcontainers/templates/tree/main/src/javascript-node
{ {
"name": "Anaconda (Python 3)", "name": "Node.js",
"build": { // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"context": "..", "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm"
"dockerfile": "Dockerfile"
}
// Features to add to the dev container. More info: https://containers.dev/features. // Features to add to the dev container. More info: https://containers.dev/features.
// "features": {}, // "features": {},
@ -14,7 +12,7 @@
// "forwardPorts": [], // "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created. // Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "python --version", // "postCreateCommand": "yarn install",
// Configure tool-specific properties. // Configure tool-specific properties.
// "customizations": {}, // "customizations": {},

16
Jenkinsfile vendored
View File

@ -1,33 +1,33 @@
pipeline { pipeline {
agent { agent {
kubernetes { kubernetes {
cloud 'Reslate Systems' cloud 'rsys-devel'
defaultContainer 'conda' defaultContainer 'nodejs'
inheritFrom 'nodejs'
} }
} }
stages { stages {
stage("install") { stage("install") {
steps { steps {
sh 'conda update conda -y -q' sh 'npm install'
sh 'conda env update -n base --file environment.yml -q'
sh 'conda run -n base npm install'
} }
} }
stage("test") { stage("test") {
steps { steps {
sh 'conda run -n base npm run test:junit' sh 'npm run test:junit'
recordCoverage(tools: [[parser: 'JUNIT', pattern: 'junit/*.xml']]) recordCoverage(tools: [[parser: 'JUNIT', pattern: 'junit/*.xml']])
} }
} }
stage("build") { stage("build") {
steps { steps {
sh 'conda run -n base npm run build:prod' sh 'npm run build:prod'
archiveArtifacts artifacts: 'dist/audioshowkit.js', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true archiveArtifacts artifacts: 'dist/audioshowkit.js', fingerprint: true, followSymlinks: false, onlyIfSuccessful: true
} }
} }
stage("generate docs") { stage("generate docs") {
steps { steps {
sh 'conda run -n base npm run docs' sh 'npm run docs'
publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: './docs', reportFiles: 'index.html', reportName: 'Documentation', reportTitles: '']) publishHTML([allowMissing: false, alwaysLinkToLastBuild: true, keepAll: true, reportDir: './docs', reportFiles: 'index.html', reportName: 'Documentation', reportTitles: ''])
} }
} }