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

Rework scripts for syncing content #488

Merged
merged 3 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
11 changes: 11 additions & 0 deletions .ci/install-azcopy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash
set -ex

sudo apt-get update
sudo apt-get install -y wget curl

wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
sudo apt-get update
sudo apt-get install -y azcopy
rm -f packages-microsoft-prod.deb
2 changes: 2 additions & 0 deletions .ci/install-htmlq.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

set -ex

wget https://github.com/mgdm/htmlq/releases/download/v0.4.0/htmlq-x86_64-linux.tar.gz
tar -xzf htmlq-x86_64-linux.tar.gz
sudo install htmlq /usr/bin/htmlq
Expand Down
10 changes: 7 additions & 3 deletions .ci/upload.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
#!/usr/bin/env bash

set -e

rm -rf dist
mkdir dist/

export STORAGE_ACCOUNT_NAME=platopslackhelpbotai
export CONTAINER_NAME=the-hmcts-way

function extractMain () {
local path=$1

Expand All @@ -19,6 +18,11 @@ export -f extractMain

find build -name "*.html" -not -path "build/search/*" -exec bash -c "extractMain \"{}\"" \;

export STORAGE_ACCOUNT_NAME=platopslackhelpbotai
export CONTAINER_NAME=the-hmcts-way
export AZCOPY_AUTO_LOGIN_TYPE=AZCLI
export AZCOPY_TENANT_ID=531ff96d-0ae9-462a-8d2d-bec7c0b42082

# we use sync here so that deleted files get removed
azcopy sync --compare-hash=md5 \
--delete-destination=true \
Expand Down
1 change: 1 addition & 0 deletions .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ aqda
ard
aso
automerge
AZCLI
azcopy
bpdq
brfxgseqf
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
architecture: 'x64'
bundler-cache: true
- name: Build
run: bundle exec middleman build
Expand Down
20 changes: 11 additions & 9 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
- name: Setup Ruby
uses: ruby/setup-ruby@v1
with:
architecture: 'x64'
bundler-cache: true
- name: Build site
run: bundle exec rake build
Expand All @@ -55,11 +54,14 @@ jobs:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Upload files to Azure Storage
uses: azure/cli@v2
with:
azcliversion: latest
inlineScript: |
./.ci/install-htmlq.sh
./.ci/upload.sh
./.ci/trigger-index.sh
- name: Install dependencies
run: |
./.ci/install-htmlq.sh
./.ci/install-azcopy.sh
- name: Process content
run: |
./.ci/upload.sh
- name: Trigger index
run: |
./.ci/trigger-index.sh
# end of Azure AI Search
Loading