forked from hotosm/tasking-manager
-
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.
Merge branch 'deployment/naxa' into feat-osm-download
- Loading branch information
Showing
19 changed files
with
1,064 additions
and
77 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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Build and Deploy Tasking Manager Backend | ||
|
||
on: | ||
push: | ||
branches: | ||
- deployment/naxa | ||
paths: | ||
- "backend/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to Server | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Recreate Services | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ vars.SERVER_IP }} | ||
username: ${{ vars.SERVER_USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
command_timeout: 20m | ||
script: | | ||
echo '==In Server==' | ||
echo '==Building Backend==' | ||
cd /home/ubuntu/Projects/tasking-manager | ||
git pull naxa deployment/naxa | ||
docker compose build --no-cache backend | ||
docker compose up -d --force-recreate |
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,52 @@ | ||
name: Build and Deploy Tasking Manager Frontend | ||
|
||
on: | ||
push: | ||
branches: | ||
- deployment/naxa | ||
paths: | ||
- "frontend/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
deploy: | ||
name: Deploy to Server | ||
runs-on: [ubuntu-latest] | ||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: SSH Run command | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ vars.SERVER_IP }} | ||
username: ${{ vars.SERVER_USERNAME }} | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} | ||
command_timeout: 20m | ||
script: | | ||
#!/bin/bash -i | ||
echo '==In Server==' | ||
echo '==Building Frontend==' | ||
export NVM_DIR=~/.nvm | ||
source ~/.nvm/nvm.sh | ||
cd /tmp | ||
git clone https://github.com/naxa-developers/tasking-manager | ||
cd tasking-manager | ||
git checkout ${{ github.ref }} | ||
cp /home/ubuntu/Projects/tasking-manager/tasking-manager.env . | ||
nvm i 16 | ||
nvm use 16 | ||
npm i -g yarn | ||
yarn install | ||
npm run build | ||
cp frontend/build/* /home/ubuntu/Projects/tasking-manager/frontend/build/ | ||
# cd /home/ubuntu/Projects/tasking-manager | ||
# git pull naxa deployment/naxa | ||
# cd /home/ubuntu/Projects/tasking-manager/frontend | ||
# nvm i 16 | ||
# nvm use 16 | ||
# npm i -g yarn | ||
# yarn install | ||
# npm run build |
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
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
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
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,20 @@ | ||
import React from 'react'; | ||
import { Link } from 'react-router-dom'; | ||
import { FormattedMessage } from 'react-intl'; | ||
|
||
import messages from './messages'; | ||
import { CustomButton } from '../button'; | ||
|
||
export const LiveViewButton = ({ projectId, className, compact = false }) => ( | ||
<Link to={`/projects/${projectId}/live`} className="pr2"> | ||
{ | ||
<CustomButton className={className}> | ||
{compact ? ( | ||
<FormattedMessage {...messages.live} /> | ||
) : ( | ||
<FormattedMessage {...messages.liveMonitoring} /> | ||
)} | ||
</CustomButton> | ||
} | ||
</Link> | ||
); |
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
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
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,50 @@ | ||
// https://github.com/yjose/reactjs-popup/issues/174 | ||
import { useEffect, useState } from 'react'; | ||
|
||
/** | ||
* This hook is a workaround for an issue in reactjs-popup | ||
* | ||
* What this hook does is: | ||
* | ||
* - on mouse down inside the popup, set closeOnDocumentClick to false | ||
* - on mouse up, set closeOnDocumentClick to true | ||
* | ||
* Usage: | ||
* | ||
* const closeOnDocumentClick = useCloseOnDocumentClick() | ||
* | ||
* return ( | ||
* <Popup ... closeOnDocumentClick={closeOnDocumentClick} > | ||
* ... | ||
* </Popup> | ||
* ) | ||
*/ | ||
export default function useCloseOnDocumentClick() { | ||
const [closeOnDocumentClick, setCloseOnDocumentClick] = useState(true); | ||
|
||
useEffect(() => { | ||
function insidePopupContents(target: any): boolean { | ||
return target.querySelector('.popup-content') == null; | ||
} | ||
|
||
function handleMouseDown(event: MouseEvent) { | ||
if (insidePopupContents(event.target)) { | ||
setCloseOnDocumentClick(false); | ||
} | ||
} | ||
|
||
function handleMouseUp() { | ||
setTimeout(() => setCloseOnDocumentClick(true)); | ||
} | ||
|
||
window.document.addEventListener('mousedown', handleMouseDown); | ||
window.document.addEventListener('mouseup', handleMouseUp); | ||
|
||
return () => { | ||
window.document.removeEventListener('mousedown', handleMouseDown); | ||
window.document.removeEventListener('mouseup', handleMouseUp); | ||
}; | ||
}, [setCloseOnDocumentClick]); | ||
|
||
return closeOnDocumentClick; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@import "@hotosm/underpass-ui/dist/index.css"; | ||
|
||
.maplibregl-map { | ||
height: 100vh; | ||
} | ||
|
||
.top { | ||
position: absolute; | ||
top: 150px; | ||
left: 20px; | ||
z-index: 999; | ||
} | ||
|
||
svg.pl2 { | ||
display: inherit; | ||
height: 22px !important; | ||
width: 19px !important; | ||
margin-left: 0px; | ||
} |
Oops, something went wrong.