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

DietPi-PREP | Feature/automated build #2756

Merged
merged 9 commits into from
May 4, 2019
Merged

DietPi-PREP | Feature/automated build #2756

merged 9 commits into from
May 4, 2019

Conversation

FredericGuilbault
Copy link
Contributor

Status Proof of concept

Add the capability to declare environment variables before script execution to have a non-interactive build. #2745

@MichaIng MichaIng added Installer 💠 Issues related to DietPi-Installer and/or pre-image used Enhancement 💨 labels May 2, 2019
FredericGuilbault and others added 3 commits May 4, 2019 10:29
+ DietPi-PREP | Consistency: Use G_* naming for all environment variables
+ DietPi-PREP | Add valid value checks for environment variables, otherwise force interactive prompt
+ DietPi-PREP | Code alignment according to 8 char tab mode, which is default on our GitHub scripts and most UNIX editors like nano
@MichaIng
Copy link
Owner

MichaIng commented May 4, 2019

@FredericGuilbault
Many thanks for opening this PR.

I added checks to verify the set environment variables have valid values, otherwise it is reverted to interactive input. This is important since otherwise when some typo or invalid value was set, the script runs into very hard to debug errors or even worse: It runs through without any obvious error and the final image will then run into follow-up errors.

The last 2 commits you did are included as well. We were coding concurrently here 😉.

Testing required:

  • Add all environment variables with valid values
  • Add all environment variables with invalid values => Revert to interactive input expected
  • Add no environment variables

Just a minor side note:

  • When coding via editor outside of GitHub, please assure that "tabs" are as well added as tabs with 8 character space. This is our default for scripts on GitHub and also matches the defaults of nano and vim and such.
  • Otherwise the alignment will look ugly/broken on GitHub and when opening/editing the script on the DietPi system via cmdline editor.

@MichaIng MichaIng added this to the v6.23 milestone May 4, 2019
MichaIng added 2 commits May 4, 2019 17:50
+ DietPi-PREP | Syntax
+ DietPi-PREP | Tiny: Remove free spaces
@MichaIng
Copy link
Owner

MichaIng commented May 4, 2019

Okay we cannot use G_HW_MODEL, G_GITOWNER etc.
These are set do defaults when dietpi-globals are sourced. So skip the "G_" for environment variables, assign to "G_" values when set and passed validity check.

MichaIng added 2 commits May 4, 2019 18:14
+ DietPi-PREP | Revert to non "G_" naming for environment variable as DietPi-Globals sets defaults for G_HW_MODEL, G_GITBRANCH and G_GITOWNER
+ DietPi-PREP | Forgotten variable naming revert
@MichaIng
Copy link
Owner

MichaIng commented May 4, 2019

Okay passed tests with all combinations. I will merge.

Changelog: 02e15dc

Many thanks again to @FredericGuilbault for adding this 👍.

@MichaIng MichaIng merged commit f2dddb8 into MichaIng:dev May 4, 2019
@MichaIng MichaIng changed the title Feature/automated build DietPi-PREP | Feature/automated build May 4, 2019
@FredericGuilbault FredericGuilbault deleted the feature/automated_build branch May 4, 2019 19:48
@FredericGuilbault
Copy link
Contributor Author

Cool,
Sorry for the tabs, Looked good on atom and I didin't checked before commit. My bad.

@MichaIng
Copy link
Owner

MichaIng commented May 5, 2019

@FredericGuilbault
No problem, just a minor visual thing 😉.

This was referenced May 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 💨 Installer 💠 Issues related to DietPi-Installer and/or pre-image used
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants