Dockerized backend & added pipeline
This commit is contained in:
56
.drone.yml
Normal file
56
.drone.yml
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
kind: pipeline
|
||||||
|
type: docker
|
||||||
|
name: frontend
|
||||||
|
|
||||||
|
clone:
|
||||||
|
disable: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: bulid
|
||||||
|
image: node:16
|
||||||
|
environment:
|
||||||
|
SSH_KEY:
|
||||||
|
from_secret: SSH_KEY
|
||||||
|
commands:
|
||||||
|
- git clone https://git.radner.ru/anatolykopyl/worktime.git
|
||||||
|
- cd worktime
|
||||||
|
- npm install
|
||||||
|
- npm run build
|
||||||
|
- mkdir ~/.ssh
|
||||||
|
- echo "$SSH_KEY" > ~/.ssh/id_rsa
|
||||||
|
- chmod 400 ~/.ssh/id_rsa
|
||||||
|
- scp -o StrictHostKeyChecking=no -r dist/* webmaster@worktime.anatolykopyl.ru:~/www/worktime.anatolykopyl.ru
|
||||||
|
when:
|
||||||
|
branch:
|
||||||
|
- cloud-saves
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
kind: pipeline
|
||||||
|
type: ssh
|
||||||
|
name: backend
|
||||||
|
|
||||||
|
server:
|
||||||
|
host: worktime.anatolykopyl.ru
|
||||||
|
user: webmaster
|
||||||
|
ssh_key:
|
||||||
|
from_secret: SSH_KEY
|
||||||
|
|
||||||
|
clone:
|
||||||
|
disable: true
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: fetch remote
|
||||||
|
commands:
|
||||||
|
- cd /home/webmaster/worktime && git fetch --all && git reset --hard origin/cloud-saves
|
||||||
|
- name: build docker
|
||||||
|
commands:
|
||||||
|
- docker build --tag worktime:latest /home/worktime/backend
|
||||||
|
- name: restart docker
|
||||||
|
- docker stop worktime
|
||||||
|
- docker rm worktime
|
||||||
|
- docker run --name worktime -p 3003:3000 -d worktime
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
branch:
|
||||||
|
- cloud-saves
|
||||||
7
backend/Dockerfile
Normal file
7
backend/Dockerfile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
FROM denoland/deno:1.21.2
|
||||||
|
EXPOSE 3000
|
||||||
|
WORKDIR /app
|
||||||
|
USER deno
|
||||||
|
COPY . .
|
||||||
|
RUN deno cache ./src/index.ts
|
||||||
|
CMD ["run", "--allow-all", "./src/index.ts"]
|
||||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "worktime",
|
|
||||||
"lockfileVersion": 2,
|
|
||||||
"requires": true,
|
|
||||||
"packages": {}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user