Skip to content

Commit c9d467a

Browse files
committed
pulling changes from instruqt #292
1 parent 238d125 commit c9d467a

File tree

10 files changed

+602
-16
lines changed

10 files changed

+602
-16
lines changed

instruqt-tracks/building-quarkus-app-consuming-microsoftsql-server-running-on-redhat-enterprise-linux/01-01-quarkus-cli-setup/assignment.md

+4-9
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,14 @@ notes:
99
## Quarkus CLI Install
1010
In this lab we will install the Quarkus CLI in lab & with the help of Quarkus cli execute the CRUD application.
1111
tabs:
12-
- title: Terminal 1
12+
- id: 0aiebxebzrn7
13+
title: Terminal 1
1314
type: terminal
1415
hostname: rhel
15-
- title: Terminal 2
16+
- id: jasta1nvcosk
17+
title: Terminal 2
1618
type: terminal
1719
hostname: rhel
18-
- title: Terminal 3
19-
type: terminal
20-
hostname: rhel
21-
- title: Visual Editor
22-
type: code
23-
hostname: rhel
24-
path: /root
2520
difficulty: intermediate
2621
timelimit: 1000
2722
---
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
slug: join-red-hat-developer-portal
3+
id: pgt5v8qglym5
4+
type: challenge
5+
title: Join Red Hat Developer at no cost
6+
teaser: Join Red Hat Developer at no cost
7+
tabs:
8+
- id: fy7pisgvegbo
9+
title: Red Hat Login
10+
type: browser
11+
hostname: rhd-login
12+
difficulty: ""
13+
---
14+
Before you proceed with the next challenge, please take a moment to register for Red Hat Developer. If you already have a Red Hat account, you can use the same login credentials.
15+
16+
This will help us assess user satisfaction and enable us to provide more curated content.
17+
18+
Click on the `Check` button at the bottom once you have registered or logged in.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
set -euxo pipefail
3+
echo 'logincheck'
4+
if [ "${LOGGEDIN-0}" = "1" ]; then
5+
echo 'loggedin'
6+
exit 0
7+
fi
8+
9+
rm -f /home/user/checkResult.json
10+
rm -f /home/user/checkAssets.json
11+
rm -f /home/user/checkError.txt
12+
13+
14+
echo 'dropdown check'
15+
echo '{"location":{"conditions":[{"url":"redhat.com","condition":"contains"}]},"innerText":[{"selector":"html \u003e body","value":"Please click on Check button in the bottom right of your screen to continue with the Lab."}]}' > /home/user/checkAssets.json
16+
until [ -f /home/user/checkResult.json ]; do
17+
sleep 1
18+
done
19+
if grep "SUCCESS" /home/user/checkResult.json; then
20+
echo 'account dropdown'
21+
exit 0
22+
fi
23+
24+
25+
rm -f /home/user/checkResult.json
26+
rm -f /home/user/checkAssets.json
27+
rm -f /home/user/checkError.txt
28+
29+
30+
echo 'email check'
31+
echo '{"location":{"conditions":[]},"innerText":[{"selector":"html \u003e body","value":"Email address verification"}]}' > /home/user/checkAssets.json
32+
until [ -f /home/user/checkResult.json ]; do
33+
sleep 1
34+
done
35+
cat /home/user/checkResult.json
36+
if grep "SUCCESS" /home/user/checkResult.json; then
37+
echo 'email validation'
38+
exit 0
39+
fi
40+
fail-message "Please login and click 'Check' button."
41+
exit 1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
---
2+
slug: database-setup
3+
id: 6sd44wke013u
4+
type: challenge
5+
title: Topic 2 - Install Microsoft SQL Server on RHEL
6+
tabs:
7+
- id: dlp3mhtzkicv
8+
title: Terminal 1
9+
type: terminal
10+
hostname: rhel
11+
- id: 88lcxnryivgp
12+
title: Terminal 2
13+
type: terminal
14+
hostname: rhel
15+
difficulty: intermediate
16+
timelimit: 600
17+
---
18+
19+
20+
21+
## Microsoft SQL Server Installation & Setup
22+
23+
To begin with install Microsoft SQL Server on RHEL (locally), here are the steps to do it.
24+
25+
26+
27+
28+
2.1. **Install Microsoft SQL Server**
29+
30+
31+
32+
Download SQL Server Preview Red Hat repository configuration file.
33+
34+
35+
36+
```
37+
sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/8/mssql-server-2019.repo
38+
```
39+
40+
41+
42+
43+
Install Microssoft_sql server.
44+
45+
```
46+
sudo yum install -y mssql-server
47+
```
48+
49+
50+
51+
mssql-conf setup using its full path and follow the prompts to set the SA password and choose your edition.
52+
53+
```
54+
sudo /opt/mssql/bin/mssql-conf setup
55+
```
56+
57+
Select option **2**
58+
59+
Next, Type **yes** to accept the license terms and give the following password(2 Times).
60+
61+
```
62+
123@Redhat
63+
```
64+
65+
66+
67+
68+
69+
Verify whether the Microsoft_sql service is running or not.
70+
71+
```
72+
systemctl status mssql-server
73+
```
74+
75+
76+
77+
78+
SQL Server is now running on your RHEL machine and is ready to use!
79+
80+
81+
82+
83+
2.2. **Installation of Microsoft SQL CLI tool**
84+
85+
86+
87+
The following steps are to install the SQL Server command line tool that is an sqlcmd.
88+
89+
90+
91+
1. Download the Red Hat repository configuration file.
92+
93+
```
94+
sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/rhel/8/prod.repo
95+
```
96+
97+
98+
99+
2.Install mssql-tools with the unixODBC developer package
100+
101+
```
102+
sudo yum install -y mssql-tools unixODBC-devel
103+
```
104+
105+
To accept the license terms kindly type **yes**
106+
107+
3. add /opt/mssql-tools/bin/ to your PATH environment variable, to make sqlcmd or bcp accessible from the bash shell. Modify the PATH environment variable in your ~/.bash_profile file with the following command:
108+
109+
```
110+
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bashrc
111+
```
112+
```
113+
source ~/.bashrc
114+
```
115+
116+
117+
118+
119+
120+
121+
2.3. **Connect to Database locally**
122+
123+
Run the sqlcmd with parameters for your SQL Server IP/name (-S), username (-U), and password (-P). In this tutorial, you are connecting locally, so the server name is localhost. The user name is sa and the password is the one you provided for the SA account during setup.
124+
125+
```
126+
sqlcmd -S localhost -U sa -P '123@Redhat'
127+
```
128+
129+
130+
131+
Create a new Database
132+
133+
```
134+
CREATE DATABASE TestDB;
135+
```
136+
137+
write a query to return the name of all of the databases on the server.
138+
139+
```
140+
SELECT Name from sys.databases;
141+
```
142+
143+
144+
145+
146+
To execute the above queries write GO
147+
148+
```
149+
GO
150+
```
151+
152+
MicrosoftSQL is successfully installed & TestDB database creation done. Click on **Next** now.

0 commit comments

Comments
 (0)