Updating an Appveyor Azure Image
Electron CI on Windows uses AppVeyor, which in turn uses Azure VM images to run. Occasionally, these VM images need to be updated due to changes in Chromium requirements. In order to update you will need PowerShell and the Azure PowerShell module.
Occasionally we need to update these images owing to changes in Chromium or other miscellaneous build requirement changes.
Exemple de cas d'utilisation :
* We need `VS15.9` and we have `VS15.7` installed; this would require us to update an Azure image.
Identifiez l'image que vous souhaitez modifier.
- Dans appveyor.yml, l'image est identifiée par la propriété image.
- The names used correspond to the "images" defined for a build cloud, eg the libcc-20 cloud.
- Find the image you wish to modify in the build cloud and make note of the VHD Blob Path for that image, which is the value for that corresponding key.
- You will need this URI path to copy into a new image.
- You will also need the storage account name which is labeled in AppVeyor as the Disk Storage Account Name
- Dans appveyor.yml, l'image est identifiée par la propriété image.
Get the Azure storage account key
- Log into Azure using credentials stored in LastPass (under Azure Enterprise) and then find the storage account corresponding to the name found in AppVeyor.
- Exemple, pour
appveyorlibccbuilds
Disk Storage Account Name you'd look forappveyorlibccbuilds
in the list of storage accounts @ Home < Storage Accounts- Click into it and look for
Access Keys
, and then you can use any of the keys present in the list.
- Click into it and look for
- Exemple, pour
- Log into Azure using credentials stored in LastPass (under Azure Enterprise) and then find the storage account corresponding to the name found in AppVeyor.
Obtenir l'URI complet de l'image de la machine virtuelle à partir d'Azure
- Accédez aux < de stockage <
$ACCT_NAME
< Blobs < Images- In the following list, look for the VHD path name you got from Appveyor and then click on it.
- Copiez l'URL entière depuis le haut de la fenêtre suivante.
- In the following list, look for the VHD path name you got from Appveyor and then click on it.
- Accédez aux < de stockage <
Copy the image using the Copy Master Image PowerShell script.
- It is essential to copy the VM because if you spin up a VM against an image that image cannot at the same time be used by AppVeyor.
- Use the storage account name, key, and URI obtained from Azure to run this script.
- See Step 3 for URI & when prompted, press enter to use same storage account as destination.
- Utiliser le nom du conteneur de destination par défaut
(images)
- En outre, lorsque vous nommez la copie, utilisez un nom qui indique ce que la nouvelle image contiendra (si cela a changé) et un horodatage.
- Ex.
libcc-20core-vs2017-15.9-2019-04-15.vhd
- Ex.
- Go into Azure and get the URI for the newly created image as described in a previous step
Spin up a new VM using the Create Master VM from VHD PowerShell.
- Depuis PowerShell, exécutez le fichier
ps1
avec./create_master_vm_from_vhd.ps1
- You will need the credential information available in the AppVeyor build cloud definition.
- Ceci comprend :
- Client ID
- Client Secret
- Tenant ID
- Subscription ID
- Resource Group
- Virtual Network
- Ceci comprend :
- Vous devrez également préciser
- Master VM name - just a unique name to identify the temporary VM
- Master VM size - use
Standard_F32s_v2
- Master VHD URI - use URI obtained @ end of previous step
- Location use
East US
- Depuis PowerShell, exécutez le fichier
Reconnectez-vous à Azure et trouvez la VM que vous venez de créer dans Home < Virtual Machines <
$YOUR_NEW_VM
- You can download a RDP (Remote Desktop) file to access the VM.
Using Microsoft Remote Desktop, click
Connect
to connect to the VM.- Credentials for logging into the VM are found in LastPass under the
AppVeyor Enterprise master VM
credentials.
- Credentials for logging into the VM are found in LastPass under the
Modifier la VM si nécessaire.
Shut down the VM and then delete it in Azure.
Add the new image to the Appveyor Cloud settings or modify an existing image to point to the new VHD.