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

Added ability for custom startup script #55

Merged
merged 8 commits into from
Jun 28, 2018
Merged

Conversation

sean-e-dietrich
Copy link
Member

Added ability for user to add a custom startup script within the ${PROJECT_ROOT}/.docksal/services/cli/startup.sh. This is checked within the startup.sh file for the independent docker containers.

README.md has also been updated to include the following changes.

Solves #24

Copy link
Member

@lmakarov lmakarov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please write necessary test cases. This use case is not that easy to solve.

I don't think anything below the exec statements will get executed. As such, extra provisioning can only happen before supervisord loads and starts other services. Post start provisioning can then only happen via fin exec outside of cli. Unless there is some delayed service or cron job that gets triggered once the container enters a healthy state (see healthcheck.sh).

@achekulaev
Copy link
Member

Yea, we need to execute the script before supervisord.

5.6/startup.sh Outdated
echo-debug "Running Custom Startup Script..."
${PROJECT_ROOT}/.docksal/services/cli/startup.sh
echo-debug "Custom Startup Script Complete..."
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

duplication

tests/test.bats Outdated
run fin exec -T 'cat /tmp/test-startup.txt'
[[ ${status} == 0 ]] &&
[[ "${output}" == "I ran properly" ]]
}
Copy link
Member

@achekulaev achekulaev Jun 12, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add newline

7.2/startup.sh Outdated
@@ -89,4 +95,4 @@ else
# Launch the passed command in an non-interactive bash session under docker user
# $@ does not work here. $* has to be used.
exec gosu docker bash -c "$DOCKSALRC; exec $*"
fi
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add newline

@achekulaev
Copy link
Member

Looks good to me
cc @lmakarov

@sean-e-dietrich
Copy link
Member Author

@lmakarov please re-review when you have a moment.

@lmakarov lmakarov merged commit 284b208 into develop Jun 28, 2018
@lmakarov
Copy link
Member

Merged. Thanks @sean-e-dietrich

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.

3 participants