зеркало из https://github.com/Azure/git-rest-api.git
Add docker build/publish (#2)
This commit is contained in:
Родитель
483c6c2437
Коммит
8a0b0038e5
40
.ci/ci.yml
40
.ci/ci.yml
|
@ -1,32 +1,32 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
pool:
|
||||
vmImage: 'Ubuntu 16.04'
|
||||
vmImage: "Ubuntu 16.04"
|
||||
|
||||
trigger:
|
||||
- master
|
||||
- master
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: '10.x'
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.x"
|
||||
|
||||
- script: npm ci
|
||||
displayName: 'Install dependencies'
|
||||
- script: npm ci
|
||||
displayName: "Install dependencies"
|
||||
|
||||
- script: npm run test
|
||||
displayName: 'Test'
|
||||
- script: npm run test
|
||||
displayName: "Test"
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testRunner: JUnit
|
||||
testResultsFiles: ./test-results.xml
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testRunner: JUnit
|
||||
testResultsFiles: ./test-results.xml
|
||||
|
||||
- task: PublishCodeCoverageResults@1
|
||||
inputs:
|
||||
codeCoverageTool: Cobertura
|
||||
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/*coverage.xml'
|
||||
reportDirectory: '$(System.DefaultWorkingDirectory)/**/coverage'
|
||||
- task: PublishCodeCoverageResults@1
|
||||
inputs:
|
||||
codeCoverageTool: Cobertura
|
||||
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/*coverage.xml"
|
||||
reportDirectory: "$(System.DefaultWorkingDirectory)/**/coverage"
|
||||
|
||||
- script: npm run lint
|
||||
displayName: 'Lint'
|
||||
- script: npm run lint
|
||||
displayName: "Lint"
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
|
||||
trigger:
|
||||
- master
|
||||
|
||||
pr: none
|
||||
|
||||
stages:
|
||||
- stage: Build_Project
|
||||
jobs:
|
||||
- job: Build_Project
|
||||
pool:
|
||||
vmImage: "Ubuntu-16.04"
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "10.x"
|
||||
|
||||
- script: npm ci
|
||||
displayName: "Install Dependencies"
|
||||
|
||||
- script: npm run build
|
||||
displayName: "Build Project"
|
||||
- stage: Build_Docker
|
||||
dependsOn: Build_Project
|
||||
jobs:
|
||||
- job: Build_Docker
|
||||
pool:
|
||||
vmImage: "Ubuntu-16.04"
|
||||
steps:
|
||||
- task: Docker@2
|
||||
displayName: "Build azuredevx/git-rest-api"
|
||||
inputs:
|
||||
containerRegistry: "git-rest-api docker"
|
||||
repository: "azuredevx/git-rest-api"
|
||||
- stage: Publish_Docker
|
||||
dependsOn: Build_Docker
|
||||
jobs:
|
||||
- job: Publish_Docker
|
||||
pool:
|
||||
vmImage: "Ubuntu-16.04"
|
||||
steps:
|
||||
- task: Docker@2
|
||||
displayName: "Push azuredevx/git-rest-api"
|
||||
inputs:
|
||||
containerRegistry: "git-rest-api docker"
|
||||
repository: "azuredevx/git-rest-api"
|
|
@ -0,0 +1,7 @@
|
|||
FROM node:10
|
||||
|
||||
EXPOSE 3009
|
||||
|
||||
COPY ./ ./
|
||||
|
||||
CMD npm run start:prod
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -7,6 +7,7 @@
|
|||
"build": "tsc -p config/tsconfig.build.json",
|
||||
"build:watch": "npm run -s build -- --watch",
|
||||
"start": "npm run build && node ./bin/main.js",
|
||||
"start:prod": "node ./bin/main.js",
|
||||
"start:dev": "concurrently --handle-input \"wait-on bin/main.js && nodemon\" \"tsc -w -p tsconfig.build.json\" ",
|
||||
"start:debug": "nodemon --config nodemon-debug.json",
|
||||
"test": "jest",
|
||||
|
|
Загрузка…
Ссылка в новой задаче