Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/BG.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Industrialisation continue sur le serveur AWS (Tomcat)
on: push
jobs:
build:
name: Package AWS
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: |
jar cvf Senthilkumar.war *
- name: copy file via ssh password
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST_DNS }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
port: ${{ secrets.DEPLOY_PORT }}
source: "Senthilkumar.war"
target: "/opt/tomcat/webapps"

deploy:
name: SAV IPFS
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@master
- run: |
jar cvf Senthilkumar.war *
- uses: jirutka/setup-alpine@v1
with:
branch: v3.15
- run: |
apk add go-ipfs
ipfs init
ipfs daemon &
shell: alpine.sh --root {0}
- name: Sauvegarde fichier war sur IPFS
run: |
ls -la
ipfs swarm peers
ipfs add Senthilkumar.war > ipfs_key.txt
shell: alpine.sh --root {0}
- name: Notification Discord
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
run: |
ipfs_key=$(cat ipfs_key.txt | awk '{print $2}')
curl -X POST -H "Content-Type: application/json" -d "{\"content\": \"Sadish.S: Le workfl-vousetespasfatigueronestpasfatiguer IPFS est terminé. Clé IPFS : $ipfs_key\"}" $DISCORD_WEBHOOK
19 changes: 19 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Industrialisation continue sur le serveur AWS
on: push
jobs:
Deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- run: |
jar cvf sadish.war *
- name: copy file via ssh password
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST_DNS }}
username: ${{ secrets.USERNAME }}
key: ${{ secrets.EC2_SSH_KEY }}
port: ${{ secrets.DEPLOY_PORT }}
source: "sadish.war"
target: "/opt/tomcat/webapps"
65 changes: 65 additions & 0 deletions .github/workflows/new.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Continuous Deployment and Database Backup

on: push

jobs:
setup_and_backup:
name: Setup SSH and Backup Database
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v2


- name: Setup SSH Keys
run: |
mkdir -p ~/.ssh
echo "${{ secrets.EC2_SSH_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan ${{ secrets.HOST_DNS }} >> ~/.ssh/known_hosts


- name: Create SSH Tunnel
run: |
ssh -i ~/.ssh/id_rsa -L 3307:127.0.0.1:3306 admin@${{ secrets.HOST_DNS }} -N &
SSH_TUNNEL_PID=$!
sleep 10
if ps -p $SSH_TUNNEL_PID > /dev/null; then
echo "SSH tunnel established, PID: $SSH_TUNNEL_PID"
else
echo "SSH tunnel failed"
exit 1
fi


- name: Dump MySQL Database
env:
MYSQL_PWD: ${{ secrets.MYSQLDUMP_PASSWORD }}
run: |
mysqldump -ucnam -h127.0.0.1 -P3307 --password="${MYSQL_PWD}" films > sauvegarde_films.sql
if [ $? -ne 0 ]; then
echo "Failed to dump MySQL"
exit 1
fi


- name: Kill SSH Tunnel
if: always()
run: |
kill $SSH_TUNNEL_PID || echo "SSH tunnel fin."


- name: Install IPFS
run: |
wget https://dist.ipfs.io/go-ipfs/v0.9.1/go-ipfs_v0.9.1_linux-amd64.tar.gz
tar xvfz go-ipfs_v0.9.1_linux-amd64.tar.gz
cd go-ipfs
sudo bash install.sh
ipfs init


- name: Add to IPFS
run: |
ipfs daemon --init &
sleep 10
ipfs add sauvegarde_films.sql
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
Binary file added images/cartoon.ogg
Binary file not shown.
12 changes: 7 additions & 5 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
<html>
<head>
<title>Sample "Hello, World" Application</title>
<title>Sample "wesh c'est sdish" Application</title>
</head>
<body bgcolor=white>



<table border="0">
<tr>
<td>
<img src="images/tomcat.gif">
</td>
<td>
<h1>Sample "Hello, World" Application</h1>
<p>This is the home page for a sample application used to illustrate the
source directory organization of a web application utilizing the principles
outlined in the Application Developer's Guide.
<h1>Allo salut saidsh.
<iframe src="images/cartoon.ogg" allow="autoplay" id="audio"></iframe>
</iframe>
<audio id="player" autoplay controls><source src="images/cartoon.ogg" type="audio/ogg"></audio>
</td>
</tr>
</table>
Expand Down