Skip to content

WIP: Add up and down command/scripts and make portainer optional#5

Closed
chregu wants to merge 7 commits into
certificate-generation-improvementsfrom
up-and-down-command
Closed

WIP: Add up and down command/scripts and make portainer optional#5
chregu wants to merge 7 commits into
certificate-generation-improvementsfrom
up-and-down-command

Conversation

@chregu

@chregu chregu commented Aug 14, 2019

Copy link
Copy Markdown
Member

Needs #1 first merged, therefore WIP for now

  • add scripts/pontsun up and scripts/pontsun down
  • makes portainer startup optional via .env
  • Manual docker-compose up still works

@chregu chregu changed the title Add up and down command/scripts and make portainer optional WIP: Add up and down command/scripts and make portainer optional Aug 14, 2019
@chregu chregu force-pushed the up-and-down-command branch from e8c46fc to cd309d8 Compare August 15, 2019 07:26
@chregu chregu force-pushed the up-and-down-command branch from cd309d8 to 9f90f79 Compare August 19, 2019 07:52
@Aerzas

Aerzas commented Aug 19, 2019

Copy link
Copy Markdown
Contributor

I'm not sure if we should abstract docker-compose which is already an abstraction of docker. Templates and commands are quite straightforward.

Portainer is already marked as restart: unless-stopped which would prevent it from starting if stopped.

@chregu chregu force-pushed the certificate-generation-improvements branch from d16f9d5 to e9fefaa Compare August 19, 2019 08:35
@chregu

chregu commented Aug 19, 2019

Copy link
Copy Markdown
Member Author

Yeah, for portainer maybe not. But there's more services in future to be added. A dnsmasq service eg. is not needed on all setups and also the ssh-agent service may only be needed on OS X (and maybe windows). So I'd like to have a better scriptable "up" command.

But sure, the portainer thing is quite optional. And I'd also like to keep this "up" command optional, more of a helper for getting pontsun getting started faster for non-experts with some checks (like the .env check)

And as long as "docker-compose up" still works, I don't see how such a script hurts.

@chregu chregu force-pushed the up-and-down-command branch from 9f90f79 to e5baf6f Compare August 19, 2019 08:50
Comment thread scripts/up.sh Outdated
docker-compose up -d $SERVICES

if ! ping -c 1 -t 2 traefik.$PROJECT_DOMAIN > /dev/null 2>&1 ; then
echo "!!!! traefik.$PROJECT_DOMAIN could not be resolved. You should fix this !!!!"

@OdyX OdyX Aug 19, 2019

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.

[NITPICK] Please use >&2 at the line start, to output to stderr, not stdout.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Sure, changed.

@chregu

chregu commented Aug 19, 2019

Copy link
Copy Markdown
Member Author

Also that I can do

$PATH_TO_PONTSUN/scripts/pontsun up

from any place and not need to do

cd $PATH_TO_PONTSUN/containers && docker-compose up -d
cd $BACK_TO_WHERE_I_WAS

which is much easier to remember, type, use-in-other-scripts

# Conflicts:
#	containers/.env.example
@chregu chregu force-pushed the up-and-down-command branch from e5baf6f to fd8b7da Compare August 19, 2019 08:58
@Aerzas

Aerzas commented Aug 20, 2019

Copy link
Copy Markdown
Contributor

I mean we could achieve the same results with multiple docker-compose.yml files like docker-compose -f docker-compose.yml -f docker-compose.dnsmasq.yml up -d so options are explicit and yet we don't create an abstraction layer.

My opinion is that we should ease the setup of local dev environment without replacing docker or docker-compose or maybe in a separated project.

Moreover, we'll probably execute this command once or twice to mount it once and it will remount at every startup automatically.

@chregu

chregu commented Aug 20, 2019

Copy link
Copy Markdown
Member Author

Ah, didn't know you can have more than one -f, good then.

We seem not to agree, what this project should include and what not. So let's create a pontsun-cli project and move what my vision of this "cli" is there and leave this here pure.

@chregu chregu force-pushed the certificate-generation-improvements branch 2 times, most recently from 02ddea4 to cac4c2b Compare August 20, 2019 09:47
@chregu

chregu commented Aug 20, 2019

Copy link
Copy Markdown
Member Author

Obsolete. That stuff will go into a new project.

@chregu chregu closed this Aug 20, 2019
@chregu chregu deleted the up-and-down-command branch August 22, 2019 07:16
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