Merge pull request #1831 from nextcloud/feature/staged-rollouts

Feature/staged rollouts
This commit is contained in:
Tobias Knöppler 2023-09-30 12:54:01 +02:00 committed by GitHub
commit abdedc0391
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 67 additions and 9 deletions

View File

@ -154,7 +154,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Selenium
run: pip install selenium
run: pip install selenium==4.10.0
- name: Wait for container startup
run: |
@ -421,7 +421,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Selenium
run: pip install selenium
run: pip install selenium==4.10.0
- name: Wait for container startup
run: |
set -e

View File

@ -197,6 +197,10 @@ jobs:
nictype: bridged
type: nic
EOF
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
- name: Setup Firefox
uses: browser-actions/setup-firefox@latest
- name: Setup GeckoDriver
@ -204,11 +208,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Selenium
run: pip install selenium
- name: Checkout code
uses: actions/checkout@v3
with:
ref: "${{ env.VERSION }}"
run: pip install selenium==4.10.0
- name: download LXD image from artifact store
uses: actions/download-artifact@v3
with:
@ -331,7 +331,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Selenium
run: pip install selenium
run: pip install selenium==4.10.0
- name: download LXD image from artifact store
uses: actions/download-artifact@v3
with:

View File

@ -15,6 +15,18 @@ git clone -b "$BRANCH" --depth 20 -q --bare https://github.com/nextcloud/nextclo
cd "$TMPDIR" || exit 1
VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
[[ -f "/usr/local/etc/instance.cfg" ]] && {
cohorte_id="$(jq .cohorteId /usr/local/etc/instance.cfg)"
[[ -f "./staged_rollouts/${VER}.txt" ]] && {
grep "^${cohorte_id}$" "./staged_rollouts/${VER}.txt" || {
echo "Skipping version $VER - cohorte ${cohorte_id} not yet active"
cd / || exit 1
exit 0
}
}
}
grep -qP "v\d+\.\d+\.\d+" <<< "$VER" && { # check format
echo "$VER" > /var/run/.ncp-latest-version

View File

@ -72,4 +72,15 @@ if needs_decrypt; then
apache2ctl -k graceful
fi
[[ -f /usr/local/etc/instance.cfg ]] || {
cohorte_id=$((1 + RANDOM % 100))
cat > /usr/local/etc/instance.cfg <<EOF
{
"cohorteId": ${cohorte_id},
"canary": false
}
EOF
}
exit 0

16
generate_cohortes.sh Executable file
View File

@ -0,0 +1,16 @@
#!/usr/bin/env bash
#min=$((101-${1:-50}))
all=({100..1})
cohortes=()
for i in ${all[@]:0:$1}
do
cohorte_id=$((RANDOM % i))
while [[ " ${cohortes[*]} " =~ .*" ${cohorte_id} ".* ]]
do
cohorte_id=$((cohorte_id+1))
done
cohortes+=($cohorte_id)
done
echo "${cohortes[*]}" | tr ' ' $'\n'

View File

@ -84,6 +84,14 @@ rm /.ncp-image
cd -
rm -rf "${TMPDIR}"
cohorte_id=$((RANDOM % 100))
cat <<EOF > /usr/local/etc/instance.cfg
{
"cohorteId": ${cohorte_id},
"canary": false
}
EOF
IP="$(get_ip)"
echo "Done.

View File

@ -1,2 +1,2 @@
robotframework
selenium
robotframework

11
updates/1.52.5.sh Normal file
View File

@ -0,0 +1,11 @@
#!/usr/bin/env bash
[[ -f /usr/local/etc/instance.cfg ]] || {
cohorte_id=$((RANDOM % 100))
cat > /usr/local/etc/instance.cfg <<EOF
{
"cohorteId": ${cohorte_id},
"canary": false
}
EOF
}