-
Notifications
You must be signed in to change notification settings - Fork 6
111 lines (98 loc) · 4.05 KB
/
Copy pathrebuild-boxes.yml
File metadata and controls
111 lines (98 loc) · 4.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: Rebuild Boxes
on:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref_name }}
cancel-in-progress: true
jobs:
vagrant-up:
name: "Rebuild box with ${{ matrix.box_name }}"
runs-on: ubuntu-22.04
defaults:
run:
working-directory: tests/vagrant
strategy:
fail-fast: false
matrix:
include:
- distr: "onlyoffice"
os: "base-debian13"
box_name: "debian13"
- distr: "onlyoffice"
os: "base-ubuntu2404"
box_name: "ubuntu2404"
- distr: "onlyoffice"
os: "base-ubuntu2604"
box_name: "ubuntu2604"
steps:
- name: Free Disk Space
working-directory: ${{ github.workspace }}
run: |
sudo docker image prune --all --force
sudo rm -rf /usr/local/lib/android || true
- name: Checkout code
uses: actions/checkout@v6
- name: Get update and install vagrant
working-directory: ${{ github.workspace }}
run: |
set -eux
sudo wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
sudo echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(grep -oP '(?<=UBUNTU_CODENAME=).*' /etc/os-release || lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt update -y
sudo apt-get install -y vagrant
# Temporary install VBox 7.1.12 via curl (.deb) to avoid SSH/NAT issues in 7.1.14
VBOX_DEB=$(curl -fsSL https://download.virtualbox.org/virtualbox/7.1.12/MD5SUMS | grep -oE 'virtualbox-7\.1_7\.1\.12-[0-9]+~Ubuntu~jammy_amd64\.deb' | head -n1)
[ -n "$VBOX_DEB" ] || { echo "ERROR: could not detect VBox .deb filename"; exit 1; }
curl -fsSL "https://download.virtualbox.org/virtualbox/7.1.12/${VBOX_DEB}" -o /tmp/vbox.deb
sudo apt-get install -y /tmp/vbox.deb
- name: Install
timeout-minutes: 90
env:
DISTR: ${{ matrix.distr }}
RAM: '8192'
CPU: '3'
OS: ${{ matrix.os }}
IT: '-it enterprise'
run: |
set -eux
export DOWNLOAD_SCRIPT='-ds false'
export ARGUMENTS="-arg '--skiphardwarecheck true --makeswap false'"
vagrant up --provider=virtualbox
- name: Health check
run: |
if vagrant status | grep -q "running"; then
vagrant ssh -c "sudo bash /home/vagrant/tests/vagrant/post-install.sh healthcheck"
else
echo "VM is not running, skipping health check"
exit 1
fi
- name: Download hcp CLI
if: success()
uses: hashicorp/hcp-setup-action@v0
with:
version: latest
- name: Publish box
if: success()
env:
HCP_CLIENT_ID: ${{ secrets.HCP_CLIENT_ID }}
HCP_CLIENT_SECRET: ${{ secrets.HCP_CLIENT_SECRET }}
VAGRANT_ORG: onlyoffice
PRODUCT: docs
OS_NAME: ${{ matrix.box_name }}
run: |
set -eux
BOX_VERSION=$(vagrant ssh -c "command -v rpm >/dev/null 2>&1 \
&& rpm -q onlyoffice-documentserver-ee --queryformat '%{VERSION}' 2>/dev/null \
|| dpkg-query -W -f='\${Version}' onlyoffice-documentserver-ee 2>/dev/null" \
2>/dev/null | tr -d '\r\n ' | grep -oE '^[0-9]+\.[0-9]+\.[0-9]+')
export BOX_VERSION
[[ "$BOX_VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || { echo "BOX_VERSION is invalid: '${BOX_VERSION}'"; exit 1; }
vagrant package ubuntu --output ${PRODUCT}-${OS_NAME}.box
wget https://raw.githubusercontent.com/ONLYOFFICE/ga-common/refs/heads/master/.github/scripts/vagrant_publish.sh
bash ./vagrant_publish.sh
rm -f ${PRODUCT}-${OS_NAME}.box || true
- name: Cleanup
if: always()
run: |
vagrant destroy --force || true
vagrant global-status --prune || true