firebase - 用于将 DotNet Core 输出部署到 Firebase 的 Docker 映像
问题描述
我正在努力创建一个 BitBucket Pipeline 脚本,该脚本可以编译 DotNet Core 应用程序,运行它,然后使用 CLI 将输出的 html 文件部署到 Firebase。
image: microsoft/dotnet:sdk
pipelines:
default:
- step:
caches:
- dotnetcore
script:
- dotnet restore
- dotnet build MySolution.sln
branches:
master:
- step:
caches:
- dotnetcore
script:
- dotnet restore
- dotnet build MySolution.sln
- cd MySolution
- dotnet run MySolution.
- npm install -g firebase-tool
- firebase deploy --token "$FIREBASE_TOKEN"
该图像microsoft/dotnet:sdk
不包含我需要的 npm 或 Firebase-Tools 包。我正在努力寻找一个包含 dotnet 和 npm / Firebase-Tools 的替代 Docker 映像。有没有更简单的方法可以直接从 BitBucket 将应用程序的输出部署到 Firebase?
解决方案
我认为您应该深入研究 Bitbucket 管道的多步骤方法。在那里,您将能够使用不同的 docker 映像运行每个步骤。
例如:
pipelines:
default:
- step:
name: Build and test
image: microsoft/dotnet:sdk
script:
- dotnet restore
- dotnet build
- dotnet publish -o /out -c Release
artifacts:
- out/**
- step:
name: Run npm
image: node:8
script:
- npm install -g firebase-tool
- firebase deploy --token "$FIREBASE_TOKEN"
- step
name: Run app
image: microsoft/dotnet:sdk
script:
- dotnet run MySolution .
推荐阅读
- python - 从与类项关联的字符串中获取类项的属性
- python - Python 从 xml.file 获取数字坐标
- azure-devops - 构建成功但代理仍在运行
- python - 将 3*n*n 图像的 numpy 数组转换为 1*n*n?
- linear-programming - CPLEX 中的整数大小
- elasticsearch - Find documents which is older then specified date range based on list of ids
- c# - Wpf 允许按用户删除行但禁止编辑 DataGridTextColumn 上的单元格
- windows - 如何在不使用 Electron 中的默认应用程序的情况下打开文件?
- ssas - MDX 将数字转换为字符串/concat 混合类型
- android - 使用 Android Studio4.1 在 MacOs Big Sur 上的 vscode 中出现“无法找到 Android Studio 可执行文件”错误