Skip to content

Added ability for custom startup script#55

Merged
lmakarov merged 8 commits into
developfrom
feature/custom_startup
Jun 28, 2018
Merged

Added ability for custom startup script#55
lmakarov merged 8 commits into
developfrom
feature/custom_startup

Conversation

@sean-e-dietrich

Copy link
Copy Markdown
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

@lmakarov lmakarov left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Member

Yea, we need to execute the script before supervisord.

Comment thread 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 No newline at end of file

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

duplication

Comment thread tests/test.bats Outdated
run fin exec -T 'cat /tmp/test-startup.txt'
[[ ${status} == 0 ]] &&
[[ "${output}" == "I ran properly" ]]
} No newline at end of file

@achekulaev achekulaev Jun 12, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please add newline

Comment thread 7.2/startup.sh Outdated
# $@ does not work here. $* has to be used.
exec gosu docker bash -c "$DOCKSALRC; exec $*"
fi
fi No newline at end of file

Copy link
Copy Markdown
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
Copy Markdown
Member

Looks good to me
cc @lmakarov

@sean-e-dietrich

Copy link
Copy Markdown
Member Author

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

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

Copy link
Copy Markdown
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