Skip to content

Commit

Permalink
Merge pull request #409 from GovTechSG/chore/rename-oobee-oct
Browse files Browse the repository at this point in the history
Chore/rename oobee oct
  • Loading branch information
CKodes authored Oct 25, 2024
2 parents d4c3b94 + c19eb61 commit ecd0d15
Show file tree
Hide file tree
Showing 59 changed files with 1,491 additions and 1,155 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ logs/
results/
ImageMagick-*/
errors.txt
a11y-scan-results.zip
oobee-scan-results.zip
82 changes: 41 additions & 41 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,44 @@ jobs:
runs-on: ubuntu-latest

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

- name: Build and run Docker container
run: |
# Build your Docker image (replace 'purple-a11y' and 'Dockerfile' with your image name and Dockerfile path)
docker build -t purple-a11y .
# Run the Docker container (adjust any options as needed)
docker run -dit --name purple-a11y-container purple-a11y
# Ensure the Docker container is running before running the next step
continue-on-error: true

- name: Run Node CLI command inside the Docker container
run: |
# Execute a webisite crawl
docker exec purple-a11y-container npm run cli -- -u "${{ vars.A11Y_SCAN_URL }}" -c 2 -p "${{ vars.A11Y_SCAN_MAX_NUM_PAGES }}" -t "${{ vars.A11Y_SCAN_MAX_CONCURRENCY }}" -k "${{ github.actor }}:${{ github.actor }}@users.noreply.github.com" -b chromium || true
- name: Print errors
run: |
docker exec purple-a11y-container cat errors.txt || true
- name: Print logs
run: |
docker exec purple-a11y-container cat logs/*/*.txt || true
- name: Copy Results from Docker Container
run: docker cp purple-a11y-container:/app/results ./results

- name: Zip Results
run: zip -r results.zip ./results

- name: Upload Zip File
uses: actions/upload-artifact@v4
with:
name: results
path: results.zip
- name: Cleanup Docker container
run: |
# Stop and remove the Docker container
docker stop purple-a11y-container
docker rm purple-a11y-container
- name: Checkout code
uses: actions/checkout@v2

- name: Build and run Docker container
run: |
# Build your Docker image (replace 'oobee' and 'Dockerfile' with your image name and Dockerfile path)
docker build -t oobee .
# Run the Docker container (adjust any options as needed)
docker run -dit --name oobee-container oobee
# Ensure the Docker container is running before running the next step
continue-on-error: true

- name: Run Node CLI command inside the Docker container
run: |
# Execute a webisite crawl
docker exec oobee-container npm run cli -- -u "${{ vars.OOBEE_SCAN_URL }}" -c 2 -p "${{ vars.OOBEE_SCAN_MAX_NUM_PAGES }}" -t "${{ vars.OOBEE_SCAN_MAX_CONCURRENCY }}" -k "${{ github.actor }}:${{ github.actor }}@users.noreply.github.com" -b chromium || true
- name: Print errors
run: |
docker exec oobee-container cat errors.txt || true
- name: Print logs
run: |
docker exec oobee-container cat logs/*/*.txt || true
- name: Copy Results from Docker Container
run: docker cp oobee-container:/app/results ./results

- name: Zip Results
run: zip -r results.zip ./results

- name: Upload Zip File
uses: actions/upload-artifact@v4
with:
name: results
path: results.zip

- name: Cleanup Docker container
run: |
# Stop and remove the Docker container
docker stop oobee-container
docker rm oobee-container
68 changes: 34 additions & 34 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
@@ -1,83 +1,83 @@
name: Push installation image
name: Push installation image

on:
on:
workflow_dispatch:
release:
types: [published]

jobs:
windows-install-purple:
windows-install-oobee:
runs-on: windows-latest

steps:
- name: Check out repository code
uses: actions/checkout@v3
with:
path: purple-a11y
path: oobee

- name: Copy scripts to parent directory
run: |
cp ${{github.workspace}}/purple-a11y/scripts/*.ps1 ${{github.workspace}}
cp ${{github.workspace}}/purple-a11y/scripts/*.cmd ${{github.workspace}}
cp ${{github.workspace}}/purple-a11y/scripts/*.xml ${{github.workspace}}
cp ${{github.workspace}}/oobee/scripts/*.ps1 ${{github.workspace}}
cp ${{github.workspace}}/oobee/scripts/*.cmd ${{github.workspace}}
cp ${{github.workspace}}/oobee/scripts/*.xml ${{github.workspace}}
- name: Install Purple dependencies for Windows
shell: pwsh
run: powershell.exe -NoProfile -ExecutionPolicy Bypass "& ${{github.workspace}}\install_purple_dependencies.ps1"
working-directory: ${{github.workspace}}
run: powershell.exe -NoProfile -ExecutionPolicy Bypass "& ${{github.workspace}}\install_oobee_dependencies.ps1"
working-directory: ${{github.workspace}}

- name: Zip entire Purple folder (Windows)
shell: pwsh
run: Compress-Archive -Path ${{github.workspace}}/* -DestinationPath purple-a11y-portable-windows.zip
run: Compress-Archive -Path ${{github.workspace}}/* -DestinationPath oobee-portable-windows.zip

- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: purple-a11y-portable-windows
path: ./purple-a11y-portable-windows.zip
name: oobee-portable-windows
path: ./oobee-portable-windows.zip

- name: Release Windows artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
purple-a11y-portable-windows.zip
mac-install-purple:
oobee-portable-windows.zip
mac-install-oobee:
runs-on: self-hosted
environment: macos

steps:
- name: Clean Workspace Folder
run: |
rm -rf ./* || true
rm -rf ./.??* || true
rm -rf ./* || true
rm -rf ./.??* || true
- name: Check out repository code
uses: actions/checkout@v3
with:
path: purple-a11y
path: oobee

- name: Grant execute permissions for user
run: chmod ugo+rwx ./scripts/*.command ./scripts/*.sh
working-directory: purple-a11y
working-directory: oobee

- name: Copy scripts to parent directory
run: |
cp ./purple-a11y/scripts/{*.command,*.sh,*.xml} ${{ github.workspace }}
cp ./oobee/scripts/{*.command,*.sh,*.xml} ${{ github.workspace }}
- name: Install Purple dependencies for MacOS
run: |
./install_purple_dependencies.command
./install_oobee_dependencies.command
- name: Sign required binaries for MacOS
run: |
# Find a valid code signing certificate in your keychain for distribution outside Mac App Store
CERTIFICATE=$(security find-identity -v -p codesigning -s - | tail -n +2 | grep -o '"Developer ID Application:[^"]*"' | sed 's/"//g')
# Paths to the binaries you want to sign only ending with .node
BINARIES=($(find . -type f -name "*.node" ! -path "*.framework/*" ! -path "*.dSYM/*"))
BINARIES=($(find . -type f \( -name "*.node" -o -name "*.sh" -o -name "*.command" \) ! -path "*.framework/*" ! -path "*.dSYM/*"))
# Loop through the binary paths and sign each one with a secure timestamp
for binary in "${BINARIES[@]}"; do
# Check if the binary is already signed
Expand All @@ -88,20 +88,20 @@ jobs:
echo "Failed to sign: $binary"
fi
done
- name: Zip entire Purple folder (Mac)
run: |
zip purple-a11y-portable-mac.zip -y -r ./
zip oobee-portable-mac.zip -y -r ./
- name: Upload Mac artifact
uses: actions/upload-artifact@v4
with:
name: purple-a11y-portable-mac
path: ./purple-a11y-portable-mac.zip
name: oobee-portable-mac
path: ./oobee-portable-mac.zip

- name: Release Mac artifact
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
purple-a11y-portable-mac.zip
oobee-portable-mac.zip
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dist
node_modules
.vscode
.a11y_storage
.oobee_storage
results/
logs/
debug*.txt
Expand All @@ -19,7 +19,7 @@ nodejs-*
amazon-corretto-*
verapdf*
ms-playwright/
a11y-scan-results*.zip
oobee-scan-results*.zip
PHScan_*/
Upload Files/
Chromium Support/
Expand Down
12 changes: 6 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Use Node LTS alpine distribution
FROM node:lts-alpine3.18

# Installation of packages for purple-a11y and chromium
# Installation of packages for oobee and chromium
RUN apk add build-base gcompat g++ make python3 zip bash git chromium openjdk11-jre

# Installation of VeraPDF
Expand All @@ -22,13 +22,13 @@ RUN echo $'<?xml version="1.0" encoding="UTF-8" standalone="no"?> \n\
<com.izforge.izpack.panels.finish.FinishPanel id="finish"/> \n\
</AutomatedInstallation> ' >> /opt/verapdf-auto-install-docker.xml

RUN wget "https://github.com/GovTechSG/purple-a11y/releases/download/cache/verapdf-installer.zip" -P /opt
RUN wget "https://github.com/GovTechSG/oobee/releases/download/cache/verapdf-installer.zip" -P /opt
RUN unzip /opt/verapdf-installer.zip -d /opt
RUN latest_version=$(ls -d /opt/verapdf-greenfield-* | sort -V | tail -n 1) && [ -n "$latest_version" ] && \
"$latest_version/verapdf-install" "/opt/verapdf-auto-install-docker.xml"
RUN rm -rf /opt/verapdf-installer.zip /opt/verapdf-greenfield-*

# Set purple-a11y directory
# Set oobee directory
WORKDIR /app

# Copy package.json to working directory, perform npm install before copying the remaining files
Expand All @@ -47,11 +47,11 @@ RUN npm install --force --omit=dev
RUN npx playwright install chromium webkit

# Add non-privileged user
RUN addgroup -S purple && adduser -S -G purple purple
RUN chown -R purple:purple ./
RUN addgroup -S oobee && adduser -S -G oobee oobee
RUN chown -R oobee:oobee ./

# Run everything after as non-privileged user.
USER purple
USER oobee

# Copy application and support files
COPY . .
Expand Down
Loading

0 comments on commit ecd0d15

Please sign in to comment.