Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NEW : Dev add to docker🐳 #11

Merged
merged 86 commits into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
ca2d28d
Merge pull request #2 from Foufou-exe/main
Foufou-exe Mar 24, 2023
647c198
💢Modification
Foufou-exe Mar 24, 2023
3f4da84
📦 NEW: TEST CODE
Foufou-exe Mar 24, 2023
f7a111e
RENAME
Foufou-exe Mar 24, 2023
7fdb208
🐛 FIX: PROBLEME NOMMAGE
Foufou-exe Mar 24, 2023
6b3196e
🐛 FIX: REMOVE LIB
Foufou-exe Mar 24, 2023
b5a44c6
🐛 FIX: READAPTATION
Foufou-exe Mar 24, 2023
52217a2
Ouai
Foufou-exe Mar 24, 2023
c507811
🐛 FIX: workfolw
Foufou-exe Mar 24, 2023
cfb11ee
Update and rename Yspeed.py to yspeed.py
Foufou-exe Mar 24, 2023
3544665
🐛 FIX: test
Foufou-exe Mar 24, 2023
f374da3
🐛 FIX:SPACE
Foufou-exe Mar 24, 2023
dc3c304
📦 NEW: Perfect Files
Foufou-exe Mar 24, 2023
94617d7
📦 NEW: NICE
Foufou-exe Mar 24, 2023
20e1f55
📦 NEW: package
Foufou-exe Mar 24, 2023
1d5a2b2
📦 NEW: TEST UNITAIRE
Foufou-exe Mar 24, 2023
08457a4
🐛 FIX: RESOLV LIB
Foufou-exe Mar 24, 2023
0fdb780
MODIF
Foufou-exe Mar 24, 2023
68f8e90
🐛 FIX: Correction
Foufou-exe Mar 24, 2023
f5df28b
🐛 FIX: Provle
Foufou-exe Mar 24, 2023
eb74522
🐛 FIX: Correction
Foufou-exe Mar 24, 2023
9579411
📦 NEW: Files
Foufou-exe Mar 24, 2023
82decc3
TETS
Foufou-exe Mar 24, 2023
90b92b4
Verife
Foufou-exe Mar 24, 2023
9a9e6a1
🐛 FIX: Problème
Foufou-exe Mar 24, 2023
300e64d
🐛 FIX: TEST
Foufou-exe Mar 24, 2023
b54f56f
PY
Foufou-exe Mar 24, 2023
1e66651
🐛 FIX: TEST
Foufou-exe Mar 24, 2023
02992a4
🐛 FIX: PROBLEME CHEMIN
Foufou-exe Mar 24, 2023
aea359c
TEST 2
Foufou-exe Mar 24, 2023
9a9c768
TEST
Foufou-exe Mar 24, 2023
d888d71
TEST3
Foufou-exe Mar 24, 2023
a42dae9
🐛 FIX: ESSAIE
Foufou-exe Mar 24, 2023
565c827
📦 NEW: TEST
Foufou-exe Mar 24, 2023
325c573
🐛 FIX: RENAME
Foufou-exe Mar 24, 2023
2b262b4
🐛 FIX: solutuion
Foufou-exe Mar 24, 2023
e064713
📦 NEW: Ajout de code
Foufou-exe Mar 25, 2023
35577ba
🐛 FIX: Probleme yspeed
Foufou-exe Mar 26, 2023
d6f38c5
📦 NEW: IMAGES
Foufou-exe Mar 26, 2023
f9f7385
Delete .github/images directory
Foufou-exe Mar 27, 2023
c01295b
🐛 FIX: COMPATIBILITE
Foufou-exe Mar 27, 2023
06d6257
Merge branch 'dev' of https://github.com/Foufou-exe/Yspeed into dev
Foufou-exe Mar 27, 2023
b38746c
🐛 FIX: test
Foufou-exe Mar 27, 2023
f967ae9
📦 NEW: PHOTO
Foufou-exe Mar 27, 2023
4287cf6
📦 NEW: LOGO
Foufou-exe Mar 27, 2023
2963da3
🐛 FIX: TXT
Foufou-exe Mar 27, 2023
7194341
🐛 FIX: RENAME
Foufou-exe Mar 27, 2023
388ad0e
📦 NEW: NEW
Foufou-exe Mar 27, 2023
e64907d
🐛 FIX: travis
Foufou-exe Mar 27, 2023
c54b5cd
‼️ BREAKING: TRAVIS
Foufou-exe Mar 27, 2023
db183fd
🐛 FIX: travis
Foufou-exe Mar 27, 2023
7bb970a
🐛 FIX: TRAVIS
Foufou-exe Mar 27, 2023
1e2650a
🐛 FIX: TRAVIS
Foufou-exe Mar 27, 2023
ebfb0a3
🐛 FIX: test
Foufou-exe Mar 27, 2023
6831dae
🐛 FIX: yspeed
Foufou-exe Mar 27, 2023
785a3af
🐛 FIX: Display
Foufou-exe Mar 27, 2023
e117fec
📦 NEW: FILES
Foufou-exe Mar 27, 2023
48d9a68
📦 NEW: 🐛
Foufou-exe Mar 27, 2023
e5230da
🚀 RELEASE: 0.1.0
Foufou-exe Mar 27, 2023
a30608d
📦 NEW: Video Screen
Foufou-exe Mar 27, 2023
2666917
📦 NEW: README
Foufou-exe Mar 27, 2023
aaa8da5
test
Foufou-exe Mar 27, 2023
6d178b8
🐛 FIX: TEAM
Foufou-exe Mar 27, 2023
d17359c
📦 NEW: README
Foufou-exe Mar 27, 2023
55805a8
📦 NEW: README
Foufou-exe Mar 27, 2023
9d70dbb
📦 NEW: files
Foufou-exe Mar 27, 2023
9ba46f7
🐛 FIX: README
Foufou-exe Mar 27, 2023
68ef61c
🐛 FIX: FILES
Foufou-exe Mar 27, 2023
587b54c
🐛 FIX: FILES
Foufou-exe Mar 27, 2023
d44e31c
🐛 FIX: requirements
Foufou-exe Mar 27, 2023
eca9aae
🐛 FIX: test unitaire
Foufou-exe Mar 27, 2023
db4c7fe
🐛 FIX: yspeed
Foufou-exe Mar 27, 2023
f2ef115
🐛 FIX: Yspeed
Foufou-exe Mar 27, 2023
5e3ec03
👌 IMPROVE: APROUVE
Foufou-exe Mar 27, 2023
388bb20
feature: cleaning (#5)
Ahmosys Mar 27, 2023
091bb97
🐛 FIX: PROBLERME TIME
Foufou-exe Mar 27, 2023
d3147df
🐛 FIX: requiremnts
Foufou-exe Mar 28, 2023
b213bed
👌 IMPROVE: question fonction
Foufou-exe Mar 28, 2023
1c5a98b
📦 NEW: Version 0.1.3
Foufou-exe Mar 28, 2023
34782d5
🐛 FIX: Type
Foufou-exe Mar 28, 2023
fb457c6
🚀 RELEASE: 0.1.4
Foufou-exe Mar 28, 2023
df3c875
Merge branch 'main' into dev
Foufou-exe Mar 28, 2023
b31640c
🐛 FIX: yspeed
Foufou-exe Mar 28, 2023
dc968b2
Merge branch 'main' into dev
Foufou-exe Mar 28, 2023
bac9f33
📖 DOC: MODIF
Foufou-exe Apr 1, 2023
0c3ee82
DOCKER 🐳
Foufou-exe Apr 1, 2023
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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

version: 2
updates:
- package-ecosystem: "" # See documentation for possible values
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
16 changes: 16 additions & 0 deletions .github/workflows/docker-image-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Docker Image CI

on:
push:
branches: ['dev']

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag yspeed:$(date +%s)
18 changes: 18 additions & 0 deletions .github/workflows/docker-image-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Docker Image CI

on:
push:
branches: ['main']
pull_request:
branches: [ "main" ]

jobs:

build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Build the Docker image
run: docker build . --file Dockerfile --tag yspeed:$(date +%s)
41 changes: 41 additions & 0 deletions .github/workflows/docker-publish-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

name: Publish Docker image

on:
push:
branches: [ "dev" ]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: my-docker-hub-namespace/my-docker-hub-repository

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: foufoudu34/yspeed:dev
34 changes: 34 additions & 0 deletions .github/workflows/docker-publish-package-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Créer et publier une image Docker

on:
push:
branches: ['dev']

env:
REGISTRY: ghcr.io
IMAGE_NAME: foufou-exe/yspeed

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:dev
36 changes: 36 additions & 0 deletions .github/workflows/docker-publish-package-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Créer et publier une image Docker

on:
push:
branches: ['main']
pull_request:
# The branches below must be a subset of the branches above
branches: [ "main" ]
env:
REGISTRY: ghcr.io
IMAGE_NAME: foufou-exe/yspeed

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Log in to the Container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:main
34 changes: 34 additions & 0 deletions .github/workflows/docker-publish-prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Docker image

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: my-docker-hub-namespace/my-docker-hub-repository

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
push: true
tags: foufoudu34/yspeed:latest
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM ubuntu:latest
MAINTAINER foufou-exe

# Install dependencies
RUN apt-get update -y

# Install Python
RUN apt-get install -y git curl python3-pip python3-dev build-essential

RUN cd /

# Clone the repository
RUN git clone https://github.com/Foufou-exe/Yspeed.git

WORKDIR /Yspeed

# Install the requirements
RUN pip3 install -r /Yspeed/requirements.txt

# Expose the port
EXPOSE 22

# Run the app
CMD ["python3", "/Yspeed/Yspeed.py"]

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ YSpeed depends on the following libraries:

Make sure you also have a Selenium-compatible driver installed for your preferred browser (Chrome, Firefox, etc.).

## Use screen
## Use CLI


<details>
Expand Down
14 changes: 13 additions & 1 deletion yspeed.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""Docstring for module Yspeed.
"""


import os
import platform
import sys
Expand Down Expand Up @@ -155,6 +154,7 @@ def _extracted_from_get_speedtest(self) -> object:
try:
rgpd = result.find_element(By.ID, "onetrust-accept-btn-handler")


rgpd.click()
return result
except NoSuchElementException:
Expand Down Expand Up @@ -219,6 +219,9 @@ def define_brower(self) -> object:
Initialize and return an instance of Selenium webdriver based on the browser specified in argument.
"""
system = platform.system().lower()



if system == "windows":
browser_executables = {
"chrome": "chrome.exe",
Expand Down Expand Up @@ -341,6 +344,11 @@ def gather_network_info(speedtest: Yspeed, progress: Progress) -> dict:
**best,
**speed,
}



def print_network_info(console: Console, info: dict) -> None:
"""
This function (print_network_info) prints the network information
"""
clear_screen()
Expand Down Expand Up @@ -405,6 +413,8 @@ def _version() -> str:
return "0.1.4"




def author() -> None:
"""
Prints the name of the script author and their contact information.
Expand All @@ -417,6 +427,8 @@ def author() -> None:
console.print(f"Version Yspeed: {_version()}", style="grey35", justify="center")




def clear_screen() -> None:
"""
Clears the terminal screen based on the operating system.
Expand Down