Skip to content

Commit

Permalink
Merge pull request #4 from jpfulton:organize-linux-scripts
Browse files Browse the repository at this point in the history
Organize-linux-scripts
  • Loading branch information
jpfulton authored Aug 17, 2023
2 parents a5179df + 8f13ec8 commit affcbb1
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 18 deletions.
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"recommendations": [
"ms-azuretools.vscode-bicep",
"ms-vscode.powershell"
"ms-vscode.powershell",
"github.vscode-github-actions",
"github.vscode-pull-request-github",
"esbenp.prettier-vscode"
]
}
10 changes: 10 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"editor.tabSize": 2,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": [
"source.fixAll",
"source.organizeImports",
"source.sortMembers"
],
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
4 changes: 4 additions & 0 deletions linux-scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# linux-scripts

This folder contains scripts for remote execution on a Linux virtual machine
to update and configure the operating system.
4 changes: 4 additions & 0 deletions linux-scripts/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# core

Scripts in this folder perform core operating system configuration on a
remote Linux virtual machine.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions linux-scripts/spot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# spot

Scripts in this folder perform configuration of features that allow
graceful shutdown of a spot instance Linux server following an eviction
from Azure.
File renamed without changes.
File renamed without changes.
27 changes: 10 additions & 17 deletions scripts/create-linux-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,6 @@ scp-notifier-config () {
else
echo "WARN: Manual installation of notifier config will be required.";
fi
}

restart-vm () {
echo "Restarting VM to allow settings to take effect...";

az vm restart \
-g $RESOURCE_GROUP \
-n $SERVER_NAME;

echo "---";
echo;
Expand All @@ -281,24 +273,25 @@ main () {
login-to-admin-acct;

# copy setup scripts to server
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/update-base-packages.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/setup-firewall.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/setup-motd.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/setup-node-and-yarn.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/setup-sms-notifier.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/setup-eviction-shutdown-system.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/update-notifier-config.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/clean-up.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/core/update-base-packages.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/core/setup-firewall.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/core/setup-motd.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/core/setup-node-and-yarn.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/spot/setup-sms-notifier.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/spot/setup-eviction-shutdown-system.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/spot/update-notifier-config.sh;
scp-file-to-admin-home ${CURRENT_SCRIPT_DIR}../linux-scripts/core/clean-up.sh;

# execute remote setup scripts
echo "Executing base platform setup scripts...";
run-script-from-admin-home update-base-packages.sh;
run-script-from-admin-home setup-firewall.sh;
run-script-from-admin-home setup-motd.sh;
run-script-from-admin-home setup-node-and-yarn.sh;


if [ "$IS_SPOT" = "true" ]
then
echo "Executing spot instance setup scripts...";
run-script-from-admin-home setup-sms-notifier.sh;
scp-notifier-config;
run-script-from-admin-home setup-eviction-shutdown-system.sh;
Expand Down

0 comments on commit affcbb1

Please sign in to comment.