> For the complete documentation index, see [llms.txt](https://jadelab.gitbook.io/jadegit/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://jadelab.gitbook.io/jadegit/0.18.0/admin/database-images/example/dev.md).

# Dev

The `dev.yml` template creates a dev image by downloading the empty image, adding the JadeGit binaries, running the install command, and publishing the result to the catalog.

In this example, fetch is run after install to populate repositories automatically initialized during install, assuming the registry is being used.

A setup script can also be added at this point, to be run after the image is downloaded, which amongst other things can create shortcuts, making it easy to get started in the workspace being created.

```yaml
parameters:
- name: database
  type: string

- name: version
  type: string

- name: charset
  type: string

- name: dependsOn
  type: object
  default: []

- name: displayName
  type: string
  default: Dev

- name: preview
  type: boolean
  default: false

jobs:
- job: ${{ parameters.database }}_dev_${{ replace(parameters.version, '.', '_') }}_${{ parameters.charset }}
  displayName: ${{ parameters.displayName }}
  dependsOn: ${{ parameters.dependsOn }}
  steps:
  - checkout: none

  - template: download.yml
    parameters:
      path: $(Build.StagingDirectory)
      database: ${{ parameters.database }}
      type: empty
      version: ${{ parameters.version }}
      charset: ${{ parameters.charset }}

  - task: UniversalPackages@0
    displayName: "Download JadeGit"
    condition: and(succeeded(), eq(variables.image_exists, true))
    inputs:
      command: download
      vstsFeed: '$(jade.feed)'
      vstsFeedPackage: 'jadegit-dev-${{ parameters.version }}-${{ parameters.charset }}'
      vstsPackageVersion: '$(jadegit.version)'
      downloadDirectory: '$(Build.StagingDirectory)\bin'

  - powershell: |
      New-Item -Path i686-msoft-win32-ansi\download\bin -Type Directory -Force | Out-Null
      New-Item -Path x64-msoft-win64-ansi\download\bin -Type Directory -Force | Out-Null
      Copy-Item -Path bin\jadegitauth.dll -Destination i686-msoft-win32-ansi\download\bin -Force
      Copy-Item -Path bin\jadegitauth.dll -Destination x64-msoft-win64-ansi\download\bin -Force
    workingDirectory: $(Build.StagingDirectory)
    displayName: "Update Binaries"
    condition: and(succeeded(), eq(variables.image_exists, true))

  - powershell: |
      @"
      [Jade]
      LoadStyleDefault=PRIOR
      LoadStyleSecond=LATEST
      [JadeGit]
      PatchExtractPlatformVersion=$(jade.version.current)
      [JadeSecurity]
      DevelopmentSecurityLibrary=jadegitdev
      JadePatchControlSecurity=true
      "@ | Set-Content -path .\jade.ini
    workingDirectory: $(Build.StagingDirectory)
    displayName: "Apply Config"
    condition: and(succeeded(), eq(variables.image_exists, true))

  - powershell: |
      bin\jadegit -p system -i .\jade.ini install
    workingDirectory: $(Build.StagingDirectory)
    displayName: "Install JadeGit"
    condition: and(succeeded(), eq(variables.image_exists, true))

  - powershell: |
      bin\jadegit -p system -i .\jade.ini --log-progress-format "##vso[task.setprogress value={}]" fetch --all --access-token $(System.AccessToken)
    workingDirectory: $(Build.StagingDirectory)
    continueOnError: true
    displayName: "Initial Fetch"
    condition: and(succeeded(), eq(variables.image_exists, true))

  - powershell: |
      {
      Push-Location $PSScriptRoot

      function CreateShortcut {
          param (
              [string]$name,
              [string]$target,
              [string]$arguments
          )

          if(!(Test-Path "$name.lnk")) {
              $shell = New-Object -comObject WScript.Shell
              $shortcut = $shell.CreateShortcut("$pwd/$name.lnk")
              $shortcut.TargetPath = "$pwd/bin/$target"
              $shortcut.Arguments = $arguments
              $shortcut.WorkingDirectory = "$pwd"
              $shortcut.Save()
          }
      }

      CreateShortcut -name "Jade" -target "jade.exe" -arguments "path=$pwd\system ini=.\jade.ini app=Jade server=localServer"

      Pop-Location
      } | Set-Content -path .\setup.ps1
    workingDirectory: $(Build.StagingDirectory)
    displayName: "Generate Setup Script"
    condition: and(succeeded(), eq(variables.image_exists, true))

  - task: PublishPipelineArtifact@1
    displayName: "Publish Logs"
    condition: and(succeededOrFailed(), eq(variables.image_exists, true))
    inputs:
      targetPath: $(Build.StagingDirectory)\logs
      artifact: ${{ parameters.database }}_dev_${{ replace(parameters.version, '.', '_') }}_${{ parameters.charset }}_logs
      publishLocation: 'pipeline'

  - template: publish.yml
    parameters:
      path: $(Build.StagingDirectory)
      database: ${{ parameters.database }}
      type: dev
      version: ${{ parameters.version }}
      charset: ${{ parameters.charset }}
      condition: and(succeeded(), eq(variables.image_exists, true))
```
