Skip to content

Commit

Permalink
Manage versioning (#6638)
Browse files Browse the repository at this point in the history
  • Loading branch information
peb-adr committed Aug 30, 2023
1 parent 5de48e9 commit 02c9e90
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/build-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ on:
jobs:
build:
name: Builds Docker images
outputs:
openslides-version: ${{ steps.readversion.outputs.version }}
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -32,6 +34,10 @@ jobs:
with:
submodules: true

- name: Read version
id: readversion
run: echo "version=$(cat VERSION)" >> "$GITHUB_OUTPUT"

- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" |
docker login ghcr.io --username ${{ github.actor }} --password-stdin
Expand All @@ -50,3 +56,22 @@ jobs:
./dev/docker/build.sh -D $DOCKER_REPO -t latest ${{ matrix.service.name }}
docker push $(./dev/docker/build.sh -D $DOCKER_REPO -t latest --images ${{ matrix.service.name }})
esac
dispatch-build-manage-tool:
runs-on: ubuntu-latest
if: startsWith(github.ref_name, 'stable/4')
needs: build
steps:
- name: Generate access token
uses: tibdex/github-app-token@v1
id: generate-token
with:
app_id: ${{ secrets.AUTOMATION_APP_ID }}
private_key: ${{ secrets.AUTOMATION_APP_PRIVATE_KEY }}
- name: Send dispatch to openslides-manage
uses: peter-evans/repository-dispatch@v2
with:
event-type: stable-update
repository: ${{ github.repository_owner }}/openslides-manage-service
token: ${{ steps.generate-token.outputs.token }}
client-payload: '{"branch": "${{ github.ref_name }}", "version": "${{ needs.build.outputs.openslides-version }}"}'
8 changes: 7 additions & 1 deletion INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ It is therefore recommended to pin the version explicitly in the `config.yml` li
defaults:
tag: 4.0.0

Note that if changes to the configuration or structure of the docker stack were
made the appropriate version of the `openslides` tool must also be refetched
from the [releases](https://github.com/OpenSlides/openslides-manage-service/releases)
of the openslides-manage-service repository to reflect these in the generated
compose file.

To update to the new version, set the new tag, regenerate the compose file and
apply the changes to the containers:

Expand All @@ -183,7 +189,7 @@ To check the current status and start migrations if necessary, run:

### Incompatibilities

- 4.0.7
- 4.0.8
- The environment variables `DATASTORE_DATABASE_*` were renamed to
`DATABASE_*`. If custom values were used, this must be reflected in config
files.
Expand Down
9 changes: 6 additions & 3 deletions dev/scripts/make-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ REMOTE_NAME=
OPT_PULL=
OPT_LOCAL=

# do not page diff and log outputs
GIT_PAGER=

usage() {
cat <<EOF
Expand Down Expand Up @@ -133,7 +136,7 @@ make_staging_update() {

ask y "Fetch all submodules changes now?" &&
fetch_all_changes || :
diff_cmd="git --no-pager diff --color=always --submodule=log"
diff_cmd="git diff --color=always --submodule=log"
[[ "$($diff_cmd | grep -c .)" -gt 0 ]] ||
abort 0
echo ''
Expand Down Expand Up @@ -169,7 +172,7 @@ make_staging_update() {
done || :

echo ''
diff_cmd="git --no-pager diff --staged --submodule=log"
diff_cmd="git diff --staged --submodule=log"
[[ "$($diff_cmd | grep -c .)" -gt 0 ]] || {
echo "No changes added."
abort 0
Expand Down Expand Up @@ -249,7 +252,7 @@ make_stable_update() {

# Merge, but don't commit yet ...
# (also we expect conflicts in submodules so we hide that output)
git merge --no-commit --no-ff "$target_sha" --log >/dev/null || :
git merge -Xtheirs --no-commit --no-ff "$target_sha" --log >/dev/null || :
# ... because we want to change the submod pointers to stable
for mod in $(git submodule status | awk '{print $2}'); do
git add "$mod"
Expand Down

0 comments on commit 02c9e90

Please sign in to comment.