Skip to content

Instantly share code, notes, and snippets.

@andrewpsp
Created August 30, 2023 05:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewpsp/47f411e9a4991cba712034f420d172ae to your computer and use it in GitHub Desktop.
Save andrewpsp/47f411e9a4991cba712034f420d172ae to your computer and use it in GitHub Desktop.
Build of the Dockerfile for the webscript driver environment certififcation condiitons.
import os
from selenium import webdriver
def import os
from selenium import webdriver
def business_object_certification_handle(req):
options = webdriver.ChromeOptions()
#To be utlized with FaaS models
options.add_argument('--headless')
options.add_argument('--no-sandbox')
options.add_argument('--disable-dev-shm-usage')
# TODO dynamic array of maps to webdriver browsers
driver = webdriver.Chrome(chrome_options=options)
# update domain variable with your domain to certify
domain = 'cnn.com'
try:
# Navigate to the index of the assets and components
driver.get(f"https://{domain}")
# Check if the title of the page is SSL as expected
assert {domain} in driver.title
finally:
driver.quit()
return "view report at entercloud.info/Devbuild"
print("1 of 1 complete")
FROM openfaas/classic-watchdog:latest as watchdog
FROM selenium/standalone-chrome:latest
COPY --from=watchdog /fwatchdog /usr/bin/fwatchdog
RUN chmod +x /usr/bin/fwatchdog
COPY business_object_certification.py .
CMD ["fwatchdog"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment