Skip to content

Commit

Permalink
Merge pull request apache#45 from Shopify/use_fetch_sha
Browse files Browse the repository at this point in the history
Use fetch sha
  • Loading branch information
orenmazor committed Feb 4, 2015
2 parents 6ff2c8e + e19dff1 commit fae6581
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Capfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ namespace :deploy do
end

task :upload_to_hdfs, :roles => :uploader, :on_no_matching_servers => :continue do
target_sha = ENV['SHA'] || fetch(:sha, `git rev-parse HEAD`.gsub(/\s/,""))
run "hdfs dfs -copyFromLocal -f /u/apps/spark/current/lib/spark-assembly-*.jar hdfs://nn01.chi.shopify.com/user/sparkles/spark-assembly-#{target_sha}.jar"
run "hdfs dfs -copyFromLocal -f /u/apps/spark/current/lib/spark-assembly-*.jar hdfs://nn01.chi.shopify.com/user/sparkles/spark-assembly-#{fetch(:sha)}.jar"
end

task :test_spark_jar, :roles => :uploader, :on_no_master_servers => :continue do
target_sha = ENV['SHA'] || fetch(:sha, `git rev-parse HEAD`.gsub(/\s/,""))
run "sudo -u azkaban sh -c '. /u/virtualenvs/starscream/bin/activate && cd /u/apps/starscream/current && PYTHON_ENV=production SPARK_OPTS=\"spark.yarn.jar=hdfs://nn01.chi.shopify.com:8020/user/sparkles/spark-assembly-#{target_sha}.jar\" exec python shopify/tools/canary.py'"
run "sudo -u azkaban sh -c '. /u/virtualenvs/starscream/bin/activate && cd /u/apps/starscream/current && PYTHON_ENV=production SPARK_OPTS=\"spark.yarn.jar=hdfs://nn01.chi.shopify.com:8020/user/sparkles/spark-assembly-#{fetch(:sha)}.jar\" exec python shopify/tools/canary.py'"
end

task :prevent_gateway do
Expand Down Expand Up @@ -79,6 +77,8 @@ namespace :deploy do

after 'deploy:initialize_variables', 'deploy:prevent_gateway' # capistrano recipes packserv deploy always uses a gateway
before 'deploy:symlink_current', 'deploy:symlink_shared'
before 'deploy:test_spark_jar', 'deploy:initialize_variables'
before 'deploy:upload_to_hdfs', 'deploy:initialize_variables'
after 'deploy:download', 'deploy:upload_to_hdfs', 'deploy:test_spark_jar'
after 'deploy:restart', 'deploy:cleanup'
after 'deploy:cleanup', 'deploy:remind_us_to_update_starscream'
Expand Down

0 comments on commit fae6581

Please sign in to comment.