Skip to content
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
10 changes: 8 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Build
name: Prod Env Latest Build

on:
pull_request:
Expand Down Expand Up @@ -41,7 +41,13 @@ jobs:
run: |
mkdir -p tmp_extracted
tar -xzf ./wire-docs.tar.gz -C tmp_extracted

# removing old objects from the bucket to ensure, we don't keep objects at old path
aws s3 rm s3://${{ secrets.BUCKET }}/latest --recursive
aws s3 sync tmp_extracted/latest s3://${{ secrets.BUCKET }}/latest
aws s3 sync tmp_extracted/site s3://${{ secrets.BUCKET }}/site

# will be removed in the next commit
aws s3 rm s3://${{ secrets.BUCKET }}/site --recursive

aws s3 cp tmp_extracted/versions.json s3://${{ secrets.BUCKET }}/versions.json
rm -rf tmp_extracted
6 changes: 2 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI Build
name: Test Env Latest Build

on:
pull_request:
Expand Down Expand Up @@ -42,13 +42,11 @@ jobs:
mkdir -p tmp_extracted
tar -xzf ./wire-docs.tar.gz -C tmp_extracted

# removing old objects from the bucket to ensure, we don't keep objects at old path
aws s3 rm s3://${{ secrets.DEV_BUCKET }}/latest --recursive
aws s3 sync tmp_extracted/latest s3://${{ secrets.DEV_BUCKET }}/latest


aws s3 rm s3://${{ secrets.DEV_BUCKET }}/site --recursive
aws s3 sync tmp_extracted/site s3://${{ secrets.DEV_BUCKET }}/site


aws s3 cp tmp_extracted/versions.json s3://${{ secrets.DEV_BUCKET }}/versions.json
rm -rf tmp_extracted
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ check-deps:
# fetch all the tags from the remote
.PHONY: prepare
prepare: check-deps
@git fetch --tags
@bash build/prepare.sh

# Run the all versions of the documentation
Expand Down
80 changes: 44 additions & 36 deletions build/build_versions.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

set -ex
set -e
mike="pipenv run mike"

CURRENT=$(git branch --show-current)
Expand All @@ -10,8 +10,26 @@ git config --local user.name "Wire Docs"
git config --local user.email "wire-docs-author@wire.com"
git config --local submodule.recurse false

# this will check if there are warnings in mkdocs build, if any it will exit.
# It will be useful to find if internal referencing is broken
validate_output() {
local RED='\033[0;31m'
local output="$1"
# to get building logs
echo "$output"
# ignoring changelog.md as it is talking about past changes
remaining_warnings=$(echo "$output" | grep -i "WARNING" | grep -v "Doc file 'changelog/changelog.md' contains a link" | awk '{$1=$1};1')

if [ -n "$remaining_warnings" ]; then
echo -e "${RED}Errors found in the output:"
echo "$remaining_warnings"
exit 1
fi
}

# checking if it is building from a branch
if [ -n "$CURRENT" ]; then
# if building locally, the local tag would be CURRENT_TAG
CURRENT_TAG="$CURRENT"

# useful for local users to see their diffs with each mike deploy
Expand All @@ -31,56 +49,46 @@ else
if [[ "${GITHUB_REF}" == refs/tags/* ]]; then
# For a tag, strip the "refs/tags/" prefix.
CURRENT_TAG="${GITHUB_REF#refs/tags/}"
# creating a tag when releasing a tag
git tag -f $CURRENT_TAG || true
elif [[ "${GITHUB_REF}" == refs/pull/* ]]; then
# For a pull request, remove "refs/pull/" then replace "/" with "-" to get "11-merge"
pr_part="${GITHUB_REF#refs/pull/}"s
CURRENT_TAG="${pr_part//\//-}"
# we build latest everytime there is PR
CURRENT_TAG="latest"
fi
fi

fi

# always build the latest tag
git tag -f latest || true

# Get all tags
TAGS=$(git tag)
git tag -f $CURRENT_TAG || true

# Fetch the existing tags and their commits from mike
declare -A existing_tags
while read -r tag commit; do
existing_tags[$tag]=$commit
done < <($mike list | awk -F '[][]' '{print $1, $2}')

# Iterate over git tags
git show-ref --tags | while read -r commit tag; do
TAG=${tag#refs/tags/}
git checkout $TAG
commit=$(git show-ref "refs/tags/${CURRENT_TAG}" | awk '{print $1}')
git checkout ${CURRENT_TAG}

# pull the submodule
git submodule update --init --depth 1 wire-server
# pull the submodule
git submodule update --init --depth 1 wire-server

# Check if tag exists in mike
if [ -n "${existing_tags[$TAG]}" ]; then
existing_commit="${existing_tags[$TAG]}"

if [ "$commit" != "$existing_commit" ]; then
echo "Tag $TAG exists but with a different commit ($existing_commit). Updating..."
$mike delete "$TAG"
$mike deploy --update-aliases "$TAG" "$commit"
else
echo "Tag $TAG already exists with the same commit ($commit). Skipping deployment."
fi
# Check if tag exists in mike
if [ -n "${existing_tags[$CURRENT_TAG]}" ]; then
existing_commit="${existing_tags[$CURRENT_TAG]}"
if [ "$commit" != "$existing_commit" ]; then
echo "Tag $CURRENT_TAG exists but with a different commit ($existing_commit). Updating..."
$mike delete "$CURRENT_TAG"
output=$($mike deploy --update-aliases "$CURRENT_TAG" "$commit" 2>&1)
validate_output "$output"
else
echo "Tag $TAG does not exist. Deploying..."
$mike deploy --update-aliases "$TAG" "$commit"
echo "Tag $CURRENT_TAG already exists with the same commit ($commit). Skipping deployment."
fi
else
echo "Tag $CURRENT_TAG does not exist. Deploying..."
output=$($mike deploy --update-aliases "$CURRENT_TAG" "$commit" 2>&1)
validate_output "$output"
fi

# deinit the submodule to avoid issues with the next iteration
git submodule deinit -f wire-server
done
# deinit the submodule to avoid issues with the next iteration
git submodule deinit -f wire-server

# Set the default tag and create an alias to latest
$mike set-default latest
# Set the default tag and create an alias to $CURRENT_TAG
$mike set-default $CURRENT_TAG
3 changes: 2 additions & 1 deletion build/prepare.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -xeuo pipefail
set -euo pipefail

# Get the current directory (i.e. the original working directory)
ORIGINAL_DIR=$(pwd)
Expand Down Expand Up @@ -47,6 +47,7 @@ if [ -d "$TEMP_DIR/.git" ]; then
else
echo "Cloning repository to ${TEMP_DIR}"
git clone "${ORIGINAL_DIR}" "${TEMP_DIR}"
git branch --show-current > "${TEMP_DIR}/.current_branch"
fi

echo "Syncing all the other files changes from ${ORIGINAL_DIR}/ to ${TEMP_DIR}, to have uncommited changes, if any"
Expand Down
4 changes: 1 addition & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ repo_url: https://github.com/wireapp/wire-docs
edit_uri: edit/main/src/
site_author: Wire Authors
site_description: "Wire Documentation"
use_directory_urls: true
use_directory_urls: false
nav:
- Home: README.md
- Installation:
Expand Down Expand Up @@ -48,7 +48,6 @@ nav:
- Single Sign-On and User Provisioning: understand/single-sign-on/README.md
- Audio/video calling, restund servers (TURN/STUN): understand/restund.md
- Conference Calling 2.0 (aka SFT): understand/sft.md
- Federated Conference Calling: understand/sft#federated-conference-calling
- Minio: understand/minio.md
- Helm: understand/helm.md
- Federation: understand/federation/README.md
Expand Down Expand Up @@ -98,7 +97,6 @@ nav:
- Legal hold: developer/reference/team/legalhold.md
- User Activation: developer/reference/user/activation.md
- Connection: developer/reference/user/connection.md
- Connection backend internals: developer/reference/user/connection/#connection-backend-internals
- User Registration: developer/reference/user/registration.md
- User Rich info: developer/reference/user/rich-info.md
- Security Responses:
Expand Down
102 changes: 0 additions & 102 deletions src/SUMMARY.md

This file was deleted.

2 changes: 0 additions & 2 deletions src/understand/sft.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<a id="understand-sft"></a>

# Conference Calling 2.0 (aka SFT)

## Background
Expand Down
Loading