This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Migrate bash linupdate to python linupdate (Debian 12)" | ||
on: | ||
push: | ||
branches: [ python ] | ||
pull_request: | ||
push: | ||
branches: [ main ] | ||
jobs: | ||
# Try to migrate from old linupdate (bash) to new linupdate (python) package on Debian 12 | ||
migrate-debian-12: | ||
Check failure on line 12 in .github/workflows/test-migration.yml GitHub Actions / Migrate bash linupdate to python linupdate (Debian 12)Invalid workflow file
|
||
name: Migrate bash linupdate to python linupdate (Debian 12) | ||
needs: | ||
build-deb | ||
runs-on: ubuntu-latest | ||
container: | ||
image: debian:12 | ||
options: --user root | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Get linupdate version | ||
run: echo "VERSION=$(cat ${GITHUB_WORKSPACE}/version)" >> $GITHUB_ENV | ||
# Install linupdate bash version | ||
- name: Install linupdate bash version | ||
run: | | ||
apt-get update -y | ||
apt-get install -y curl gpg | ||
curl -sS https://packages.bespin.ovh/repo/gpgkeys/packages.bespin.ovh.pub | gpg --dearmor > /etc/apt/trusted.gpg.d/packages.bespin.ovh.gpg | ||
echo "deb https://packages.bespin.ovh/repo/linupdate/bookworm/main_prod bookworm main" > /etc/apt/sources.list.d/linupdate.list | ||
apt-get update -y | ||
apt-get install -y linupdate | ||
# Set up some params | ||
- name: Set up linupdate bash version | ||
run: | | ||
linupdate --profile test-migration | ||
linupdate --env test-migration | ||
linupdate --exclude package1,package2 | ||
linupdate --exclude-major package3,package4 | ||
sed -i 's/MAIL_RECIPIENT=.*/MAIL_RECIPIENT="[email protected]"/g' /etc/linupdate/linupdate.conf | ||
sed -i 's/SERVICE_RESTART=.*/SERVICE_RESTART="service1,service2"/g' /etc/linupdate/linupdate.conf | ||
linupdate --mod-enable reposerver | ||
linupdate --mod-configure reposerver --url https://packages.bespin.ovh --fail-level 3 | ||
# Download builded deb package artifact | ||
- name: Download artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: linupdate-test-build_${{ env.VERSION }}_all.deb | ||
- name: Install package | ||
run: | | ||
apt-get update -y | ||
apt-get install -y ./linupdate-test-build_${{ env.VERSION }}_all.deb | ||
# Tests some params | ||
- name: Print config files content | ||
run: | | ||
cat /etc/linupdate/linupdate.yml /etc/linupdate/update.yml | ||
- name: "Run test: print help" | ||
run: python3 /opt/linupdate/linupdate.py --help | ||
- name: "Run test: print version" | ||
run: python3 /opt/linupdate/linupdate.py --version | ||
- name: "Run test: print profile" | ||
run: python3 /opt/linupdate/linupdate.py --profile | ||
- name: "Run test: print environment" | ||
run: python3 /opt/linupdate/linupdate.py --env | ||
- name: "Run test: get mail recipient" | ||
run: python3 /opt/linupdate/linupdate.py --get-mail-recipient | ||
- name: "Run test: get package exclusions" | ||
run: python3 /opt/linupdate/linupdate.py --get-exclude | ||
- name: "Run test: get package exclusions on major update" | ||
run: python3 /opt/linupdate/linupdate.py --get-exclude-major | ||
- name: "Run test: get services to restart after update" | ||
run: python3 /opt/linupdate/linupdate.py --get-service-restart | ||
- name: "Run test: enable reposerver module" | ||
run: python3 /opt/linupdate/linupdate.py --mod-enable reposerver | ||
- name: "Run test: print reposerver help" | ||
run: python3 /opt/linupdate/linupdate.py --mod-configure reposerver --help | ||
- name: "Run test: print raw configuration" | ||
run: python3 /opt/linupdate/linupdate.py --show-config |