Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added 2 new labs - working with UBI9 images & SELinux #284

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ tabs:
- title: Terminal 2
type: terminal
hostname: rhel
- title: Terminal 3
type: terminal
hostname: rhel
- title: Visual Editor
type: code
hostname: rhel
path: /root
difficulty: intermediate
timelimit: 1000
---
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
slug: join-red-hat-developer-portal
id: pgt5v8qglym5
type: challenge
title: Join Red Hat Developer at no cost
teaser: Join Red Hat Developer at no cost
tabs:
- title: Red Hat Login
type: browser
hostname: rhd-login
difficulty: ""
---
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.

This will help us assess user satisfaction and enable us to provide more curated content.

Click on the `Check` button at the bottom once you have registered or logged in.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
set -euxo pipefail
echo 'logincheck'
if [ "${LOGGEDIN-0}" = "1" ]; then
echo 'loggedin'
exit 0
fi

rm -f /home/user/checkResult.json
rm -f /home/user/checkAssets.json
rm -f /home/user/checkError.txt


echo 'dropdown check'
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
until [ -f /home/user/checkResult.json ]; do
sleep 1
done
if grep "SUCCESS" /home/user/checkResult.json; then
echo 'account dropdown'
exit 0
fi


rm -f /home/user/checkResult.json
rm -f /home/user/checkAssets.json
rm -f /home/user/checkError.txt


echo 'email check'
echo '{"location":{"conditions":[]},"innerText":[{"selector":"html \u003e body","value":"Email address verification"}]}' > /home/user/checkAssets.json
until [ -f /home/user/checkResult.json ]; do
sleep 1
done
cat /home/user/checkResult.json
if grep "SUCCESS" /home/user/checkResult.json; then
echo 'email validation'
exit 0
fi
fail-message "Please login and click 'Check' button."
exit 1
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ tabs:
- title: Terminal 2
type: terminal
hostname: rhel
- title: Terminal 3
type: terminal
hostname: rhel
- title: Visual Editor
type: code
hostname: rhel
path: /root
difficulty: intermediate
timelimit: 600
---
Expand Down Expand Up @@ -79,12 +72,6 @@ systemctl status mssql-server



open the SQL Server port on the RHEL firewall. The default SQL Server port is TCP 1433. If you're using FirewallD for your firewall.

```
sudo firewall-cmd --zone=public --add-port=1433/tcp --permanent
sudo firewall-cmd --reload
```

SQL Server is now running on your RHEL machine and is ready to use!

Expand Down Expand Up @@ -113,7 +100,7 @@ sudo curl -o /etc/yum.repos.d/msprod.repo https://packages.microsoft.com/config/
sudo yum install -y mssql-tools unixODBC-devel
```


To accept the license terms kindly type **yes**

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:

Expand Down
53 changes: 12 additions & 41 deletions ...se-linux/03-quarkus-project/assignment.md → ...se-linux/04-quarkus-project/assignment.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ tabs:
- title: Terminal 2
type: terminal
hostname: rhel
- title: Terminal 3
type: terminal
hostname: rhel
- title: Visual Editor
type: code
hostname: rhel
path: /root
difficulty: intermediate
timelimit: 1000
---
Expand All @@ -28,7 +21,7 @@ timelimit: 1000



**### 3.1. CRUD Application Flow Diagram**
### **3.1. CRUD Application Flow Diagram**



Expand All @@ -42,7 +35,7 @@ timelimit: 1000



**## 3.2. Quarkus App API Connectivity with Database**
## **3.2. Quarkus App API Connectivity with Database**



Expand All @@ -61,18 +54,12 @@ Following is a snapshot of quarkus project directory.



**### 3.3. Run the application**
### **3.3. Run the application**



Clone the following Git repository in the **Terminal 1** window to create the CRUD quarkus project.

Install the git first

```
yum install git -y
```

```
git clone https://github.com/redhat-developer-demos/quarkus-crud-mssql.git
```
Expand All @@ -83,14 +70,10 @@ To run quarkus application you have to first check out on application folder whi


```
cd quarkus-crud-mssql
cd quarkus-crud-mssql && quarkus dev
```

After this, you have to run a command with help of quarkus CLI

```
quarkus dev
```

![](https://lh5.googleusercontent.com/FngStSZxP8kiqNz5gUM10eTDYwFjOqXRD17GSQN07UjysAJhOlbzL6-lyEXmoeF4swnWYJ4UvE2jhyiahaEPw4lf0FgqV-GjBvWOrhFw4D04pGwk0ZnrugQsyKBZAMHZ2criS0pjDh5ipz4_9LXS3HAWHucuxTfsFQPtxLwdE7lYr39MNuIcWXZsEufh)

Expand All @@ -101,15 +84,17 @@ When in the terminal you will get the output like shown above. You are good to

**Open Terminal 2**

Let's install http cli


1. ### Create a new person

```
sudo pip3 install httpie
http POST :8080/person firstName=Carlos lastName=Santana salutation=Mr
```

![](https://lh4.googleusercontent.com/tGIyb5psKftQSsZfvNuNwfAf71nyEzKVJCYBZiQj0GZRNGEoo4s0n3YSUb1YXFdC4t3CLy9WkatIKkD3odYOlLvpeB65eNKCFAWPeK98K5362gP5oZZ0msq65kx_QcnBEvG2U-qHVlDAXo9Qhzk6JsEZ4H0lsL9uzbfMgADyVOJGSfjMc4y90OHbt-ms)


### List a new person
2. ### List a person


```
Expand All @@ -125,20 +110,8 @@ http :8080/person



### Create a new person

```
http POST :8080/person firstName=Carlos lastName=Santana salutation=Mr
```

![](https://lh4.googleusercontent.com/tGIyb5psKftQSsZfvNuNwfAf71nyEzKVJCYBZiQj0GZRNGEoo4s0n3YSUb1YXFdC4t3CLy9WkatIKkD3odYOlLvpeB65eNKCFAWPeK98K5362gP5oZZ0msq65kx_QcnBEvG2U-qHVlDAXo9Qhzk6JsEZ4H0lsL9uzbfMgADyVOJGSfjMc4y90OHbt-ms)






### Updating an existing person
3. ### Updating an existing person

```
http PUT :8080/person/1 firstName=Jimi lastName=Hendrix
Expand All @@ -157,7 +130,7 @@ http PUT :8080/person/1 firstName=Jimi lastName=Hendrix



### Deleting an existing person
4. ### Deleting an existing person

```
http DELETE :8080/person/1
Expand All @@ -169,8 +142,6 @@ http DELETE :8080/person/1
![](https://lh5.googleusercontent.com/GoieZ_esZkVBDnc22SR0uR_kJ_Kbsx6nE90xENZ4LTmvp2aegzT096N78evYVWsKoqv9VQ-lZZyg3hufOpMajHQGmoe_ULB4d05jebdajHLahjlXWnNSAagjTBOOVEMPK6RyQStogjybaLAlEoloEz4Z1gb6ZQvrcQHeqcWZiNF2giKkfEJ9E7jBO2d4)


**Open Terminal 3**



Now with help of API we created, deleted & updated the database. To check all changes are reflected in the database we have to cross-verify. For that Please follow the below steps.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
yum install git -y
pip3 install httpie
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,6 @@ tabs:
- title: Terminal 2
type: terminal
hostname: rhel
- title: Terminal 3
type: terminal
hostname: rhel
- title: Visual Editor
type: code
hostname: rhel
path: /root
difficulty: intermediate
timelimit: 300
---
Expand All @@ -26,13 +19,9 @@ timelimit: 300
### 4. Containerize the Quarkus App using Podman


With the help of podman, we will containerize the quarkus application so that it becomes more portable and ready to be deployed on Kubernetes (OpenShift).
With the help of podman, we will containerize the quarkus application so that it becomes more portable and ready to be deployed on Podman / Kubernetes (OpenShift).

Install podman by using following command

```
dnf install podman -y
```

For that, we need to first create an image of it. Before creating a container image, we need to run one maven command which creates all the dependency files we want while creating the image.

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
dnf install podman -y
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
version: "3"
virtualbrowsers:
- name: rhd-login
url: https://developers.redhat.com/node/284339?auHash=5k9QV-yD0z-jAU7XkJyq1TUxhVyyZVLiuZz7tsfTz_s&offerid=3882355
virtualmachines:
- name: rhel
image: rhel-cloud/rhel-8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
slug: building-quarkus-app-consuming-microsoftsql-server-running-on-redhat-enterprise-linux
id: b3dmslfwtbit
title: Building Quarkus App consuming Microsoft SQL Server running on Red Hat Enterprise Linux
title: Building Quarkus App consuming Microsoft SQL Server running on Red Hat Enterprise
Linux
description: |2+

# What is Quarkus?
Expand All @@ -15,13 +16,21 @@ description: |2+
icon: https://logodix.com/logo/1910931.png
level: beginner
tags:
- quarkus
- crud_app
- podman
- rhel
- openshift
- ' quarkus'
- ' podman'
- ' microsoftsql'
- ' rhel '
- 'crud_app '
- microsoftsql
owner: openshift
developers:
- [email protected]
checksum: "11483997414110959927"
- [email protected]
- [email protected]
lab_config:
overlay: false
width: 33
position: right
feedback_recap_enabled: true
loadingMessages: true
checksum: "1543719117577499336"
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
slug: join-red-hat-developer-portal
id: 4hgm3l0ym300
type: challenge
title: Join Red Hat Developer at no cost
teaser: Join Red Hat Developer at no cost
tabs:
- title: Red Hat Login
type: browser
hostname: rhd-login
difficulty: ""
---
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.

This will help us assess user satisfaction and enable us to provide more curated content.

Click on the `Check` button at the bottom once you have registered or logged in.
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash
set -euxo pipefail
echo 'logincheck'
if [ "${LOGGEDIN-0}" = "1" ]; then
echo 'loggedin'
exit 0
fi

rm -f /home/user/checkResult.json
rm -f /home/user/checkAssets.json
rm -f /home/user/checkError.txt


echo 'dropdown check'
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
until [ -f /home/user/checkResult.json ]; do
sleep 1
done
if grep "SUCCESS" /home/user/checkResult.json; then
echo 'account dropdown'
exit 0
fi


rm -f /home/user/checkResult.json
rm -f /home/user/checkAssets.json
rm -f /home/user/checkError.txt


echo 'email check'
echo '{"location":{"conditions":[]},"innerText":[{"selector":"html \u003e body","value":"Email address verification"}]}' > /home/user/checkAssets.json
until [ -f /home/user/checkResult.json ]; do
sleep 1
done
cat /home/user/checkResult.json
if grep "SUCCESS" /home/user/checkResult.json; then
echo 'email validation'
exit 0
fi
fail-message "Please login and click 'Check' button."
exit 1
Loading
Loading