-
Notifications
You must be signed in to change notification settings - Fork 550
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
With Ubuntu Desktop Core to be available in April, a new sosreport may be required for debugging annd grabbing data of these systems. This is an inital start to get this implemented and automated in publishing for usage. Add testing for strictmode snap for latest ubuntu distro Related: SET-380 Signed-off-by: Arif Ali <[email protected]>
- Loading branch information
Showing
3 changed files
with
145 additions
and
6 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: snap_strictmode | ||
on: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: | ||
- published | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-22.04 | ||
concurrency: | ||
group: snap-strictmode-build | ||
cancel-in-progress: true | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- run: | | ||
sudo cp snap/snapcraft_strictmode.yaml snapcraft.yaml | ||
- uses: snapcore/action-build@v1 | ||
id: build-snap | ||
# Make sure the snap is installable | ||
- run: | | ||
sudo apt -y remove sosreport | ||
sudo snap install --devmode ${{ steps.build-snap.outputs.snap }} | ||
sudo snap alias sosreport.sos sos | ||
# Do some testing with the snap | ||
- run: | | ||
sudo sos help | ||
- uses: snapcore/action-publish@v1 | ||
if: ${{ github.event_name == 'push' }} | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} | ||
with: | ||
snap: ${{ steps.build-snap.outputs.snap }} | ||
release: "strictmode/edge" | ||
- uses: snapcore/action-publish@v1 | ||
if: ${{ github.event_name == 'release' }} | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.STORE_LOGIN }} | ||
with: | ||
snap: ${{ steps.build-snap.outputs.snap }} | ||
release: "strictmode/beta" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: sosreport | ||
summary: Sos is an extensible, portable, support data collection tool | ||
description: | | ||
Sos is an extensible, portable, support data collection tool | ||
primarily aimed at Linux distributions and other UNIX-like operating | ||
systems. | ||
grade: stable | ||
base: core22 | ||
confinement: strict | ||
adopt-info: sos | ||
license: GPL-2.0-or-later | ||
environment: | ||
PYTHONPATH: ${SNAP}/lib/python3.10/site-packages:${SNAP}/usr/lib/python3/dist-packages:${PYTHONPATH} | ||
MAGIC: ${SNAP}/usr/share/file/magic.mgc | ||
|
||
parts: | ||
sos: | ||
plugin: python | ||
source: . | ||
override-pull: | | ||
craftctl default | ||
craftctl set version="$(git describe --tags --always)" | ||
build-attributes: | ||
- enable-patchelf | ||
build-packages: | ||
- git | ||
- python3 | ||
- snapcraft | ||
- gettext | ||
- python3-venv | ||
stage-packages: | ||
- coreutils | ||
- cloud-init | ||
- cryptsetup-bin | ||
- e2fsprogs | ||
- fdisk | ||
- iproute2 | ||
- libatm1 | ||
- libpam-modules-bin | ||
- mount | ||
- procps | ||
- systemd | ||
- udev | ||
- util-linux | ||
- python3-magic | ||
- python3-packaging | ||
- python3-pexpect | ||
cleanup: | ||
after: [sos] | ||
plugin: nil | ||
build-snaps: [core22] | ||
override-prime: | | ||
set -eux | ||
for snap in "core22"; do # List all content-snaps you're using here | ||
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" "$SNAPCRAFT_PRIME/usr/{}" \; | ||
done | ||
for CRUFT in bug lintian man; do | ||
rm -rf $SNAPCRAFT_PRIME/usr/share/$CRUFT | ||
done | ||
find $SNAPCRAFT_PRIME/usr/share/doc/ -type f -not -name 'copyright' -delete | ||
find $SNAPCRAFT_PRIME/usr/share -type d -empty -delete | ||
apps: | ||
sos: | ||
command: bin/sos | ||
sosreport: | ||
command: bin/sos report | ||
sos-collector: | ||
command: bin/sos collector |