Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
nodejs/opentelemetry-instrumentation-bullmq
.DS_Store
appsignal_key.env
.appsignal_environment
appsignal_key_*.env
.env
yarn-error.log
node_modules
Expand Down
30 changes: 30 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,29 @@ def render_erb(file)
ERB.new(File.read(file)).result
end

namespace :env do
desc "Send data to local devenv"
task :local do
FileUtils.cp "./appsignal_key_local.env", "./appsignal_key.env"
File.write ".appsignal_environment", "local"
end
task :dev => :local
task :development => :local

desc "Send data to staging"
task :prod do
FileUtils.cp "./appsignal_key_prod.env", "./appsignal_key.env"
File.write ".appsignal_environment", "production"
end
task :production => :prod

desc "Send data to production"
task :staging do
FileUtils.cp "./appsignal_key_staging.env", "./appsignal_key.env"
File.write ".appsignal_environment", "staging"
end
end

namespace :app do
desc "Open the browser pointing to the app"
task :open do
Expand Down Expand Up @@ -138,6 +161,13 @@ namespace :app do
@app = get_app
puts "Starting #{@app}"

if File.exist?(".appsignal_environment")
env = File.read(".appsignal_environment").strip.upcase
puts "=" * 50
puts "ENVIRONMENT: #{env}"
puts "=" * 50
end

puts "Copying processmon"
FileUtils.rm_f "#{@app}/commands/processmon"
FileUtils.cp "support/processmon/processmon", "#{@app}/commands/"
Expand Down
Loading