From 1a3945d52cebd90f7de2ff4e0e8068b6bcd6008b Mon Sep 17 00:00:00 2001 From: Darii Nurgaleev <50947177+Darleev@users.noreply.github.com> Date: Tue, 6 Apr 2021 20:22:28 +0700 Subject: [PATCH] Update documentation for post-deployment scripts. (#3070) --- help/CreateImageAndAzureResources.md | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/help/CreateImageAndAzureResources.md b/help/CreateImageAndAzureResources.md index b3dd36e20..d9a4dacec 100644 --- a/help/CreateImageAndAzureResources.md +++ b/help/CreateImageAndAzureResources.md @@ -124,3 +124,40 @@ Generated tool versions and details can be found in related projects: - [Go](https://github.com/actions/go-versions) - [Node](https://github.com/actions/node-versions) - [Boost](https://github.com/actions/boost-versions) + +### Post-generation scripts +The user, created during the image generation, does not exist in the result VHD hence some configuration files related to the user's home directory need to be changed as well as the file permissions for some directories. Scripts for that are located in the `post-generation` folder in the repository: +- Windows: https://github.com/actions/virtual-environments/tree/main/images/win/post-generation +- Linux: https://github.com/actions/virtual-environments/tree/main/images/linux/post-generation + +The scripts are copied to the VHD during the image generation process to the following paths: +- Windows: `C:\post-generation` +- Linux: `/opt/post-generation` + +#### Running scripts + +##### Ubuntu + + find /opt/post-generation -mindepth 1 -maxdepth 1 -type f -name '*.sh' -exec bash {} \; + +##### Windows + + Get-ChildItem C:\post-generation -Filter *.ps1 | ForEach-Object { & $_.FullName } + +#### Script details + +##### Ubuntu + +- **cleanup-logs.sh** - removes all build process logs from the machine +- **environment-variables.sh** - replaces `$HOME` with the default user's home directory for environmental variables related to the default user home directory +- **homebrew-permissions.sh** - Resets homebrew repository directory by running `git reset --hard` to make the working tree clean after chmoding /home and changes the repository directory owner to the current user +- **rust-permissions.sh** - fixes permissions for the Rust folder. Detailed issue explanation is provided in [virtual-environments/issues/572](https://github.com/actions/virtual-environments/issues/572). + +##### Windows + +- **Choco.ps1** - contains dummy command to cleanup orphaned packages to avoid initial delay for future choco commands +- **Dotnet.ps1** - adds `$env:USERPROFILE\.dotnet\tools` directory to the PATH +- **InternetExplorerConfiguration** - turns off the Internet Explorer Enhanced Security feature +- **Msys2FirstLaunch.ps1** - initializes bash user profile in MSYS2 +- **RustJunction.ps1** - creates Rust junction points to cargo and rustup folders +- **VSConfiguration.ps1** - performs initial Visual Studio configuration