Skip to content

Commit

Permalink
[POC] Setup Rake task
Browse files Browse the repository at this point in the history
Because I am tired of doing `bash -l`... for cross repo tests...

Edit:   Well... apparently it is required for anything `nvm` related...
Edit 2: `nvm` seems to install then use, so just makes sense to have
        this as one step.
Edit 3: `nvm` is a function, so have to source it first... ugh
Edit 4: Set PATH for node.  Add spec:cypress:ci exec task (sets path)
Edit 5: Debugging...
Edit 6: Forgot to add `../bin`... derp
  • Loading branch information
NickLaMuro committed Jul 31, 2020
1 parent 57f5e31 commit edbff5c
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ namespace :spec do
desc "Run all cypress specs"
task :cypress => ["app:cypress:ui:run"]

namespace :cypress do
task :ci => ["ci:set_node_path", "spec:cypress"]

task "ci:install_yarn" do
sh "/bin/bash", "-c", "source ~/.nvm/nvm.sh && nvm install 12 && npm install -g yarn"
end

task "ci:set_node_path" do
ENV["PATH"] = "#{Dir.glob("/home/travis/.nvm/versions/node/v12*").sort.last}/bin:#{ENV["PATH"]}"
puts;puts;puts
puts ">>>>>> PATH: #{ENV["PATH"]}"
puts;puts;puts
end

desc "Setup for CI"
task "ci:setup" => ["ci:install_yarn", "ci:set_node_path", "update:ui", "app:cypress:ui:seed"]
end

desc "Try to compile assets"
task :compile => ["app:assets:precompile"]

Expand Down

0 comments on commit edbff5c

Please sign in to comment.