product-build-linux.yml 3.8 KB
Newer Older
J
Joao Moreno 已提交
1
steps:
J
Joao Moreno 已提交
2 3 4 5 6 7 8 9
- script: |
    mkdir -p .build
    echo -n $BUILD_SOURCEVERSION > .build/commit
  displayName: Prepare cache flag

- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
    keyfile: '.build/commit'
B
Benjamin Pasero 已提交
10
    targetfolder: '.build, **/out-build, **/out-vscode-min, **/out-vscode-reh-min, **/out-vscode-reh-web-min'
J
Joao Moreno 已提交
11 12 13 14 15 16 17 18 19 20
    vstsFeed: 'npm-vscode'
    platformIndependent: true
    alias: 'Compilation'

- script: |
    set -e
    exit 1
  displayName: Check RestoreCache
  condition: and(succeeded(), ne(variables['CacheRestored-Compilation'], 'true'))

J
Joao Moreno 已提交
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
- task: NodeTool@0
  inputs:
    versionSpec: "10.15.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
    versionSpec: "1.10.1"

- task: AzureKeyVault@1
  displayName: 'Azure Key Vault: Get Secrets'
  inputs:
    azureSubscription: 'vscode-builds-subscription'
    KeyVaultName: vscode

- script: |
    set -e
    cat << EOF > ~/.netrc
    machine github.com
    login vscode
    password $(github-distro-mixin-password)
    EOF

    git config user.email "vscode@microsoft.com"
    git config user.name "VSCode"
  displayName: Prepare tooling

J
Joao Moreno 已提交
47 48
- script: |
    set -e
J
Joao Moreno 已提交
49 50 51 52 53
    git remote add distro "https://github.com/$(VSCODE_MIXIN_REPO).git"
    git fetch distro
    git merge $(node -p "require('./package.json').distro")
  displayName: Merge distro

J
Joao Moreno 已提交
54 55
- task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1
  inputs:
56
    keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
57 58
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
J
Joao Moreno 已提交
59 60 61

- script: |
    set -e
J
Joao Moreno 已提交
62
    CHILD_CONCURRENCY=1 yarn --frozen-lockfile
J
Joao Moreno 已提交
63
  displayName: Install dependencies
J
Joao Moreno 已提交
64
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
65

J
Joao Moreno 已提交
66 67
- task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1
  inputs:
68
    keyfile: 'build/.cachesalt, .yarnrc, remote/.yarnrc, **/yarn.lock, !**/node_modules/**/yarn.lock, !**/.*/**/yarn.lock'
J
Joao Moreno 已提交
69 70 71
    targetfolder: '**/node_modules, !**/node_modules/**/node_modules'
    vstsFeed: 'npm-vscode'
  condition: and(succeeded(), ne(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
72 73 74

- script: |
    set -e
J
Joao Moreno 已提交
75 76 77
    yarn postinstall
  displayName: Run postinstall scripts
  condition: and(succeeded(), eq(variables['CacheRestored'], 'true'))
J
Joao Moreno 已提交
78

J
Joao Moreno 已提交
79 80
- script: |
    set -e
J
Joao Moreno 已提交
81
    node build/azure-pipelines/mixin
J
Joao Moreno 已提交
82
  displayName: Mix in quality
J
Joao Moreno 已提交
83 84 85 86

- script: |
    set -e
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
J
Joao Moreno 已提交
87
      yarn gulp vscode-linux-x64-min-ci
J
Joao Moreno 已提交
88
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
J
Joao Moreno 已提交
89
      yarn gulp vscode-reh-linux-x64-min-ci
J
Joao Moreno 已提交
90
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
91
      yarn gulp vscode-reh-web-linux-x64-min-ci
J
Joao Moreno 已提交
92 93 94 95
  displayName: Build

- script: |
    set -e
J
Joao Moreno 已提交
96
    yarn gulp "electron-x64"
J
Joao Moreno 已提交
97 98 99 100 101

    # xvfb seems to be crashing often, let's make sure it's always up
    service xvfb start

    DISPLAY=:10 ./scripts/test.sh --build --tfs "Unit Tests"
J
Joao Moreno 已提交
102
    # yarn smoketest -- --build "$(agent.builddirectory)/VSCode-linux-x64"
J
Joao Moreno 已提交
103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
  displayName: Run unit tests
  condition: and(succeeded(), eq(variables['VSCODE_STEP_ON_IT'], 'false'))

- script: |
    set -e
    AZURE_DOCUMENTDB_MASTERKEY="$(builds-docdb-key-readwrite)" \
    AZURE_STORAGE_ACCESS_KEY_2="$(vscode-storage-key)" \
    VSCODE_MIXIN_PASSWORD="$(github-distro-mixin-password)" \
    VSCODE_HOCKEYAPP_TOKEN="$(vscode-hockeyapp-token)" \
    ./build/azure-pipelines/linux/publish.sh
  displayName: Publish

- task: PublishPipelineArtifact@0
  displayName: 'Publish Pipeline Artifact'
  inputs:
J
Joao Moreno 已提交
118
    artifactName: snap-x64
J
Joao Moreno 已提交
119
    targetPath: .build/linux/snap-tarball
J
Joao Moreno 已提交
120 121 122 123

- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
  displayName: 'Component Detection'
  continueOnError: true