Added devcontainer configurations and updated pipeline.
All checks were successful
ydeng/audioshowkit/pipeline/head This commit looks good

This commit is contained in:
Harrison Deng 2024-07-22 02:48:20 +00:00
parent d532b353c4
commit e3361e25f5
5 changed files with 58 additions and 26 deletions

11
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,11 @@
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

@ -0,0 +1,24 @@
// 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
{
"name": "Anaconda (Python 3)",
"build": {
"context": "..",
"dockerfile": "Dockerfile"
}
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "python --version",
// Configure tool-specific properties.
// "customizations": {},
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}

3
.devcontainer/noop.txt Normal file
View File

@ -0,0 +1,3 @@
This file copied into the container along with environment.yml* from the parent
folder. This file is included to prevents the Dockerfile COPY instruction from
failing if no environment.yml is found.

27
Jenkinsfile vendored
View File

@ -1,34 +1,33 @@
pipeline { pipeline {
agent any agent {
kubernetes {
cloud 'Reslate Systems'
defaultContainer 'conda'
}
}
stages { stages {
stage("install") { stage("install") {
steps { steps {
sh 'mamba env update --file environment.yml --prefix ./env || mamba env create --force --file environment.yml --prefix ./env' sh 'conda update conda -y -q'
sh 'node --version && npm --version' sh 'conda env update -n base --file environment.yml -q'
sh 'npm install' sh 'conda run -n base npm install'
} }
} }
stage("test") { stage("test") {
steps { steps {
sh ''' sh 'conda run -n base npm run test:junit'
source ~/.bashrc recordCoverage(tools: [[parser: 'JUNIT', pattern: 'junit/*.xml']])
npm run test:junit
'''
junit 'junit/*.xml'
} }
} }
stage("build") { stage("build") {
steps { steps {
sh 'npm run build:prod' sh 'conda run -n base 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 ''' sh 'conda run -n base npm run docs'
source ~/.bashrc
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: ''])
} }
} }

View File

@ -2,16 +2,11 @@ name: audioshowkit
channels: channels:
- conda-forge - conda-forge
dependencies: dependencies:
- _libgcc_mutex=0.1 - ca-certificates
- _openmp_mutex=4.5 - icu
- ca-certificates=2022.9.24 - libuv
- icu=70.1 - libzlib
- libgcc-ng=12.2.0 - nodejs=20
- libgomp=12.2.0 - openssl
- libstdcxx-ng=12.2.0 - zlib
- libuv=1.44.2
- libzlib=1.2.13
- nodejs=18.12.1
- openssl=3.0.7
- zlib=1.2.13
prefix: ./env prefix: ./env