Skip to content

Commit

Permalink
Merge pull request #105 from OktopUSP/dev
Browse files Browse the repository at this point in the history
CircleCI main services build and deploy + index page title
  • Loading branch information
leandrofars authored Aug 15, 2023
2 parents 71df9e4 + 44ee44b commit f032514
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 345 deletions.
59 changes: 59 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
version: 2.1
executors:
nodejs:
docker:
- image: cimg/node:18.17.1
golang:
docker:
- image: cimg/go:1.20.7

jobs:

build_and_deploy_controller:
executor: golang
steps:
- checkout
- run:
name: Build and Deploy Controller
command: |
cd backend/services/controller && go build -o controller cmd/oktopus/main.go
scp -o StrictHostKeyChecking=no controller $SSH_USER@$SSH_HOST:/home/$SSH_USER
ssh -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST "sudo mv controller /usr/bin/ && sudo systemctl restart controller"
build_and_deploy_mochi:
executor: golang
steps:
- checkout
- run:
name: Build and Deploy Mochi
command: |
cd backend/services/mochi/ && go build -o mochi cmd/main.go
scp -o StrictHostKeyChecking=no mochi $SSH_USER@$SSH_HOST:/home/$SSH_USER
ssh -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST "sudo mv mochi /usr/bin/ && sudo systemctl restart mochi"
build_and_deploy_frontend:
executor: nodejs
steps:
- checkout
- run:
name: Build and Deploy Frontend
command: |
cd frontend && npm i && npm run build
scp -o StrictHostKeyChecking=no -r .next/ $SSH_USER@$SSH_HOST:/home/$SSH_USER/oktopus/frontend
ssh -o StrictHostKeyChecking=no $SSH_USER@$SSH_HOST "pm2 restart oktopus"
workflows:
build_and_deploy:
jobs:
- build_and_deploy_controller:
filters:
branches:
only: main
- build_and_deploy_mochi:
filters:
branches:
only: main
- build_and_deploy_frontend:
filters:
branches:
only: main
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,8 @@ go.work
*.txt
*.pwd
*.acl
.idea
.idea
.vscode
controller
main
mochi
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
<img src="https://user-images.githubusercontent.com/83298718/220207485-8c2aac78-95eb-4b43-b23e-c4bfa6cd30e6.png"/>
</p>
<br/>
<ul>
<li>
<a href="https://github.com/leandrofars/oktopus/blob/main/README.pt-br.md">Readme em Português</a>
</li>
</ul>
<ul>
<li>
<h4>Introduction:</h4>
Expand Down Expand Up @@ -214,12 +209,12 @@ Basic manual compilation and run:
</li>
<li>
Mqtt broker:
<pre>leandro@leandro-laptop:~$ go run oktopus/backend/services/mochi/cmd/main.go -redis "127.0.0.1:6379"</pre>
<pre>leandro@leandro-laptop:~$ cd oktopus/backend/services/mochi/ && go run cmd/main.go -redis "127.0.0.1:6379"</pre>
</li>
<li>
TR-369 controller:
<pre>
leandro@leandro-laptop:~$ go run oktopus/backend/services/controller/cmd/oktopus/main.go -u root -P root -mongo "mongodb://127.0.0.1:27017"</pre>
leandro@leandro-laptop:~$ cd oktopus/backend/services/controller/ && go run cmd/oktopus/main.go -u root -P root -mongo "mongodb://127.0.0.1:27017"</pre>
</li>
<li>
Socketio server:
Expand Down
Loading

0 comments on commit f032514

Please sign in to comment.