Skip to content

Commit

Permalink
Merge branch 'develop' into token-registration
Browse files Browse the repository at this point in the history
Mainly to get matrix-org#10561

Signed-off-by: Callum Brown <callum@calcuode.com>
  • Loading branch information
govynnus committed Aug 19, 2021
2 parents b76099e + b5fef60 commit 86bbc24
Show file tree
Hide file tree
Showing 605 changed files with 28,184 additions and 13,399 deletions.
13 changes: 0 additions & 13 deletions .buildkite/.env

This file was deleted.

35 changes: 0 additions & 35 deletions .buildkite/merge_base_branch.sh

This file was deleted.

4 changes: 2 additions & 2 deletions .buildkite/postgres-config.yaml → .ci/postgres-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
# CI's Docker setup at the point where this file is considered.
server_name: "localhost:8800"

signing_key_path: ".buildkite/test.signing.key"
signing_key_path: ".ci/test.signing.key"

report_stats: false

database:
name: "psycopg2"
args:
user: postgres
host: postgres
host: localhost
password: postgres
database: synapse

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# We use "postgres" as a database because it's bound to exist and the "synapse" one
# doesn't exist yet.
db_conn = psycopg2.connect(
user="postgres", host="postgres", password="postgres", dbname="postgres"
user="postgres", host="localhost", password="postgres", dbname="postgres"
)
db_conn.autocommit = True
cur = db_conn.cursor()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

# this script is run by buildkite in a plain `bionic` container; it installs the
# this script is run by GitHub Actions in a plain `bionic` container; it installs the
# minimal requirements for tox and hands over to the py3-old tox environment.

set -ex
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,22 @@ pip install -e .
echo "--- Generate the signing key"

# Generate the server's signing key.
python -m synapse.app.homeserver --generate-keys -c .buildkite/sqlite-config.yaml
python -m synapse.app.homeserver --generate-keys -c .ci/sqlite-config.yaml

echo "--- Prepare test database"

# Make sure the SQLite3 database is using the latest schema and has no pending background update.
scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml
scripts-dev/update_database --database-config .ci/sqlite-config.yaml

# Create the PostgreSQL database.
./.buildkite/scripts/postgres_exec.py "CREATE DATABASE synapse"
.ci/scripts/postgres_exec.py "CREATE DATABASE synapse"

echo "+++ Run synapse_port_db against test database"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml

# We should be able to run twice against the same database.
echo "+++ Run synapse_port_db a second time"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml

#####

Expand All @@ -44,14 +44,14 @@ coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --p
echo "--- Prepare empty SQLite database"

# we do this by deleting the sqlite db, and then doing the same again.
rm .buildkite/test_db.db
rm .ci/test_db.db

scripts-dev/update_database --database-config .buildkite/sqlite-config.yaml
scripts-dev/update_database --database-config .ci/sqlite-config.yaml

# re-create the PostgreSQL database.
./.buildkite/scripts/postgres_exec.py \
.ci/scripts/postgres_exec.py \
"DROP DATABASE synapse" \
"CREATE DATABASE synapse"

echo "+++ Run synapse_port_db against empty database"
coverage run scripts/synapse_port_db --sqlite-database .buildkite/test_db.db --postgres-config .buildkite/postgres-config.yaml
coverage run scripts/synapse_port_db --sqlite-database .ci/test_db.db --postgres-config .ci/postgres-config.yaml
4 changes: 2 additions & 2 deletions .buildkite/sqlite-config.yaml → .ci/sqlite-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
# schema and run background updates on it.
server_name: "localhost:8800"

signing_key_path: ".buildkite/test.signing.key"
signing_key_path: ".ci/test.signing.key"

report_stats: false

database:
name: "sqlite3"
args:
database: ".buildkite/test_db.db"
database: ".ci/test_db.db"

# Suppress the key server warning.
trusted_key_servers: []
File renamed without changes.
File renamed without changes.
78 changes: 0 additions & 78 deletions .circleci/config.yml

This file was deleted.

72 changes: 72 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# GitHub actions workflow which builds and publishes the docker images.

name: Build docker images

on:
push:
tags: ["v*"]
branches: [ master, main ]
workflow_dispatch:

permissions:
contents: read

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
id: qemu
uses: docker/setup-qemu-action@v1
with:
platforms: arm64

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1

- name: Inspect builder
run: docker buildx inspect

- name: Log in to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Calculate docker image tag
id: set-tag
run: |
case "${GITHUB_REF}" in
refs/heads/master|refs/heads/main)
tag=latest
;;
refs/tags/*)
tag=${GITHUB_REF#refs/tags/}
;;
*)
tag=${GITHUB_SHA}
;;
esac
echo "::set-output name=tag::$tag"
# for release builds, we want to get the amd64 image out asap, so first
# we do an amd64-only build, before following up with a multiarch build.
- name: Build and push amd64
uses: docker/build-push-action@v2
if: "${{ startsWith(github.ref, 'refs/tags/v') }}"
with:
push: true
labels: "gitsha1=${{ github.sha }}"
tags: "matrixdotorg/synapse:${{ steps.set-tag.outputs.tag }}"
file: "docker/Dockerfile"
platforms: linux/amd64

- name: Build and push all platforms
uses: docker/build-push-action@v2
with:
push: true
labels: "gitsha1=${{ github.sha }}"
tags: "matrixdotorg/synapse:${{ steps.set-tag.outputs.tag }}"
file: "docker/Dockerfile"
platforms: linux/amd64,linux/arm64
41 changes: 38 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,12 @@ name: Deploy the documentation
on:
push:
branches:
# For bleeding-edge documentation
- develop
# For documentation specific to a release
- 'release-v*'
# stable docs
- master

workflow_dispatch:

Expand All @@ -20,12 +25,42 @@ jobs:
mdbook-version: '0.4.9'

- name: Build the documentation
run: mdbook build
# mdbook will only create an index.html if we're including docs/README.md in SUMMARY.md.
# However, we're using docs/README.md for other purposes and need to pick a new page
# as the default. Let's opt for the welcome page instead.
run: |
mdbook build
cp book/welcome_and_overview.html book/index.html
- name: Deploy latest documentation
# Figure out the target directory.
#
# The target directory depends on the name of the branch
#
- name: Get the target directory name
id: vars
run: |
# first strip the 'refs/heads/' prefix with some shell foo
branch="${GITHUB_REF#refs/heads/}"
case $branch in
release-*)
# strip 'release-' from the name for release branches.
branch="${branch#release-}"
;;
master)
# deploy to "latest" for the master branch.
branch="latest"
;;
esac
# finally, set the 'branch-version' var.
echo "::set-output name=branch-version::$branch"
# Deploy to the target directory.
- name: Deploy to gh pages
uses: peaceiris/actions-gh-pages@068dc23d9710f1ba62e86896f84735d869951305 # v3.8.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
keep_files: true
publish_dir: ./book
destination_dir: ./develop
destination_dir: ./${{ steps.vars.outputs.branch-version }}
Loading

0 comments on commit 86bbc24

Please sign in to comment.