-
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.
- Loading branch information
1 parent
a8e3d6b
commit 779d867
Showing
9 changed files
with
49 additions
and
37 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,19 @@ | ||
name: deply to server | ||
name: SonarQube | ||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
deploy: | ||
name: deploy | ||
build: | ||
name: Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: executing remote ssh commands using ssh key | ||
uses: appleboy/ssh-action@master | ||
env: | ||
PUBKEY: ${{ secrets.SSL_CERT }} | ||
PRIKEY: ${{ secrets.SSL_KEY }} | ||
- uses: actions/checkout@v2 | ||
with: | ||
host: ${{ secrets.HOST }} | ||
username: ${{ secrets.USER }} | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
port: ${{ secrets.PORT }} | ||
envs: PUBKEY,PRIKEY | ||
script_stop: true | ||
script: | | ||
sudo pm2 kill | ||
sudo pkill flask || echo 'killed' | ||
sudo rm -rf ./hey-ptt | ||
git clone https://github.com/NPC-GO/hey-ptt.git | ||
cd hey-ptt || exit | ||
sudo rm -rf ./git | ||
pip3 install -r requirements.txt | ||
export FLASK_APP=app.py | ||
mkdir certs | ||
touch ./certs/server.pub | ||
touch ./certs/server.key | ||
echo "$PUBKEY" >> ./certs/server.pub | ||
echo "$PRIKEY" >> ./certs/server.key | ||
pm2 start -i max | ||
fetch-depth: 0 | ||
- uses: sonarsource/sonarqube-scan-action@master | ||
env: | ||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | ||
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} |
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,15 @@ | ||
FROM python:alpine | ||
|
||
ARG PORT=7777 | ||
|
||
ENV PORT=$PORT | ||
|
||
COPY . /heyptt | ||
|
||
WORKDIR /heyptt | ||
|
||
RUN pip3 install -r ./requirements.txt --upgrade | ||
|
||
EXPOSE $PORT | ||
|
||
CMD ["python3", "serve.py"] |
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,10 @@ | ||
version: '3' | ||
|
||
services: | ||
heyptt: | ||
build: | ||
context: . | ||
dockerfile: ./Dockerfile | ||
ports: | ||
- '7777:7777' | ||
restart: unless-stopped |
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,3 +1,4 @@ | ||
bs4 | ||
requests | ||
flask | ||
flask | ||
waitress |
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,5 @@ | ||
from waitress import serve | ||
import app | ||
import os | ||
|
||
serve(app.app, host='0.0.0.0', port=os.environ['PORT']) |
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 @@ | ||
sonar.projectKey=Hey-PTT |
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