Skip to content

Commit f9f9e30

Browse files
authored
Use local SSD for work and temp dirs (dotnet#16)
* Also cleaned up existing sed commands
1 parent 8432aa8 commit f9f9e30

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

BuildAgent/SetupScripts/BuildAgentSetup_Ubuntu.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,16 @@ cd ~/TeamCity/conf
7070
cp buildAgent.dist.properties buildAgent.properties
7171

7272
# Set the build agent name and CI server urls
73-
sed -i "s/name=.*/name=$AGENTNAME/" buildAgent.properties
74-
sed -i "s#serverUrl=.*#serverUrl=$SERVERURL#g" buildAgent.properties
73+
sed -i "s|^name=.*|name=$AGENTNAME|" buildAgent.properties
74+
sed -i "s|^serverUrl=.*|serverUrl=$SERVERURL|" buildAgent.properties
75+
76+
# Use the local SSD (/mnt) for the work and temp dirs.
77+
# * It should be as fast or faster than the OS disk (which is backed by blob storage).
78+
# * It reduces load and storage on the OS disk.
79+
# * The data on the local SSD may lost at any time (typically after a reboot), but this
80+
# should be fine for the work and temp dirs.
81+
sed -i "s|^workDir=.*|workDir=/mnt/work|" buildAgent.properties
82+
sed -i "s|^tempDir=.*|tempDir=/mnt/temp|" buildAgent.properties
7583

7684
echo >> buildAgent.properties # append a new line
7785
echo "system.aspnet.os.name=$ASPNETOSNAME" >> buildAgent.properties

0 commit comments

Comments
 (0)