From 1efd0f4588849412f4373bfd442020fb26b51ed8 Mon Sep 17 00:00:00 2001 From: Harrison Deng Date: Thu, 14 Nov 2024 03:36:48 +0000 Subject: [PATCH] Switched over to to dedicated NodeJS container build environment --- .devcontainer/Dockerfile | 11 ----------- .devcontainer/devcontainer.json | 12 +++++------- Jenkinsfile | 16 ++++++++-------- 3 files changed, 13 insertions(+), 26 deletions(-) delete mode 100644 .devcontainer/Dockerfile diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile deleted file mode 100644 index 2738918..0000000 --- a/.devcontainer/Dockerfile +++ /dev/null @@ -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 diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 70e91b2..66fdc3f 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,11 +1,9 @@ // 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)", - "build": { - "context": "..", - "dockerfile": "Dockerfile" - } + "name": "Node.js", + // Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile + "image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm" // Features to add to the dev container. More info: https://containers.dev/features. // "features": {}, @@ -14,7 +12,7 @@ // "forwardPorts": [], // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "python --version", + // "postCreateCommand": "yarn install", // Configure tool-specific properties. // "customizations": {}, diff --git a/Jenkinsfile b/Jenkinsfile index b80098b..bfa3bd0 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,33 +1,33 @@ pipeline { agent { kubernetes { - cloud 'Reslate Systems' - defaultContainer 'conda' + cloud 'rsys-devel' + defaultContainer 'nodejs' + inheritFrom 'nodejs' } } + stages { stage("install") { steps { - sh 'conda update conda -y -q' - sh 'conda env update -n base --file environment.yml -q' - sh 'conda run -n base npm install' + sh 'npm install' } } stage("test") { steps { - sh 'conda run -n base npm run test:junit' + sh 'npm run test:junit' recordCoverage(tools: [[parser: 'JUNIT', pattern: 'junit/*.xml']]) } } stage("build") { 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 } } stage("generate docs") { 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: '']) } }