-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from Badgerati/develop
v1.0.0
- Loading branch information
Showing
33 changed files
with
28,918 additions
and
443 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 |
---|---|---|
@@ -0,0 +1,58 @@ | ||
Task 'Build' Selenium, { } | ||
|
||
Task 'Selenium' { | ||
if (Test-Path ./src/lib) { | ||
Remove-Item -Path ./src/lib -Force -Recurse -ErrorAction Stop | Out-Null | ||
} | ||
|
||
if (Test-Path ./temp) { | ||
Remove-Item -Path ./temp -Force -Recurse -ErrorAction Stop | Out-Null | ||
} | ||
|
||
$packages = @{ | ||
'Selenium.WebDriver' = '3.141.0' | ||
'Selenium.Support' = '3.141.0' | ||
'Selenium.WebDriver.ChromeDriver' = '77.0.3865.4000' | ||
'Selenium.WebDriver.IEDriver' = '3.150.0' | ||
'Selenium.WebDriver.GeckoDriver' = '0.26.0' | ||
} | ||
|
||
$packages.Keys | ForEach-Object { | ||
nuget install $_ -source nuget.org -version $packages[$_] -outputdirectory ./temp | Out-Null | ||
} | ||
|
||
# web drivers | ||
New-Item -Path ./src/lib/WebDriver -ItemType Directory -Force | Out-Null | ||
|
||
Copy-Item -Path "./temp/Selenium.WebDriver.$($packages['Selenium.WebDriver'])/lib/*" -Destination ./src/lib/WebDriver -Recurse -Force | Out-Null | ||
Copy-Item -Path "./temp/Selenium.Support.$($packages['Selenium.Support'])/lib/*" -Destination ./src/lib/WebDriver -Recurse -Force | Out-Null | ||
|
||
Remove-Item -Path ./src/lib/WebDriver/net20 -Force -Recurse -ErrorAction Ignore | Out-Null | ||
Remove-Item -Path ./src/lib/WebDriver/net35 -Force -Recurse -ErrorAction Ignore | Out-Null | ||
Remove-Item -Path ./src/lib/WebDriver/net40 -Force -Recurse -ErrorAction Ignore | Out-Null | ||
|
||
# browsers | ||
New-Item -Path ./src/lib/Browsers -ItemType Directory -Force | Out-Null | ||
New-Item -Path ./src/lib/Browsers/win -ItemType Directory -Force | Out-Null | ||
New-Item -Path ./src/lib/Browsers/linux -ItemType Directory -Force | Out-Null | ||
New-Item -Path ./src/lib/Browsers/mac -ItemType Directory -Force | Out-Null | ||
|
||
# win | ||
"./temp/Selenium.WebDriver.IEDriver.$($packages['Selenium.WebDriver.IEDriver'])/driver/*" | Out-Default | ||
Copy-Item -Path "./temp/Selenium.WebDriver.IEDriver.$($packages['Selenium.WebDriver.IEDriver'])/driver/*" -Destination ./src/lib/Browsers/win/ -Recurse -Force | Out-Null | ||
Copy-Item -Path "./temp/Selenium.WebDriver.GeckoDriver.$($packages['Selenium.WebDriver.GeckoDriver'])/driver/win64/*" -Destination ./src/lib/Browsers/win/ -Recurse -Force | Out-Null | ||
Copy-Item -Path "./temp/Selenium.WebDriver.ChromeDriver.$($packages['Selenium.WebDriver.ChromeDriver'])/driver/win32/*" -Destination ./src/lib/Browsers/win/ -Recurse -Force | Out-Null | ||
|
||
# linux | ||
Copy-Item -Path "./temp/Selenium.WebDriver.GeckoDriver.$($packages['Selenium.WebDriver.GeckoDriver'])/driver/linux64/*" -Destination ./src/lib/Browsers/linux/ -Recurse -Force | Out-Null | ||
Copy-Item -Path "./temp/Selenium.WebDriver.ChromeDriver.$($packages['Selenium.WebDriver.ChromeDriver'])/driver/linux64/*" -Destination ./src/lib/Browsers/linux/ -Recurse -Force | Out-Null | ||
|
||
# mac | ||
Copy-Item -Path "./temp/Selenium.WebDriver.GeckoDriver.$($packages['Selenium.WebDriver.GeckoDriver'])/driver/mac64/*" -Destination ./src/lib/Browsers/mac/ -Recurse -Force | Out-Null | ||
Copy-Item -Path "./temp/Selenium.WebDriver.ChromeDriver.$($packages['Selenium.WebDriver.ChromeDriver'])/driver/mac64/*" -Destination ./src/lib/Browsers/mac/ -Recurse -Force | Out-Null | ||
|
||
# clean up temp | ||
if (Test-Path ./temp) { | ||
Remove-Item -Path ./temp -Force -Recurse | Out-Null | ||
} | ||
} |
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,2 +1,3 @@ | ||
Tests/ | ||
examples/*.jpg | ||
examples/*.jpg | ||
temp/ |
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,31 @@ | ||
FROM mcr.microsoft.com/powershell:6.2.3-ubuntu-16.04 | ||
LABEL maintainer="Matthew Kelly (Badgerati)" | ||
|
||
# update | ||
RUN apt-get update -y | ||
RUN apt-get install -y unzip curl wget | ||
|
||
# install chrome | ||
RUN apt-get install -y libappindicator1 fonts-liberation | ||
RUN curl https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -o /chrome.deb | ||
RUN dpkg -i /chrome.deb; apt-get -fy install | ||
RUN rm /chrome.deb | ||
RUN google-chrome-stable --no-sandbox --headless --disable-gpu --dump-dom https://www.chromestatus.com/ | ||
|
||
# install firefox | ||
RUN apt-get install -y firefox | ||
|
||
# copy over monocle | ||
RUN mkdir -p /usr/local/share/powershell/Modules/Monocle | ||
COPY ./src/ /usr/local/share/powershell/Modules/Monocle | ||
|
||
# state that monocle should be headless | ||
RUN export DISPLAY=:99 | ||
ENV MONOCLE_HEADLESS '1' | ||
|
||
# set as executable on drivers | ||
RUN chown root:root /usr/local/share/powershell/Modules/Monocle/lib/Browsers/linux/chromedriver | ||
RUN chmod +x /usr/local/share/powershell/Modules/Monocle/lib/Browsers/linux/chromedriver | ||
|
||
RUN chown root:root /usr/local/share/powershell/Modules/Monocle/lib/Browsers/linux/geckodriver | ||
RUN chmod +x /usr/local/share/powershell/Modules/Monocle/lib/Browsers/linux/geckodriver |
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,3 @@ | ||
FROM badgerati/monocle:latest | ||
COPY . /usr/src/scripts | ||
CMD [ "pwsh", "-c", "cd /usr/src/scripts; ./youtube.ps1" ] |
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
Oops, something went wrong.