PackerBuild@0 - 컴퓨터 이미지 v0 작업 빌드

이 작업을 사용하여 Azure 가상 머신 확장 집합 배포에 사용할 수 있는 Packer를 사용하여 머신 이미지를 빌드합니다.

Syntax

# Build machine image v0
# Build a machine image using Packer, which may be used for Azure Virtual machine scale set deployment.
- task: PackerBuild@0
  inputs:
    templateType: 'builtin' # 'builtin' | 'custom'. Required. Packer template. Default: builtin.
    #customTemplateLocation: # string. Required when templateType = custom. Packer template location. 
    #customTemplateParameters: '{}' # string. Optional. Use when templateType = custom. Template parameters. Default: {}.
  # Azure Details
    ConnectedServiceName: # string. Required when templateType = builtin. Azure subscription. 
    location: # string. Required when templateType = builtin. Storage location. 
    storageAccountName: # string. Required when templateType = builtin. Storage account. 
    azureResourceGroup: # string. Required when templateType = builtin. Resource group. 
  # Deployment Inputs
    baseImageSource: 'default' # 'default' | 'customVhd'. Required when templateType = builtin. Base image source. Default: default.
    #baseImage: 'MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:windows' # 'MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:windows' | 'MicrosoftWindowsServer:WindowsServer:2016-Datacenter:windows' | 'MicrosoftWindowsServer:WindowsServer:2012-Datacenter:windows' | 'MicrosoftWindowsServer:WindowsServer:2008-R2-SP1:windows' | 'Canonical:UbuntuServer:14.04.4-LTS:linux' | 'Canonical:UbuntuServer:16.04-LTS:linux' | 'RedHat:RHEL:7.2:linux' | 'RedHat:RHEL:6.8:linux' | 'OpenLogic:CentOS:7.2:linux' | 'OpenLogic:CentOS:6.8:linux' | 'credativ:Debian:8:linux' | 'credativ:Debian:7:linux' | 'SUSE:openSUSE-Leap:42.2:linux' | 'SUSE:SLES:12-SP2:linux' | 'SUSE:SLES:11-SP4:linux'. Required when baseImageSource = default && templateType = builtin. Base image. Default: MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:windows.
    #customImageUrl: # string. Required when baseImageSource = customVhd && templateType = builtin. Base image URL. 
    #customImageOSType: 'windows' # 'windows' | 'linux'. Required when baseImageSource = customVhd && templateType = builtin. Base image OS. Default: windows.
    packagePath: # string. Required when templateType = builtin. Deployment Package. 
    deployScriptPath: # string. Required when templateType = builtin. Deployment script. 
    #deployScriptArguments: # string. Optional. Use when templateType = builtin. Deployment script arguments. 
  # Advanced
    #additionalBuilderParameters: '{}' # string. Optional. Use when templateType = builtin. Additional Builder parameters. Default: {}.
    #skipTempFileCleanupDuringVMDeprovision: true # boolean. Optional. Use when templateType = builtin. Skip temporary file cleanup during deprovision. Default: true.
  # Output
    #imageUri: # string. Image URL.
# Build Machine Image v0
# Build machine image using Packer. This image can be used for Azure Virtual machine scale set deployment.
- task: PackerBuild@0
  inputs:
    templateType: 'builtin' # 'builtin' | 'custom'. Required. Packer template. Default: builtin.
    #customTemplateLocation: # string. Required when templateType = custom. Packer template location. 
    #customTemplateParameters: '{}' # string. Optional. Use when templateType = custom. Template parameters. Default: {}.
  # Azure Details
    ConnectedServiceName: # string. Required when templateType = builtin. Azure subscription. 
    location: # string. Required when templateType = builtin. Storage location. 
    storageAccountName: # string. Required when templateType = builtin. Storage account. 
    azureResourceGroup: # string. Required when templateType = builtin. Resource group. 
  # Deployment Inputs
    baseImageSource: 'default' # 'default' | 'customVhd'. Required when templateType = builtin. Base image source. Default: default.
    #baseImage: 'MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:windows' # 'MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:windows' | 'MicrosoftWindowsServer:WindowsServer:2016-Datacenter:windows' | 'MicrosoftWindowsServer:WindowsServer:2012-Datacenter:windows' | 'MicrosoftWindowsServer:WindowsServer:2008-R2-SP1:windows' | 'Canonical:UbuntuServer:14.04.4-LTS:linux' | 'Canonical:UbuntuServer:16.04-LTS:linux' | 'RedHat:RHEL:7.2:linux' | 'RedHat:RHEL:6.8:linux' | 'OpenLogic:CentOS:7.2:linux' | 'OpenLogic:CentOS:6.8:linux' | 'credativ:Debian:8:linux' | 'credativ:Debian:7:linux' | 'SUSE:openSUSE-Leap:42.2:linux' | 'SUSE:SLES:12-SP2:linux' | 'SUSE:SLES:11-SP4:linux'. Required when baseImageSource = default && templateType = builtin. Base image. Default: MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:windows.
    #customImageUrl: # string. Required when baseImageSource = customVhd && templateType = builtin. Base image URL. 
    #customImageOSType: 'windows' # 'windows' | 'linux'. Required when baseImageSource = customVhd && templateType = builtin. Base image OS. Default: windows.
    packagePath: # string. Required when templateType = builtin. Deployment Package. 
    deployScriptPath: # string. Required when templateType = builtin. Deployment script. 
    #deployScriptArguments: # string. Optional. Use when templateType = builtin. Deployment script arguments. 
  # Advanced
    #additionalBuilderParameters: '{}' # string. Optional. Use when templateType = builtin. Additional Builder parameters. Default: {}.
    #skipTempFileCleanupDuringVMDeprovision: true # boolean. Optional. Use when templateType = builtin. Skip temporary file cleanup during deprovision. Default: true.
  # Output
    #imageUri: # string. Image URL.

입력

templateType - Packer 템플릿
string. 필수 요소. 허용되는 값: builtin (자동 생성됨), custom (사용자가 제공함) 기본값은 builtin입니다.

작업에서 Packer 템플릿을 자동으로 생성할지 아니면 사용자가 제공한 사용자 지정 템플릿을 사용할지 여부를 지정합니다.


customTemplateLocation - Packer 템플릿 위치
string. 필요한 경우 templateType = custom입니다.

사용자 지정 사용자 제공 템플릿의 경로를 지정합니다.


customTemplateParameters - 템플릿 매개 변수
string. 선택 사항입니다. 을 사용할 때 templateType = custom사용합니다. 기본값은 {}입니다.

사용자 지정 템플릿을 빌드하기 위해 Packer에 전달될 매개 변수를 지정합니다. 사용자 지정 템플릿의 variables 섹션에 매핑되어야 합니다. 예를 들어 템플릿에 라는 drop-location변수가 있는 경우 이름 drop-location 및 사용하려는 값이 포함된 매개 변수를 여기에 추가합니다. 값을 릴리스 변수에도 연결할 수 있습니다. 표에서 추가 매개 변수를 보거나 편집하려면 텍스트 상자 옆에 있는 를 클릭합니다 .


ConnectedServiceName - Azure 구독
string. 필요한 경우 templateType = builtin입니다.

컴퓨터 이미지를 베이킹하고 저장하기 위한 Azure Resource Manager 구독을 지정합니다.


location - 스토리지 위치
string. 필요한 경우 templateType = builtin입니다.

빌드된 컴퓨터 이미지를 저장할 위치를 지정합니다. 이 위치는 이미지를 빌드하기 위한 임시 VM을 만드는 데도 사용됩니다.


storageAccountName - 스토리지 계정
string. 필요한 경우 templateType = builtin입니다.

빌드된 컴퓨터 이미지를 저장하기 위한 스토리지 계정을 지정합니다. 이 스토리지 계정은 선택한 위치에 존재해야 합니다.


azureResourceGroup - 리소스 그룹
string. 필요한 경우 templateType = builtin입니다.

선택한 스토리지 계정을 포함하는 Azure 리소스 그룹을 지정합니다.


baseImageSource - 기본 이미지 원본
string. 필요한 경우 templateType = builtin입니다. 허용되는 값: default (갤러리), customVhd (사용자 지정). 기본값은 default입니다.

기본 이미지의 원본을 지정합니다. OS 이미지의 큐레이팅된 갤러리에서 선택하거나 사용자 지정 이미지의 URL을 제공할 수 있습니다.


baseImage - 기본 이미지
string. 필요한 경우 baseImageSource = default && templateType = builtin입니다. 허용되는 값: MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:windows (Windows 2012-R2-Datacenter), MicrosoftWindowsServer:WindowsServer:2016-Datacenter:windows (Windows 2016-Datacenter), MicrosoftWindowsServer:WindowsServer:2012-Datacenter:windows (Windows 2012-Datacenter), MicrosoftWindowsServer:WindowsServer:2008-R2-SP1:windows (Windows 2008-R2-SP1), Canonical:UbuntuServer:14.04.4-LTS:linux (Ubuntu 14.04.4-LTS), Canonical:UbuntuServer:16.04-LTS:linux (Ubuntu 16.04 -LTS), RedHat:RHEL:7.2:linux (RHEL 7.2), RedHat:RHEL:6.8:linux (RHEL 6.8), OpenLogic:CentOS:7.2:linux (CentOS 7.2), OpenLogic:CentOS:6.8:linux (CentOS 6.8), credativ:Debian:8:linux (Debian 8), credativ:Debian:7:linux (Debian 7), SUSE:openSUSE-Leap:42.2:linux (openSUSE-Leap 42.2), SUSE:SLES:12-SP2:linux (SLES 12-SP2), SUSE:SLES:11-SP4:linux (SLES 11-SP4). 기본값은 MicrosoftWindowsServer:WindowsServer:2012-R2-Datacenter:windows입니다.

큐레이팅된 OS 이미지 목록에서 선택합니다. 이는 컴퓨터 이미지를 캡처하기 전에 필수 구성 요소 및 애플리케이션을 설치하는 데 사용됩니다.


customImageUrl - 기본 이미지 URL
string. 필요한 경우 baseImageSource = customVhd && templateType = builtin입니다.

기본 이미지의 URL을 지정합니다. 이는 컴퓨터 이미지를 캡처하기 전에 필수 구성 요소 및 애플리케이션을 설치하는 데 사용됩니다.


customImageOSType - 기본 이미지 OS
string. 필요한 경우 baseImageSource = customVhd && templateType = builtin입니다. 허용되는 값: windows, linux. 기본값은 windows입니다.


packagePath - 배포 패키지
string. 필요한 경우 templateType = builtin입니다.

에 상대적인 배포 패키지 디렉터리의 경로를 지정합니다 $(System.DefaultWorkingDirectory). 미니매치 패턴을 지원합니다. 예제 경로: FrontendWebApp/**/GalleryApp.


deployScriptPath - 배포 스크립트
string. 필요한 경우 templateType = builtin입니다.

패키지를 배포하는 Powershell 스크립트(Windows용) 또는 셸 스크립트(Linux용)에 대한 상대 경로를 지정합니다. 이 스크립트는 위에서 선택한 패키지 경로에 포함되어야 합니다. 미니매치 패턴을 지원합니다. 예제 경로: deploy/**/scripts/windows/deploy.ps1.


deployScriptArguments - 배포 스크립트 인수
string. 선택 사항입니다. 을 사용할 때 templateType = builtin사용합니다.

배포 스크립트에 전달할 인수를 지정합니다.


additionalBuilderParameters - 추가 작성기 매개 변수
string. 선택 사항입니다. 을 사용할 때 templateType = builtin사용합니다. 기본값은 {}입니다.

자동 생성된 Packer 템플릿 모드에서 작업은 Azure Builder를 사용하여 Packer 템플릿을 만듭니다. 이 작성기는 컴퓨터 이미지를 생성하는 데 사용됩니다. Azure Builder에 키를 추가하여 생성된 Packer 템플릿을 사용자 지정할 수 있습니다. 예를 들어 CentOS 기본 이미지를 사용하는 경우를 설정하고 ssh_tty=true sudo를 실행하려면 tty가 있어야 합니다.

표에서 추가 매개 변수를 보거나 편집하려면 텍스트 상자 옆에 있는 를 클릭합니다 .


skipTempFileCleanupDuringVMDeprovision - 프로비전 해제 중 임시 파일 정리 건너뛰기
boolean. 선택 사항입니다. 을 사용할 때 templateType = builtin사용합니다. 기본값은 true입니다.

VM의 프로비전을 해제하는 동안 은 VM에 업로드된 임시 파일의 정리를 건너뜁니다. 자세한 내용은 Azure Virtual Machine Image Builders를 참조하세요.


imageUri - 이미지 URL
string.

생성된 컴퓨터 이미지 URL을 저장하는 출력 변수의 이름을 지정합니다.


작업 제어 옵션

모든 작업에는 작업 입력 외에 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성을 참조하세요.

출력 변수

없음

설명

Packer를 사용하여 컴퓨터 이미지를 빌드하려면 이 작업을 사용합니다. 이 이미지는 Azure 가상 머신 확장 집합 배포에 사용할 수 있습니다.

참고

자세한 로그를 사용하도록 설정하려면 파이프라인>변수 편집>으로 이동한 다음 PACKER_LOG 새 변수 추가하고 해당 값을 1로 설정합니다.

요구 사항

요구 사항 Description
파이프라인 유형 YAML, 클래식 빌드, 클래식 릴리스
실행 중 에이전트, DeploymentGroup
요청 없음
Capabilities 이 작업은 작업의 후속 작업에 대한 요구를 충족하지 않습니다.
명령 제한 사항 모두
Settable 변수 모두
에이전트 버전 2.0.0 이상
작업 범주 배포