-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
923a094
commit 16a8993
Showing
12 changed files
with
164 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Выполнено ДЗ № | ||
|
||
- [ ] Основное ДЗ | ||
- [ ] Задание со * | ||
|
||
## В процессе сделано: | ||
- Пункт 1 | ||
- Пункт 2 | ||
|
||
## Как запустить проект: | ||
- Например, запустить команду X в директории Y | ||
|
||
## Как проверить работоспособность: | ||
- Например, перейти по ссылке http://localhost:8080 | ||
|
||
## PR checklist | ||
- [ ] Выставил label с номером домашнего задания | ||
- [ ] Выставил label с темой домашнего задания |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Set to true to add assignees to pull requests | ||
addAssignees: true | ||
|
||
# A list of reviewers to be added to pull requests (GitHub user name) | ||
reviewers: | ||
- mrgreyves |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
name: 'Auto Assign' | ||
on: pull_request | ||
|
||
jobs: | ||
add-reviews: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: kentaro-m/[email protected] | ||
with: | ||
repo-token: '${{ secrets.GITHUB_TOKEN }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Run tests for OTUS homework | ||
|
||
on: | ||
push: | ||
branches-ignore: main | ||
pull_request: | ||
branches-ignore: main | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout this repo | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.ref }} | ||
- name: Checkout repo with tests | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: "express42/otus-homeworks" | ||
ref: 2023-03 | ||
path: "./otus-homeworks/" | ||
|
||
- name: Run tests | ||
run: curl https://raw.githubusercontent.com/express42/otus-homeworks/2023-03/run.sh | bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
.idea/ | ||
poetry.lock | ||
pyproject.toml | ||
packer/variables.json | ||
*.tfstate | ||
*.tfstate.*.backup | ||
*.tfstate.backup | ||
*.tfvars | ||
.terraform/ | ||
*.retry | ||
**/roles/jdauphantnginx/* | ||
jdauphant.nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.3.0 | ||
hooks: | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,45 @@ | ||
# Baykanurov_microservices | ||
Baykanurov microservices repository | ||
|
||
## Docker-2 | ||
### Что было сделано: | ||
1. Установка Docker (уже был Docker Desktop, работаю на WSL2) | ||
2. Выполнено знакомство с основными командами Docker | ||
3. Результат команды `docker images` был сохранен в `docker-monolith/docker-1.log` | ||
4. Yandex Cloud CLI был установлен раннее | ||
5. Установка Docker machine v0.16.2 | ||
```shell | ||
sudo curl -o /usr/local/bin/docker-machine -L https://github.com/docker/machine/releases/download/v0.16.2/docker-machine-`uname -s`-`uname -m` && \ | ||
sudo chmod +x /usr/local/bin/docker-machine | ||
``` | ||
6. Создан инстанс | ||
```shell | ||
yc compute instance create \ | ||
--name docker-host \ | ||
--zone ru-central1-a \ | ||
--network-interface subnet-name=default-ru-central1-a,nat-ip-version=ipv4 \ | ||
--create-boot-disk image-folder-id=standard-images,image-family=ubuntu-2004-lts,size=15 --preemptible --cores=2 \ | ||
--ssh-key ~/.ssh/id_ed25519.pub | ||
``` | ||
7. Инициализировано окружение Docker | ||
```shell | ||
docker-machine --debug create \ | ||
--driver generic \ | ||
--generic-ip-address=51.250.84.88 \ | ||
--generic-ssh-user yc-user \ | ||
--generic-ssh-key ~/.ssh/id_ed25519 \ | ||
docker-host | ||
``` | ||
8. Активируем окружение Docker | ||
```shell | ||
eval $(docker-machine env docker-host) | ||
``` | ||
9. Собраз образ reddit:latest | ||
10. Отправлен образ в Docker hub | ||
```shell | ||
docker push baykanurov/otus-reddit:1.0 | ||
``` | ||
11. Проверить образ можно командой | ||
```shell | ||
docker pull baykanurov/otus-reddit:1.0 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM ubuntu:18.04 | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y mongodb-server ruby-full ruby-dev build-essential git | ||
RUN gem install bundler -v 1.16.1 | ||
RUN git clone -b monolith https://github.com/express42/reddit.git | ||
|
||
COPY mongod.conf /etc/mongod.conf | ||
COPY db_config /reddit/db_config | ||
COPY start.sh /start.sh | ||
|
||
RUN cd /reddit && rm Gemfile.lock && bundle install | ||
RUN chmod 0777 /start.sh | ||
|
||
CMD ["/start.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DATABASE_URL=127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
REPOSITORY TAG IMAGE ID CREATED SIZE | ||
baykanurov/ubuntu-tmp-file latest 759df1901f35 About a minute ago 63.2MB | ||
ubuntu 18.04 f9a80a55f492 4 months ago 63.2MB | ||
hello-world latest 9c7a54a9a43c 5 months ago 13.3kB |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Where and how to store data. | ||
storage: | ||
dbPath: /var/lib/mongodb | ||
journal: | ||
enabled: true | ||
|
||
# where to write logging data. | ||
systemLog: | ||
destination: file | ||
logAppend: true | ||
path: /var/log/mongodb/mongod.log | ||
|
||
# network interfaces | ||
net: | ||
port: 27017 | ||
bindIp: 127.0.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/bash | ||
|
||
/usr/bin/mongod --fork --logpath /var/log/mongod.log --config /etc/mongodb.conf | ||
|
||
source /reddit/db_config | ||
|
||
cd /reddit && puma || exit |