-
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.
* fix * fix * fix * fix * fix * fix * fix * fix * fix * fix * Write README * Write README * fix mkdir * fix path
- Loading branch information
1 parent
5f32fbc
commit 630035b
Showing
3 changed files
with
49 additions
and
53 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
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 |
---|---|---|
|
@@ -39,29 +39,34 @@ update: | |
echo "Frontend updated successfully" | ||
|
||
setup-ci: | ||
sudo chown -R github:legend . | ||
# Add user if not exists | ||
id -u github &>/dev/null || sudo adduser github | ||
sudo -u github ssh-keygen | ||
#ssh-keygen -t ed25519 -a 200 -C "[email protected]"\ | ||
sudo cat /home/github/.ssh/id_rsa.pub >> /home/github/.ssh/authorized_keys | ||
#cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys | ||
#cat ~/.ssh/id_ed25519.pub >> ~/.ssh/authorized_keys2 | ||
sudo chmod 777 -R /home/github/.ssh | ||
sudo chmod 666 /home/github/.ssh/authorized_keys | ||
echo "" && \ | ||
echo 'Add this politics for github user: [press Enter]' && \ | ||
echo 'AllowUsers github' && \ | ||
echo 'Match User github' && \ | ||
echo 'PasswordAuthentication no' && \ | ||
echo 'AllowTCPForwarding no' && \ | ||
echo 'X11Forwarding no' && \ | ||
echo '[press Enter...]' && \ | ||
#id -u github &>/dev/null || sudo adduser github # Add user if not exists | ||
#sudo chown -R github:legend . | ||
#sudo -u github ssh-keygen | ||
#sudo cat /home/github/.ssh/id_rsa.pub >> /home/github/.ssh/authorized_keys | ||
#sudo chmod 777 -R /home/github/.ssh | ||
#sudo chmod 666 /home/github/.ssh/authorized_keys | ||
#sudo -u github ssh-keygen | ||
#echo "" && \ | ||
# echo 'Add this politics for github user: [press Enter]' && \ | ||
# echo 'AllowUsers github' && \ | ||
# echo 'Match User github' && \ | ||
# echo 'PasswordAuthentication no' && \ | ||
# echo 'AllowTCPForwarding no' && \ | ||
# echo 'X11Forwarding no' && \ | ||
# echo '[press Enter...]' && \ | ||
# read ENTER | ||
#nano /etc/ssh/sshd_config | ||
#echo "" && \ | ||
# echo 'Add this public rsa key to Deploy keys in your github directory: ' && \ | ||
# sudo cat /home/github/.ssh/id_rsa.pub | ||
ssh-keygen -f /tmp/tmp_key | ||
sudo mkdir -p ~/.ssh | ||
sudo cat /tmp/tmp_key.pub >> ~/.ssh/authorized_keys | ||
echo '' && \ | ||
echo 'Add this private rsa key secret deploy variables to SSH_DEPLOY_KEY on your github repo: ' && \ | ||
echo '[press Enter...]' && \ | ||
read ENTER | ||
nano /etc/ssh/sshd_config | ||
echo "" && \ | ||
echo 'Add this public rsa key to Deploy keys in your github directory: ' && \ | ||
sudo cat /home/github/.ssh/id_rsa.pub | ||
sudo less /tmp/tmp_key | ||
|
||
all: | ||
cp --no-clobber ./docker-deploy/.env.example ./docker-deploy/.env | ||
|
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,34 +1,20 @@ | ||
# Фронтенд интерфейса оператора (отбора/подпитки) | ||
![GithubCI](https://github.com/sergtyapkin/vue-frontend-template/actions/workflows/deploy.yml/badge.svg) | ||
|
||
## Установка из исходников | ||
# Фронентд с авто-деплоем на _Nginx_ и получением сертификатов _Letsencript_ | ||
|
||
### 1. Установить зависимости: | ||
`yarn` | ||
Всё делается через команды `make` | ||
|
||
### 2. Сборка | ||
- #### В прод: `yarn dist` | ||
- #### Для разработки: `yarn dev` | ||
|
||
## Установка и запуск через Docker | ||
|
||
### Сборка из исходников | ||
``` | ||
make build | ||
``` | ||
|
||
### Загрузка из Docker Container Registry | ||
``` | ||
docker login git.sberrobots.ru:8443 | ||
make pull | ||
### 1. Клонируем: | ||
```SHELL | ||
git clone <this_repo> | ||
``` | ||
|
||
### Запуск | ||
``` | ||
make run | ||
``` | ||
Страница будет доступна по адресу `https://localhost:8000` | ||
### 2. Настраиваем вообще всё. | ||
В самом начале нужно будет настроить `.env` файл, прописать правильный `DOMAIN_URL` | ||
```SHELL | ||
cd <this_repo> | ||
make all | ||
```` | ||
|
||
### Остановка | ||
``` | ||
make stop | ||
``` | ||
Всё. Наслаждаемся тем, что за нас всё сделали, сайт раздаётся, сертификаты обновляются. | ||
Теперь `Github CI` сам будет проверять, собирается ли контейнер при **Pull Request**'ах, а при **Push**'ах в ветку `master` будет автоматически выполняться `make update` на сервере и обновлять деплой. |