Exercises
- Deploy an asp.net core application on ubuntu Linux using chef
- Deploy a spring boot application to ubuntu Linux using chef
- Approach:
- Execute the manual steps
- Ensure manual steps are working
- Start writing the cookbook step by step and checking with test kitchen at every step.
- Manual Steps:
1 wget https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
2 sudo dpkg -i packages-microsoft-prod.deb
3 sudo apt-get update
4 sudo apt-get install apt-transport-https aspnetcore-runtime-3.1
5 dotnet --list-runtimes
6 sudo apt-get install nginx -y
7 vi /etc/nginx/sites-available/default
8 sudo vi /etc/nginx/sites-available/default
9 sudo mkdir /var/www/nopCommerce440
10 cd /var/www/nopCommerce440
11 sudo wget https://github.com/nopSolutions/nopCommerce/releases/download/release-4.40.3/nopCommerce_4.40.3_NoSource_linux_x64.zip
12 sudo apt-get install unzip
13 sudo unzip nopCommerce_4.40.3_NoSource_linux_x64.zip
14 ls
15 sudo mkdir bin
16 sudo mkdir logs
17 cd ..
18 sudo chgrp -R www-data nopCommerce440/
19 sudo chown -R www-data nopCommerce440/
20 sudo vi /etc/systemd/system/nopCommerce440.service
21 sudo systemctl start nopCommerce440.service
22 sudo systemctl status nopCommerce440.service
23 sudo systemctl restart nginx
24 history
- Refer Here for the cookbook developed in the class and try to complete the cookbook by finishing the below steps
archive_file 'unzip_nop' do
path nop_download_temp_location
destination nop_home_dir
action :extract
# create a notification to change group permissions
end
# write a resource to change group permissions
# copy the service template file
# enable and start the nop commerce service
# When service file is copied restart nginx
