Skip to content

Commit

Permalink
[FIX] bugs fixed "Jenkins O'rnatish"
Browse files Browse the repository at this point in the history
  • Loading branch information
ismoilovdevml committed Jan 9, 2024
1 parent 438b80c commit c00dfd8
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 44 deletions.
6 changes: 6 additions & 0 deletions pages/guides/ci-cd/_meta.en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,11 @@
"icon": "▶️",
"description": "Github Actionda Android CI/CD",
"href": "/guides/ci-cd/android-github-actions"
},
"jenkins-docker-ci-cd": {
"title": "Jenkins bilan Docker CI/CD",
"icon": "▶️",
"description": "Docker image build qilib deploy qilish",
"href": "/guides/ci-cd/jenkins-docker-ci-cd"
}
}
2 changes: 2 additions & 0 deletions pages/guides/ci-cd/jenkins-docker-ci-cd.en-US.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
## Koddan Servergacha: Jenkins bilan Docker CI/CD

137 changes: 93 additions & 44 deletions pages/guides/ci-cd/jenkins-ornatish.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,75 +13,80 @@ Jenkins turli xil operatsion tizimlarga, jumladan Linux, macOS va Windows-ga o'r

<Callout type="info" emoji="">
Jenkins instalerlari bir nechta Linux distributivlari uchun mavjud.
* Debian/Ubuntu
* Fedora
* Red Hat/Alma/Rocky
* **Debian/Ubuntu**
* **Fedora**
* **Red Hat/Alma/Rocky**
</Callout>

### Talablar
**Talablar**

Minimal qurilma talablari:

* 256 MB operativ xotira(RAM)
* 1 GB disk maydoni (garchi Jenkins Docker konteyneri sifatida ishlayotgan bo'lsa, kamida 10 GB tavsiya etiladi)
* **256 MB** operativ xotira(RAM)
* **1 GB** disk maydoni (garchi Jenkins Docker konteyneri sifatida ishlayotgan bo'lsa, kamida **10 GB** tavsiya etiladi)

#### Kichik jamoa uchun tavsiya etilgan qurilma konfiguratsiyasi:
**Kichik jamoa uchun tavsiya etilgan qurilma konfiguratsiyasi:**

* 4 GB+ RAM
* 50 GB+ disk maydoni
* **4 GB+** RAM
* **50 GB+** disk maydoni

## Debian/Ubuntu
## Debian/Ubuntu'ga Jenkins o'rnatish

Ubuntu kabi Debian va Debian-ga asoslangan distributivlarda siz Jenkins-ni `apt` orqali o'rnatishingiz mumkin.

## Java o'rnatish
**1-> Java o'rnatish**

Jenkins ishga tushirish uchun Java-ni talab qiladi, ammo ba'zi distributivlar standart bo'yicha buni o'z ichiga olmaydi va ba'zi Java versiyalari Jenkins bilan mos kelmaydi.
Jenkins ishga tushirish uchun **Java**-ni talab qiladi, ammo ba'zi distributivlar default holda buni o'z ichiga olmaydi va ba'zi Java versiyalari Jenkins bilan mos kelmaydi.

Siz foydalanishingiz mumkin bo'lgan bir nechta Java ilovalari mavjud. OpenJDK hozirda eng ommabop, biz undan ushbu qo'llanmada foydalanamiz.
Siz foydalanishingiz mumkin bo'lgan bir nechta Java ilovalari mavjud. **OpenJDK** hozirda eng ommabop, biz undan ushbu qo'llanmada foydalanamiz.

Debian apt repositoriyalarini yangilang, OpenJDK 17 ni o'rnating va buyruqlar bilan o'rnatishni tekshiring:
Debian apt repositoriyalarini yangilang, **OpenJDK 17** ni o'rnating va buyruqlar bilan o'rnatishni tekshiring:

```bash
sudo apt update
sudo apt install openjdk-17-jre
sudo apt install fontconfig openjdk-17-jre -y
java -version
```

### Uzoq muddatli qo'llab-quvvatlash versiyasi(LTS Long Term Support release)
**2->** Uzoq muddatli qo'llab-quvvatlash versiyasi(**LTS** **L**ong **T**erm **S**upport release)

LTS (Uzoq muddatli qo'llab-quvvatlash) versiyasi har 12 haftada muntazam releaselar oqimidan o'sha vaqt uchun barqaror release sifatida tanlanadi. U debian-stable apt repositorydan o'rnatilishi mumkin.
**LTS** (Uzoq muddatli qo'llab-quvvatlash) versiyasi har 12 haftada muntazam releaselar oqimidan o'sha vaqt uchun barqaror release sifatida tanlanadi. U debian-stable apt repositorydan o'rnatilishi mumkin.

```bash
curl -fsSL https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian-stable/jenkins.io-2023.key
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian-stable binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get install jenkins -y
```

### Haftalik Release
**3->** Haftalik Release(ixtiyoriy)

Foydalanuvchilar va plaginlarni ishlab chiquvchilarga xatolarni tuzatish va xususiyatlarni yetkazib berish uchun har hafta yangi release chiqariladi. Uni debian apt repositorydan o'rnatishingiz mumkin.

```bash
curl -fsSL https://pkg.jenkins.io/debian/jenkins.io-2023.key | sudo tee \
/usr/share/keyrings/jenkins-keyring.asc > /dev/null
sudo wget -O /usr/share/keyrings/jenkins-keyring.asc \
https://pkg.jenkins.io/debian/jenkins.io-2023.key
echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] \
https://pkg.jenkins.io/debian binary/ | sudo tee \
/etc/apt/sources.list.d/jenkins.list > /dev/null
sudo apt-get update
sudo apt-get install jenkins
sudo apt-get install jenkins -y
```


## Fedora
## Fedora'ga Jenkins o'rnatish

**1->** Java o'rnatish

```bash
sudo dnf install java-17-openjdk -y
```
Jenkins-ni `dnf` orqali o'rnatishingiz mumkin. Avval Jenkins veb-saytidan Jenkins repositoryni paket menejeriga qo'shishingiz kerak.

### Uzoq muddatli qo'llab-quvvatlash versiyasi(LTS Long Term Support release)
**2->** Uzoq muddatli qo'llab-quvvatlash versiyasi(**LTS** **L**ong **T**erm **S**upport release)

LTS (Uzoq muddatli qo'llab-quvvatlash) versiyasi har 12 haftada muntazam releaselar oqimidan o'sha vaqt uchun barqaror release sifatida tanlanadi. Uni `redhat-stable` yum repositorydan o'rnatish mumkin.

Expand All @@ -90,14 +95,11 @@ sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
sudo dnf upgrade
# Jenkins package uchun kerakli dependensylarni qo'shing
sudo dnf install java-17-openjdk
sudo dnf install jenkins
sudo dnf install jenkins -y
sudo systemctl daemon-reload

```

### Haftalik Release
**3->** Haftalik Release(ixtiyoriy)

Foydalanuvchilar va plaginlarni ishlab chiquvchilarga xatolarni tuzatish va xususiyatlarni yetkazib berish uchun har hafta yangi release chiqariladi. Uni redhat yum repositoriyadan o'rnatish mumkin.

Expand All @@ -106,9 +108,43 @@ sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key
sudo dnf upgrade
# Jenkins package uchun kerakli dependensylarni qo'shing
sudo dnf install java-17-openjdk
sudo dnf install jenkins
sudo dnf install jenkins -y
```

## Red Hat/Alma/Rocky'ga Jenkins o'rnatish
Siz **Jenkins**-ni **yum** orqali **Red Hat Enterprise Linux, Alma Linux, Rocky Linux, Oracle Linux** va boshqa **Red Hat**-ga asoslangan distributivlarga o'rnatishingiz mumkin.

Siz Jenkins **Long Term Support** releaseni yoki Jenkins haftalik versiyasini tanlashingiz kerak.

**1->** Jenkins uchun Java o'rnatish

```bash
sudo yum upgrade
sudo yum install fontconfig java-17-openjdk -y
java -version
```
**2->** Uzoq muddatli qo'llab-quvvatlash versiyasi(**LTS** **L**ong **T**erm **S**upport release)
LTS (Uzoq muddatli qo'llab-quvvatlash) versiyasi har 12 haftada muntazam releaselar oqimidan o'sha vaqt uchun barqaror release sifatida tanlanadi. Uni `redhat-stable` yum repositorydan o'rnatish mumkin.

```bash
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat-stable/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key
sudo yum upgrade
sudo yum install jenkins -y
sudo systemctl daemon-reload
```

**3->** Haftalik Release(ixtiyoriy)

Foydalanuvchilar va plaginlarni ishlab chiquvchilarga xatolarni tuzatish va xususiyatlarni yetkazib berish uchun har hafta yangi release chiqariladi. Uni redhat yum repositoriyadan o'rnatish mumkin.

```bash
sudo wget -O /etc/yum.repos.d/jenkins.repo \
https://pkg.jenkins.io/redhat/jenkins.repo
sudo rpm --import https://pkg.jenkins.io/redhat/jenkins.io-2023.key
sudo yum upgrade
sudo yum install jenkins -y
```

## Jenkinsni ishga tushirish
Expand All @@ -127,22 +163,22 @@ Yuqoridagi protseduralardan biri yordamida Jenkinsni yuklab olish, o'rnatish va

Ushbu wizard setup sizni Jenkins qulfini ochish, uni plaginlar bilan sozlash va Jenkins-ga kirishni davom ettirishingiz mumkin bo'lgan birinchi administrator foydalanuvchisini yaratish uchun bir necha tezkor "bir martalik("one-off")" bosqichlardan o'tadi.

#### Jenkins qulfini ochish
**1->** Jenkins qulfini ochish


Yangi Jenkins misoliga birinchi marta kirganingizda, uni avtomatik ravishda yaratilgan parol yordamida qulfdan chiqarish so'raladi.

1. http://localhost:8080 (yoki uni oʻrnatishda Jenkins uchun qaysi portni sozlagan boʻlsangiz) sahifasini koʻrib chiqing va `Unlock Jenkins` sahifasi paydo boʻlguncha kuting.
**2->** http://localhost:8080 (yoki uni oʻrnatishda Jenkins uchun qaysi portni sozlagan boʻlsangiz) sahifasini koʻrib chiqing va `Unlock Jenkins` sahifasi paydo boʻlguncha kuting.


![jenkins](/images/ci-cd/1.jpg)

parolni ko'rish uchun jenkisn parol qayerda turganini ko'rsatib parol fayliga yo'l ko'rstaib qo'yadi yani `/var/lib/jenkins/secrets/initialAdminPassword`. parolni olish quyidagi buyruqdan foydalanamiz.
**2->** parolni ko'rish uchun jenkins parol qayerda turganini ko'rsatib parol fayliga yo'l ko'rstaib qo'yadi yani `/var/lib/jenkins/secrets/initialAdminPassword`. parolni olish quyidagi buyruqdan foydalanamiz.

```bash
sudo cat /var/lib/jenkins/secrets/initialAdminPassword
```
BU buyruq `sudo cat /var/lib/jenkins/secrets/initialAdminPassword` parolni konsolda chop etadi.
Bu buyruq `sudo cat /var/lib/jenkins/secrets/initialAdminPassword` parolni konsolda chop etadi.

Agar siz Jenkins-ni Docker-da rasmiy jenkins/jenkins imagedan foydalanib ishlayotgan bo'lsangiz, quyidagi buyruqdan foydalanib, parolni konteynerga kiritmasdan turib konsolda chop etishingiz mumkin.

Expand All @@ -155,24 +191,37 @@ Keyingi ekranda tavsiya etilgan plaginlarni o'rnatish yoki maxsus plaginlarni ta

![jenkins](/images/ci-cd/2.png)

Biz `suggested plugins` opsiyasini bosamiz, bu darhol o'rnatish jarayonini boshlaydi.
**3->** Biz `suggested plugins` opsiyasini bosamiz, bu darhol o'rnatish jarayonini boshlaydi.

![jenkins](/images/ci-cd/3.png)

O'rnatish tugallangach, sizdan birinchi `Admin User` o'rnatish so'raladi. Bu bosqichni oʻtkazib yuborish va yuqoridagi boshlangʻich parol yordamida administrator sifatida davom etish mumkin, lekin foydalanuvchi yaratishga biroz vaqt ajratamiz.
**4->** O'rnatish tugallangach, sizdan birinchi `Admin User` o'rnatish so'raladi. Bu bosqichni oʻtkazib yuborish va yuqoridagi boshlangʻich parol yordamida administrator sifatida davom etish mumkin, lekin foydalanuvchi yaratishga biroz vaqt ajratamiz.

![jenkins](/images/ci-cd/4.png)

Siz Jenkins instance uchun afzal qilingan URL manzilini tasdiqlashingizni so'raydigan Instance Configuration sahifasini olasiz. Serveringiz uchun domen nomini yoki serveringizning IP manzilini tasdiqlang:
**5->** Siz Jenkins instance uchun afzal qilingan URL manzilini tasdiqlashingizni so'raydigan Instance Configuration sahifasini olasiz. Serveringiz uchun domen nomini yoki serveringizning IP manzilini tasdiqlang:

![jenkins](/images/ci-cd/5.png)

Tegishli ma'lumotlarni tasdiqlaganingizdan so'ng, `Save and Finish` tugmasini bosing. Siz `"Jenkins is Ready!"` degan tasdiqlash sahifasini olasiz:
**6->** Tegishli ma'lumotlarni tasdiqlaganingizdan so'ng, `Save and Finish` tugmasini bosing. Siz `"Jenkins is Ready!"` degan tasdiqlash sahifasini olasiz:

![jenkins](/images/ci-cd/6.png)

Asosiy Jenkins boshqaruv paneliga tashrif buyurish uchun `Start using Jenkins` tugmasini bosing:
**7->** Asosiy Jenkins boshqaruv paneliga tashrif buyurish uchun `Start using Jenkins` tugmasini bosing:

![jenkins](/images/ci-cd/8.png)

Shu nuqtada siz Jenkins-ni muvaffaqiyatli o'rnatdingiz.
**Shu nuqtada siz Jenkins-ni muvaffaqiyatli o'rnatdingiz.**

## Qo'shimcha

<Callout type="info" emoji="">

**Foydalanilgan manbalar:** [www.jenkins.io](https://www.jenkins.io/doc/book/installing/linux/)

**Sana:** 2023.11.19(2023-yil 19-noyabr)

**Oxirgi yangilanish:** 2024.01.09(2024-yil 9-yanvar)

**Muallif: Otabek Ismoilov**
</Callout>

0 comments on commit c00dfd8

Please sign in to comment.