Skip to content
This repository has been archived by the owner on Apr 9, 2020. It is now read-only.

capistrano configs and shared-configs #58

Merged
merged 4 commits into from Jun 29, 2017
Merged

Conversation

dazza-codes
Copy link
Contributor

@dazza-codes dazza-codes commented Jun 27, 2017

Partial solution for #33 - it works and it's deployed on sul-sdr-services-dev.stanford.edu along with the current shared_configs for that system, which seems to be OK in rescue, see

e.g.

$ bundle exec cap dev deploy:check
...
00:00 git:wrapper
      01 mkdir -p /tmp
    ✔ 01 sdr2service@sul-sdr-services-dev.stanford.edu 1.213s
      Uploading /tmp/git-ssh-sdr-preservation-core-dev-dlweber.sh 100.0%
      02 chmod 700 /tmp/git-ssh-sdr-preservation-core-dev-dlweber.sh
    ✔ 02 sdr2service@sul-sdr-services-dev.stanford.edu 1.066s
Please enter branch (capistrano-shared-configs-33): 
00:05 git:check
      01 git ls-remote https://github.com/sul-dlss/sdr-preservation-core.git HEAD
      01 844d6f93a6f8185f51e4e1a2d79c4df7171050b3	HEAD
    ✔ 01 sdr2service@sul-sdr-services-dev.stanford.edu 1.868s
00:06 deploy:check:directories
      01 mkdir -p /var/sdr2service/sdr-preservation-core/shared /var/sdr2service/sdr-preservation-core/releases
    ✔ 01 sdr2service@sul-sdr-services-dev.stanford.edu 1.145s
00:08 deploy:check:linked_dirs
      01 mkdir -p /var/sdr2service/sdr-preservation-core/shared/.binstubs /var/sdr2service/sdr-preservation-core/shared/log /var/sdr2service/sdr-preservation-core/shared/run /var/sdr2service/sdr-…
    ✔ 01 sdr2service@sul-sdr-services-dev.stanford.edu 1.145s

@dazza-codes
Copy link
Contributor Author

dazza-codes commented Jun 27, 2017

Also works for both systems in stage, e.g.

bundle exec cap stage deploy:check
Pseudo-terminal will not be allocated because stdin is not a terminal.
Pseudo-terminal will not be allocated because stdin is not a terminal.
The authenticity of host 'sdr-services-test2.stanford.edu (172.20.207.30)' can't be established.
RSA key fingerprint is SHA256:crFySdqC1FoWiSWDLrobxSg0AkWwD/bxjQOlDiFS8L0.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'sdr-services-test2.stanford.edu,172.20.207.30' (RSA) to the list of known hosts.
rvm 1.25.28 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
rvm 1.26.3 (latest) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
ruby-2.1.2
ruby-2.1.2
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
00:00 git:wrapper
      01 mkdir -p /tmp
    ✔ 01 sdr2service@sdr-services-test.stanford.edu 1.067s
    ✔ 01 sdr2service@sdr-services-test2.stanford.edu 1.589s
      Uploading /tmp/git-ssh-sdr-preservation-core-stage-dlweber.sh 100.0%
      02 chmod 700 /tmp/git-ssh-sdr-preservation-core-stage-dlweber.sh
      Uploading /tmp/git-ssh-sdr-preservation-core-stage-dlweber.sh 100.0%
    ✔ 02 sdr2service@sdr-services-test.stanford.edu 0.986s
    ✔ 02 sdr2service@sdr-services-test2.stanford.edu 1.340s
Please enter branch (capistrano-shared-configs-33): 
00:06 git:check
      01 git ls-remote https://github.com/sul-dlss/sdr-preservation-core.git HEAD
      01 844d6f93a6f8185f51e4e1a2d79c4df7171050b3	HEAD
    ✔ 01 sdr2service@sdr-services-test.stanford.edu 1.445s
      01 844d6f93a6f8185f51e4e1a2d79c4df7171050b3	HEAD
    ✔ 01 sdr2service@sdr-services-test2.stanford.edu 2.356s
00:08 deploy:check:directories
      01 mkdir -p /var/sdr2service/sdr-preservation-core/shared /var/sdr2service/sdr-preservation-core/releases
    ✔ 01 sdr2service@sdr-services-test.stanford.edu 1.069s
    ✔ 01 sdr2service@sdr-services-test2.stanford.edu 1.470s
00:10 deploy:check:linked_dirs
      01 mkdir -p /var/sdr2service/sdr-preservation-core/shared/.binstubs /var/sdr2service/sdr-preservation-core/shared/log /var/sdr2service/sdr-preservation-core/shared/run /var/sdr2service/sdr-…
    ✔ 01 sdr2service@sdr-services-test.stanford.edu 1.088s
    ✔ 01 sdr2service@sdr-services-test2.stanford.edu 1.431s
Pseudo-terminal will not be allocated because stdin is not a terminal.
Pseudo-terminal will not be allocated because stdin is not a terminal.

@dazza-codes dazza-codes changed the title [WIP] capistrano configs and shared-configs capistrano configs and shared-configs Jun 27, 2017
@jcoyne jcoyne mentioned this pull request Jun 27, 2017
8 tasks
Copy link
Contributor

@jcoyne jcoyne left a comment

Choose a reason for hiding this comment

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

Looks good. I just don't understand how this is using .binstubs

config/deploy.rb Outdated
# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}

# Default value for linked_dirs is []
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
set :linked_dirs, %w(log run config/environments config/certs)
set :linked_dirs, %w(.binstubs log run config/environments config/certs)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is .binstubs a linked directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The bundle install creates this path as a utility and linking it here enables easy use of the command utils in there, http://bundler.io/v1.10/bundle_binstubs.html

Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we want to use binstubs on the server? What were we doing prior to this change? Is this something that needs to be part of this PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What's wrong with it? It's useful in ssh sessions on the box.

Copy link
Contributor

Choose a reason for hiding this comment

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

What's wrong with the default behavior?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lol, this question tennis is not getting us anywhere; what's the objection to using .binstubs? Is it a blocker on this PR? Are you asking me to remove it or this PR is blocked? What do you want?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think moving this to a different PR would be best. This isn't required to achieve the primary goal of the PR.

Copy link
Contributor

Choose a reason for hiding this comment

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

Furthermore, it's suggested that binstubs be checked in if you're going to use them: https://github.com/rbenv/rbenv/wiki/Understanding-binstubs#bundler-generated-binstubs

You are encouraged to check these binstubs in the project's version control so your colleagues might benefit from them.

If they're linked directories, that implies they aren't in version control.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll try to separate this out (and better check there are no cron or other things that depend on having access to this bin path).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The default is set :bundle_binstubs, -> { shared_path.join('bin') } and this project already has a bin directory, so hopefully we have no bin-file name conflicts (probably not).

@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.314% when pulling c850f27 on capistrano-shared-configs-33 into 844d6f9 on master.

@sul-dlss-deprecated sul-dlss-deprecated deleted a comment from coveralls Jun 29, 2017
@coveralls
Copy link

Coverage Status

Coverage remained the same at 70.314% when pulling df334a9 on capistrano-shared-configs-33 into 844d6f9 on master.

@jcoyne jcoyne merged commit b37c7dd into master Jun 29, 2017
@dazza-codes dazza-codes deleted the capistrano-shared-configs-33 branch June 30, 2017 21:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants