-
Notifications
You must be signed in to change notification settings - Fork 544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[snap] Add snapcraft for strictmode #3454
Draft
arif-ali
wants to merge
1
commit into
sosreport:main
Choose a base branch
from
arif-ali:sos-arif-snap-strictmode
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You plan to extend the list of snaps in future, right? As currently the for cycle with 1 iteration makes a little sense..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point, it was a copy and paste from somewhere else. I will solve that, once I've figured out why the stageone tasks are not going through, and solve these.