New pipeline to publish restler docker image. #78 (#82)

This commit is contained in:
Marc 2020-11-20 13:35:18 -08:00 коммит произвёл GitHub
Родитель 45a095b5f7
Коммит 23828e421b
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 85 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,64 @@
trigger:
batch : true
branches:
include:
- 'main'
parameters:
- name: RestlerBuildTag
displayName: Restler Tag or Commit
default: "Tag Name"
- name: Production
displayName: Publish For Production?
default: No
values:
- Yes
- No
variables:
- template: 'variables/version-variables.yml'
- name: version.revision
value: $[counter(variables['devRevision'], 1)]
- name: versionNumber
value: $(version.major).$(version.minor).$(version.revision)
stages:
- template: stages/build/build.yml
- stage: publish
jobs:
- job: PublishDockerImage
pool:
vmImage: 'ubuntu-latest'
steps:
- checkout: self
- task: DownloadPipelineArtifact@2
inputs:
artifact: restler-fuzzer-drop-for-docker
path: $(Build.SourcesDirectory)/artifacts/restler-fuzzer-drop
- task: Docker@2
displayName: 'Publish Restler Test'
condition: and(succeeded(), eq('${{parameters.Production}}', 'No'))
inputs:
buildContext: $(Build.SourcesDirectory)/artifacts/restler-fuzzer-drop
command: buildAndPush
containerRegistry: acrrestler
repository: restler
Dockerfile: $(Build.SourcesDirectory)/docker/Dockerfile
tags: |
Test-$(Build.BuildNumber)
- task: Docker@2
displayName: 'Publish Restler Production'
condition: and(succeeded(), eq('${{parameters.Production}}', 'Yes'))
inputs:
buildContext: $(Build.SourcesDirectory)/artifacts/restler-fuzzer-drop
command: buildAndPush
containerRegistry: RAFTProductionRegistry
repository: public/restlerfuzzer/restler
Dockerfile: $(Build.SourcesDirectory)/docker/Dockerfile
tags: |
${{ parameters.RestlerBuildTag }}

Просмотреть файл

@ -64,3 +64,7 @@ steps:
artifactName: 'restler-fuzzer-drop-$(versionNumber)' artifactName: 'restler-fuzzer-drop-$(versionNumber)'
publishLocation: 'Container' publishLocation: 'Container'
- task: PublishPipelineArtifact@1
inputs:
targetPath: $(Agent.BuildDirectory)/restler_drop/
artifactName: restler-fuzzer-drop-for-docker

17
docker/Dockerfile Normal file
Просмотреть файл

@ -0,0 +1,17 @@
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine
COPY ./compiler /RESTler/compiler
COPY ./restler /RESTler/restler
#Get the source code for the engine, and
#copy source code to the image
#RESTler Python dependency
RUN apk add --no-cache python3
RUN python3 -m ensurepip
RUN pip3 install --upgrade pip
RUN pip3 install requests
RUN pip3 install requests
RUN pip3 install applicationinsights
COPY ./engine /RESTler/engine
RUN python3 -m compileall -b /RESTler/engine
COPY ./resultsAnalyzer /RESTler/resultsAnalyzer