Skip to content
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

feat: devcontainer development #230

Open
wants to merge 67 commits into
base: master
Choose a base branch
from

Conversation

gjrtimmer
Copy link
Contributor

DevContainer Development

To facilitate easier development and contribution, I have spent this past weekend making a contribution that hopefully will benefit everybody. It's quite a big update. However, it is not a code contribution; it's a repository contribution. So, the firmware code has not been touched.

This PR will add devcontainer support to the repository while allowing manual Docker development like before.

  • Documentation updated
  • DevContainer (Linux) added
  • DevContainer (macOS/Darwin) added
  • DevContainer persist bash_history
  • Added scripts
  • Added .gitconfig
  • Added commands with git aliases
  • Added extensions
  • Added hadolint for Dockerfile
  • Added shellcheck for scripts

macOS

Documentation updated to give the reason why macOS requires a volume to build it successfully; this is because of the APFS filesystem Darwin uses.

Scripts

The setup_build.sh has been renamed and moved to scripts/configure.sh, and only a small change has been made regarding the root directory.
Furthermore, additional scripts have been added to ease development; these include build.sh for building the firmware and collecting the generated image into a dist folder, including the generation of the sha256 hashes. The sha256 hashes have been added based on what I saw in the Web UI.
The configure.sh script is the setup_build.sh.
The clean.sh script cleans the repository of the buildroot and dist direcetories.
The init.sh script is the initialization script for the build container.
The sync.sh is a unique script for people who develop on macOS, which will initiate syncing between the host and container workspace and vice versa.

Commands

The devcontainer will automatically add additional git command aliases to facilitate easier development. These commands can be run from anywhere in the git repository; the aliases are defined in the repository .gitconfig.

Each command listed in the table is a git alias therefor these commands can be executed by prefixing it with git, for example git sha1 will display the short sha of the last commit.

Git Command Description
root Display root path of repository
sha1 This will print the 8 char short sha of the current commit
configure Configure the repository by setting up buildroot, must be run everytime buildroot is updated
build Build the firmware
cleanup Cleanup the repository
sync Used by macOS / darwin users to sync the changes between the container and the host

Hadolint

Hadolint has been added for the Dockerfile check

ShellCheck

Spellcheck has been added for script check

Comments

Let me know if there are any questions, please try it out, and hopefully this will get merged.

@gjrtimmer
Copy link
Contributor Author

Fixed last comment

@svenrademakers
Copy link
Collaborator

That would be a great idea. One of the other more urgent matters on my todo list is to make the firmware version more prominent in our firmware and nuke the versioning based on bmcd daemon.. long story short; i require a hook soon so that would be sorted then as well

@gjrtimmer
Copy link
Contributor Author

So the build script no has a argument --release | -r for the release version and a --dir | -d for the directory if you use a different dir in the configure.sh script.

Furthermore, I had to make several changes to the GitHub pipeline because there were some issues when building a fork. These should now all be resolved. For example, actions/checkout@v4 no longer checkout tags; furthermore, a. fork does not have tags yet. So, there were some issues, but they are resolved now.

@gjrtimmer
Copy link
Contributor Author

Fix artifacts to now include the sha256 hashes

@gjrtimmer
Copy link
Contributor Author

The last four GitHub actions were built successfully.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants