Executing a script
See original GitHub issueI have a few questions, because the current documentation seemed a bit thin. I’d like to deploy a VM and an Azure SQL database by Farmer. Very basic software architecture. For that, I need to execute a few scripts:
-
Virtual Machine,
- Execute cmd/bat/shell-script. That is possible, but can that be done by Farmer?
- Install Chocolatey
@powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
- Install a few programs like
choco install dotnet4.7.2 -y
- A way to transfer a few files. By installing SSH I guess?
- Configure Windows firewall, e.g.:
netsh advfirewall firewall add rule name="Open Port HTTPS" dir=in action=allow protocol=TCP localport=443
- Install certificate (
certutil
) and apply certificate to the port:netsh http add sslcert ipport=0.0.0.0:443 certhash=123abc... appid=abc124...
- Create a service
sc create MyService binPath= c:\path\myservice.exe
- …and set it to auto-start:
sc config "MyService" start= auto
- Install Chocolatey
- I also need to configure the Azure side
Network interface
for the VM, I couldn’t find Farmer command for that. - Set a static IP for VM. I guess this is already supported.
- Execute cmd/bat/shell-script. That is possible, but can that be done by Farmer?
-
Deploy the Azure Database.
- Create a new login.
- Execute an *.sql-script that creates the tables, and inserts some basic data. Azure supports that, but can that be done with Farmer?
- For the database version control, I’m using VisualStudio SQL Server Database Project (*.sqlproj). Is that messing my architecture-as-code?
What is the preferred way to do these with Farmer?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
How to execute a shell script in Linux
Step 1 – Open the terminal · Step 2 – Write the shell script using an editor · Step 3 – Make the...
Read more >How To Run the .sh File Shell Script In Linux / UNIX
Type the following command cd /home/username/Desktop/scripts (again substituting the actual user name in place of username). The command ls and ...
Read more >How To Execute a Command with a Shell Script in Linux
Creating and Running a Basic Shell Script · Press ESC · Type : (colon character) · Type wq · Press ENTER.
Read more >How to Run a Shell Script in Linux [Essentials Explained]
Method 1: Running a shell script by passing the file as argument to shell. The first method involves passing the script file name...
Read more >SH - Bash Shell Script File
Open the Linux terminal and go to the directory where the SH file is located. · By Using chmod command, set execute permission...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
VMs
Databases
Database version control and deployments are a separate concern to Farmer - it shouldn’t impact infrastucture-as-code at all (indeed, we’re using dbprojects right now with Farmer - it should just work.
This has now been released.