Skip to content

Commit

Permalink
Dev (#6)
Browse files Browse the repository at this point in the history
* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* fix

* Write README

* Write README

* fix mkdir

* fix path

* fix deploy.yml

* fix deploy.yml

* fix deploy.yml

* fix deploy.yml

* fix Make

* fix Make

* fix Make

* fix Make

* fix Make

* fix Make

* fix Make

* Избавился от sudo для make
  • Loading branch information
SergTyapkin authored Jan 29, 2024
1 parent e96092e commit 5be702c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 40 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ jobs:
key: ${{ secrets.SSH_DEPLOY_KEY }}
script: |
cd ${{ vars.PROJECT_PATH }}
sudo make update
make update
31 changes: 0 additions & 31 deletions .gitlab-ci.yml

This file was deleted.

25 changes: 21 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#TAG ?= $(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
include docker-deploy/.env
-include ./docker-deploy/.env

generate-certs:
cd docker-deploy && \
Expand All @@ -17,7 +17,7 @@ set-auto-renewing-certs:
echo "" && \
echo "0 0 1 * * cd $$(pwd) && make run renew-certs >> ./certbot-renew.log" && \
echo "" && \
echo "Copy that command and press [Enter]. Then add this string in end of opened file." && \
echo "Copy that command and [press Enter]. Then add this string in end of opened file." && \
read ENTER
crontab -e

Expand All @@ -26,6 +26,10 @@ run:
docker compose down && \
docker compose up -d nginx

down:
cd docker-deploy && \
docker compose down

build:
cd docker-deploy && \
docker compose build --no-cache --progress=plain nginx
Expand Down Expand Up @@ -64,14 +68,27 @@ setup-ci:
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...]' && \
echo '[To see key press Enter...]' && \
read ENTER
sudo less /tmp/tmp_key

set-docker-not-sudo:
# add user to docker group
getent group docker || sudo groupadd docker # Add group if not exists
sudo usermod -aG docker ${USER}
newgrp docker
sudo systemctl restart docker

all:
cp --no-clobber ./docker-deploy/.env.example ./docker-deploy/.env
echo '' && \
echo 'Edit .env file. Write right DOMAIN_URL!' && \
echo '[press Enter...]' && \
read ENTER
nano ./docker-deploy/.env
make generate-scripts
make generate-certs
make set-auto-renewing-certs
make down
make setup-ci
sudo chmod ug+rwx -R /home/legend/vue-frontend-template/docker-deploy/certbot/
make update
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@

### 1. Клонируем:
```SHELL
git clone <this_repo>
git clone [email protected]:SergTyapkin/vue-frontend-template.git
```

### 2. Настраиваем вообще всё.
В самом начале нужно будет настроить `.env` файл, прописать правильный `DOMAIN_URL`
```SHELL
cd <this_repo>
cd vue-frontend-template
make all
````

Expand Down
3 changes: 1 addition & 2 deletions docker-deploy/.env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
NODE_RELEASE=18
# Nginx not alpine. Must have 'envsubst' inside
NGINX_RELEASE=1.23.3
NGINX_RELEASE=1.23.3-alpine
FRONTEND_COMPOSE_NAME=frontend-compose
API_PORT=3000
DOMAIN_URL=your.domain

0 comments on commit 5be702c

Please sign in to comment.