Skip to content

Commit 12cebe5

Browse files
Add version and size to restore
1 parent 2817290 commit 12cebe5

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

.github/workflows/restore.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,16 @@ on:
2626
description: 'Hostname of the server'
2727
required: true
2828
type: string
29+
size:
30+
description: 'Size of the dataset to restore (small/medium)'
31+
required: false
32+
default: 'small'
33+
type: string
34+
version:
35+
description: 'Version of the dataset to restore (3.8/3.9)'
36+
required: false
37+
default: '3.8'
38+
type: string
2939
ref:
3040
description: 'Branch ref to use'
3141
required: false
@@ -69,16 +79,16 @@ jobs:
6979
az storage blob download \
7080
--account-name ghesresults \
7181
--container-name ghes-data \
72-
--name v3.8-small-docs.tar.gz \
73-
--file ghes-data/3.8-small-docs.tar.gz \
82+
--name v{{ inputs.version }}-{{ inputs.size }}.tar.gz \
83+
--file ghes-data/{{ inputs.version }}-{{ inputs.size }}.tar.gz \
7484
--connection-string "${{ secrets.CONNECTIONSTRING }}"
7585
7686
- name: Unzip backup and setup symlink
7787
run: |
7888
mkdir "$HOME/ghe-backup-data"
7989
dir_name=$(date +%s)
8090
mkdir "$HOME/ghe-backup-data/$dir_name"
81-
tar -xvf "ghes-data/3.8-small-docs.tar.gz" -C "$HOME/ghe-backup-data/$dir_name"
91+
tar -xvf "ghes-data/{{ inputs.version }}-{{ inputs.size }}.tar.gz" -C "$HOME/ghe-backup-data/$dir_name"
8292
8393
ln -s "$dir_name" "$HOME/ghe-backup-data/current"
8494
@@ -89,7 +99,7 @@ jobs:
8999
run: chmod 0600 "$HOME/backup"
90100

91101
- name: change version
92-
run: echo "3.8.0" > "$HOME/version"
102+
run: echo "{{ inputs.version }}.0" > "$HOME/version"
93103

94104
- name: Prepare for restore
95105
run: ssh -p122 -i "$HOME/backup" -o StrictHostKeyChecking=no admin@${{ inputs.hostname }} "ghe-maintenance -s"

0 commit comments

Comments
 (0)