-
Notifications
You must be signed in to change notification settings - Fork 26
Create install.sh script
#119
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
base: master
Are you sure you want to change the base?
Conversation
|
@davidbeig can you check the qlty check blocking issues: https://qlty.sh/gh/decidim/projects/docker/pull/119/issues As we've talked, @microstudi will do the first round and @greenwoodt will check out the English messages and tone. Afterwards we'll check this out as @decidim/maintainers |
microstudi
left a comment
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.
I found one pain point when configuring the SMTP
Asked values are not explained, we should explain every parameter as most people won't undersand the meaning of each var:
so, instead of "SMTP_USERNAME", maybe somthing like:
SMTP Username (this is usually the email used to send emails)
Speacially confusing the difference between SMPT_ADRESS and SMTP_DOMAIN, we should explain the difference between these two!
I found another problem at the end of the script:
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.
Some standard but very minor changes to wording of script language communicating to the implementer during the installation. Also adding consistency to what you've already done.
Take a long and let me know what you think @davidbeig :)
All in all really beautifully described!
| echo -e "* • SMTP server settings for emails *" | ||
| echo -e "* • File storage settings (local or S3) *" | ||
| echo -e "* *" | ||
| echo -e "* 💡 All dependencies (Docker, etc.) will be installed for you *" |
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.
| echo -e "* 💡 All dependencies (Docker, etc.) will be installed for you *" | |
| echo -e "* 💡 All dependencies (Docker, etc) will be installed for you. *" |
| mkdir "$TMP" | ||
| fi | ||
|
|
||
| echo "📥 Downloading the installation necessary files." |
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.
| echo "📥 Downloading the installation necessary files." | |
| echo "📥 Downloading the necessary installation files." |
| # Check if .env file exists | ||
| if [ ! -f "$ENV_FILE" ]; then | ||
| echo "❌ Error: .env file not found at $ENV_FILE" | ||
| echo " Please run the installation script first or create the .env file manually." |
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.
| echo " Please run the installation script first or create the .env file manually." | |
| echo "Please run the installation script first or create the .env file manually." |
|
|
||
| docker compose --env-file "$ENV_FILE" up -d | ||
|
|
||
| echo "📋 Showing recent container logs..." |
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.
| echo "📋 Showing recent container logs..." | |
| echo "📋 Displaying recent container logs..." |
| echo "🐛 Issues: https://github.com/decidim/decidim/issues" | ||
| echo "🐛 Installation Issues: https://github.com/decidim/docker/issues" | ||
| echo | ||
| echo "Have fun using Decidim! 🗳️" |
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.
| echo "Have fun using Decidim! 🗳️" | |
| echo "Enjoy using Decidim! 🗳️" |
Its definitely sincere, however to avoid interpreting what "could" be translated as condescending.
| build_external_database() { | ||
| echo "📋 External Database Configuration" | ||
| echo " Please provide your external database details:" | ||
| echo " 💡 Make sure your database server allows connections from this machine" |
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.
| echo " 💡 Make sure your database server allows connections from this machine" | |
| echo " 💡 Make sure your database server allows connections from this machine." |
| MAPS_API_PROVIDER=${MAPS_API_PROIVDER=-here} | ||
|
|
||
| echo "───────────────────────────────────────────────" | ||
| echo "Now we are going to create the .env file." |
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.
| echo "Now we are going to create the .env file." | |
| echo "✍️ Now we are going to create the .env file." |
| export VAPID_PUBLIC_KEY | ||
| export VAPID_PRIVATE_KEY | ||
|
|
||
| echo "🔑 Keys successfully extracted" |
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.
| echo "🔑 Keys successfully extracted" | |
| echo "🔑 Keys successfully extracted!" |
| exit 1 | ||
| fi | ||
|
|
||
| echo "Correct distribution." |
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.
| echo "Correct distribution." | |
| echo "✅ Correct distribution." |
| if [ -z "$SKIP_MIGRATIONS" ]; then | ||
| bundle exec rails db:migrate | ||
| else | ||
| echo "⚠️ Skipping migrations" |
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.
| echo "⚠️ Skipping migrations" | |
| echo "⚠️ Skipping migrations!" |


This PR closes #113 .
We are adding a script that enables the creation of a Decidim instance based on the docker images built in this repository. The user will be guided through some questions on how to properly configure the instance, and the script itself will take care of the necessary dependencies (such as the database, where the storage is going to be located, etc).
Some improvements:
This will generate extra-security on the download of the shell script and the files it uses, giving the final user more security.
What we still need
How to test
Using the released zip.
sudo curl -s https://raw.githubusercontent.com/decidim/docker/refs/heads/feat/decidim_install/install/install.sh | bashWhile developing we might not have access to the released zip, the way to test it is to zip ourselfs the script folder and push it to the server.
Later on, we need the deploy.zip to be under the
/tmp/decidim-docker-files/deploy.zip. It's a bit messy right now.Also, if you want to try it locally you can use
multipass