Updated devcontainer configuration and CI configuration
All checks were successful
props/pipeline/head This commit looks good
All checks were successful
props/pipeline/head This commit looks good
This commit is contained in:
parent
cd308cf4b4
commit
b9007e2403
@ -1,11 +1,8 @@
|
|||||||
FROM mcr.microsoft.com/devcontainers/anaconda:1-3
|
FROM mcr.microsoft.com/devcontainers/dotnet:1-9.0-bookworm
|
||||||
|
|
||||||
# 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.
|
# [Optional] Uncomment this section to install additional OS packages.
|
||||||
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
|
||||||
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
# && apt-get -y install --no-install-recommends <your-package-list-here>
|
||||||
|
|
||||||
|
# [Optional] Uncomment this line to install global node packages.
|
||||||
|
# RUN su vscode -c "source /usr/local/share/nvm/nvm.sh && npm install -g <your-package-here>" 2>&1
|
32
.devcontainer/devcontainer.json
Normal file
32
.devcontainer/devcontainer.json
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
|
||||||
|
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet-postgres
|
||||||
|
{
|
||||||
|
"name": "C# (.NET) and PostgreSQL",
|
||||||
|
"dockerComposeFile": "docker-compose.yml",
|
||||||
|
"service": "app",
|
||||||
|
"workspaceFolder": "/workspaces/${localWorkspaceFolderBasename}",
|
||||||
|
"features": {
|
||||||
|
"ghcr.io/devcontainers/features/node:1": {},
|
||||||
|
"ghcr.io/devcontainers/features/python:1": {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Features to add to the dev container. More info: https://containers.dev/features.
|
||||||
|
// "features": {},
|
||||||
|
|
||||||
|
// Configure tool-specific properties.
|
||||||
|
// "customizations": {},
|
||||||
|
|
||||||
|
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||||
|
// "forwardPorts": [5000, 5001, 5432],
|
||||||
|
// "portsAttributes": {
|
||||||
|
// "5001": {
|
||||||
|
// "protocol": "https"
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// Use 'postCreateCommand' to run commands after the container is created.
|
||||||
|
// "postCreateCommand": "dotnet --info",
|
||||||
|
|
||||||
|
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
|
// "remoteUser": "root"
|
||||||
|
}
|
38
.devcontainer/docker-compose.yml
Normal file
38
.devcontainer/docker-compose.yml
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
version: '3.8'
|
||||||
|
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- ../..:/workspaces:cached
|
||||||
|
|
||||||
|
# Overrides default command so things don't shut down after the process ends.
|
||||||
|
command: sleep infinity
|
||||||
|
|
||||||
|
# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
|
||||||
|
network_mode: service:db
|
||||||
|
|
||||||
|
# Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
|
||||||
|
# user: root
|
||||||
|
|
||||||
|
# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
|
||||||
|
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||||
|
|
||||||
|
db:
|
||||||
|
image: postgres:14.3
|
||||||
|
restart: unless-stopped
|
||||||
|
volumes:
|
||||||
|
- postgres-data:/var/lib/postgresql/data
|
||||||
|
environment:
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
POSTGRES_USER: postgres
|
||||||
|
POSTGRES_DB: postgres
|
||||||
|
|
||||||
|
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
|
||||||
|
# (Adding the "ports" property to this file will not forward from a Codespace.)
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
postgres-data:
|
7
.vscode/settings.json
vendored
7
.vscode/settings.json
vendored
@ -1,7 +0,0 @@
|
|||||||
{
|
|
||||||
"python.defaultInterpreterPath": "/opt/conda/bin/python",
|
|
||||||
"dotnet.dotnetPath": "/opt/conda/lib/dotnet/",
|
|
||||||
"omnisharp.dotNetCliPaths": [
|
|
||||||
"/opt/conda/lib/dotnet/dotnet"
|
|
||||||
]
|
|
||||||
}
|
|
33
Jenkinsfile
vendored
33
Jenkinsfile
vendored
@ -1,25 +1,24 @@
|
|||||||
pipeline {
|
pipeline {
|
||||||
agent {
|
agent {
|
||||||
kubernetes {
|
kubernetes {
|
||||||
cloud 'Reslate Systems'
|
cloud 'rsys-devel'
|
||||||
defaultContainer 'conda'
|
defaultContainer 'homebrew'
|
||||||
}
|
inheritFrom 'homebrew'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
environment {
|
environment {
|
||||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1"
|
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT = "1" // TODO Should probably remove this
|
||||||
}
|
}
|
||||||
stages {
|
stages {
|
||||||
stage("Install") {
|
stage("Install") {
|
||||||
steps {
|
steps {
|
||||||
sh 'conda update conda -y -q'
|
sh 'brew install dotnet@8 node'
|
||||||
sh 'conda env update -n base --file environment.yml'
|
|
||||||
sh 'conda run -n base dotnet restore props.sln'
|
|
||||||
sh 'npm install --prefix ./Props'
|
sh 'npm install --prefix ./Props'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Test Props.Shop") {
|
stage("Test Props.Shop") {
|
||||||
steps {
|
steps {
|
||||||
sh returnStatus: true, script: 'conda run -n base dotnet test --logger xunit --no-restore Props.Shop/**/*.Tests.csproj'
|
sh returnStatus: true, script: 'dotnet test --logger xunit --no-restore Props.Shop/**/*.Tests.csproj'
|
||||||
xunit([xUnitDotNet(excludesPattern: '', pattern: 'Props.Shop/*.Tests/TestResults/*.xml', stopProcessingIfError: true)])
|
xunit([xUnitDotNet(excludesPattern: '', pattern: 'Props.Shop/*.Tests/TestResults/*.xml', stopProcessingIfError: true)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -28,7 +27,7 @@ pipeline {
|
|||||||
sh '''#!/bin/bash
|
sh '''#!/bin/bash
|
||||||
for file in Props.Shop/**/*.csproj
|
for file in Props.Shop/**/*.csproj
|
||||||
do
|
do
|
||||||
conda run -n base dotnet publish --configuration Release --output output/shop-modules $file
|
dotnet publish --configuration Release --output output/shop-modules $file
|
||||||
done
|
done
|
||||||
'''
|
'''
|
||||||
fingerprint 'output/shop-modules/**/Props.Shop.*'
|
fingerprint 'output/shop-modules/**/Props.Shop.*'
|
||||||
@ -38,17 +37,17 @@ pipeline {
|
|||||||
}
|
}
|
||||||
stage("Test Props") {
|
stage("Test Props") {
|
||||||
steps {
|
steps {
|
||||||
sh returnStatus: true, script: 'conda run -n base dotnet test --logger xunit --no-restore Props.Tests/Props.Tests.csproj'
|
sh returnStatus: true, script: 'dotnet test --logger xunit --no-restore Props.Tests/Props.Tests.csproj'
|
||||||
xunit([xUnitDotNet(excludesPattern: '', pattern: 'Props.Tests/TestResults/*.xml', stopProcessingIfError: true)])
|
xunit([xUnitDotNet(excludesPattern: '', pattern: 'Props.Tests/TestResults/*.xml', stopProcessingIfError: true)])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage("Publish Props") {
|
stage("Publish Props") {
|
||||||
steps {
|
steps {
|
||||||
sh 'conda run -n base dotnet publish --configuration Release --output output/props/props-linux-x64 --runtime linux-x64 --self-contained Props'
|
sh 'dotnet publish --configuration Release --output output/props/props-linux-x64 --runtime linux-x64 --self-contained Props'
|
||||||
sh 'conda run -n base dotnet publish --configuration Release --output output/props/props-win-x64 --runtime win-x64 --self-contained Props'
|
sh 'dotnet publish --configuration Release --output output/props/props-win-x64 --runtime win-x64 --self-contained Props'
|
||||||
fingerprint 'output/props/**/Props*'
|
fingerprint 'output/props/**/Props*'
|
||||||
sh 'conda run -n base tar -czf output/props-linux-x64.tar.gz output/props/props-linux-x64'
|
sh 'tar -czf output/props-linux-x64.tar.gz output/props/props-linux-x64'
|
||||||
sh 'conda run -n base zip -r output/props-win-x64.zip output/props/props-win-x64'
|
sh 'zip -r output/props-win-x64.zip output/props/props-win-x64'
|
||||||
archiveArtifacts artifacts: 'output/*.tar.gz,output/*.zip', followSymlinks: false
|
archiveArtifacts artifacts: 'output/*.tar.gz,output/*.zip', followSymlinks: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user