From 2bdd3718df45490cdb5cc514063d1dcc3d5b75e2 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Thu, 19 Sep 2019 07:28:58 +0200 Subject: [PATCH 01/12] Fix Vagrant build environment (closes #114) --- README.md | 2 +- vagrant/.gitignore | 3 --- vagrant/ansible.hosts | 2 -- vagrant/peru.yaml | 14 -------------- vagrant/up.bash | 43 +++++++++---------------------------------- vagrant/up.guidance | 2 +- vagrant/up.playbooks | 1 - 7 files changed, 11 insertions(+), 56 deletions(-) delete mode 100644 vagrant/.gitignore delete mode 100644 vagrant/ansible.hosts delete mode 100644 vagrant/peru.yaml delete mode 100644 vagrant/up.playbooks diff --git a/README.md b/README.md index 78129a8..6d71f7c 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ Factotum is written in **[Rust](https://www.rust-lang.org/)**. * Set up a Vagrant box and ssh into it - `vagrant up && vagrant ssh` * This will take a few minutes * `cd /vagrant` -* Compile and run a demo - `cargo run -- samples/echo.factfile` +* Compile and run a demo - `cargo run -- run samples/echo.factfile` ### Using stable Rust without Vagrant diff --git a/vagrant/.gitignore b/vagrant/.gitignore deleted file mode 100644 index 1b4b29f..0000000 --- a/vagrant/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -.peru -oss-playbooks -ansible diff --git a/vagrant/ansible.hosts b/vagrant/ansible.hosts deleted file mode 100644 index 588fa08..0000000 --- a/vagrant/ansible.hosts +++ /dev/null @@ -1,2 +0,0 @@ -[vagrant] -127.0.0.1:2222 diff --git a/vagrant/peru.yaml b/vagrant/peru.yaml deleted file mode 100644 index e7fdf41..0000000 --- a/vagrant/peru.yaml +++ /dev/null @@ -1,14 +0,0 @@ -imports: - ansible: ansible - ansible_playbooks: oss-playbooks - -curl module ansible: - # Equivalent of git cloning tags/v1.6.6 but much, much faster - url: https://codeload.github.com/ansible/ansible/zip/69d85c22c7475ccf8169b6ec9dee3ee28c92a314 - unpack: zip - export: ansible-69d85c22c7475ccf8169b6ec9dee3ee28c92a314 - -git module ansible_playbooks: - url: https://github.com/snowplow/ansible-playbooks.git - # Comment out to fetch a specific rev instead of master: - # rev: xxx diff --git a/vagrant/up.bash b/vagrant/up.bash index 7450ae8..bef8fbe 100755 --- a/vagrant/up.bash +++ b/vagrant/up.bash @@ -1,44 +1,19 @@ #!/bin/bash set -e -vagrant_dir=/vagrant/vagrant bashrc=/home/vagrant/.bashrc -echo "========================================" -echo "INSTALLING PERU AND ANSIBLE DEPENDENCIES" -echo "----------------------------------------" +echo "=======================" +echo "INSTALLING DEPENDENCIES" +echo "-----------------------" apt-get update -apt-get install -y language-pack-en git unzip libyaml-dev python3-pip python-yaml python-paramiko python-jinja2 +apt-get install -y language-pack-en git unzip libyaml-dev python3-pip python-pip python-yaml python-paramiko python-jinja2 libssl-dev -echo "===============" -echo "INSTALLING PERU" -echo "---------------" -sudo pip3 install peru - -echo "=======================================" -echo "CLONING ANSIBLE AND PLAYBOOKS WITH PERU" -echo "---------------------------------------" -cd ${vagrant_dir} && peru sync -v -echo "... done" - -env_setup=${vagrant_dir}/ansible/hacking/env-setup -hosts=${vagrant_dir}/ansible.hosts - -echo "===================" -echo "CONFIGURING ANSIBLE" -echo "-------------------" -touch ${bashrc} -echo "source ${env_setup}" >> ${bashrc} -echo "export ANSIBLE_HOSTS=${hosts}" >> ${bashrc} -echo "... done" - -echo "==========================================" -echo "RUNNING PLAYBOOKS WITH ANSIBLE*" -echo "* no output while each playbook is running" -echo "------------------------------------------" -while read pb; do - su - -c "source ${env_setup} && ${vagrant_dir}/ansible/bin/ansible-playbook ${vagrant_dir}/${pb} --connection=local --inventory-file=${hosts}" vagrant -done <${vagrant_dir}/up.playbooks +echo "=======================" +echo "INSTALLING RUST & CARGO" +echo "-----------------------" +# curl https://sh.rustup.rs -sSf | sh -s -- -y +echo 'curl https://sh.rustup.rs -sSf | sh -s -- -y;' | su vagrant guidance=${vagrant_dir}/up.guidance diff --git a/vagrant/up.guidance b/vagrant/up.guidance index 6b567a5..b66ed4f 100644 --- a/vagrant/up.guidance +++ b/vagrant/up.guidance @@ -1,4 +1,4 @@ To get started: vagrant ssh cd /vagrant -cargo run +cargo run -- run samples/echo.factfile diff --git a/vagrant/up.playbooks b/vagrant/up.playbooks deleted file mode 100644 index a1e446b..0000000 --- a/vagrant/up.playbooks +++ /dev/null @@ -1 +0,0 @@ -oss-playbooks/rust.yml From 29ab238536ed254cb745ac316460d109bc1c0007 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Thu, 19 Sep 2019 07:55:22 +0200 Subject: [PATCH 02/12] Add ability to template the name of a step in a Factotum DAG (closes #113) --- samples/echo-with-dynamic-name.factfile | 41 +++++++++++++++++++++++++ src/factotum/parser/mod.rs | 32 ++++++++++++++----- 2 files changed, 66 insertions(+), 7 deletions(-) create mode 100644 samples/echo-with-dynamic-name.factfile diff --git a/samples/echo-with-dynamic-name.factfile b/samples/echo-with-dynamic-name.factfile new file mode 100644 index 0000000..20ab395 --- /dev/null +++ b/samples/echo-with-dynamic-name.factfile @@ -0,0 +1,41 @@ +{ + "schema": "iglu:com.snowplowanalytics.factotum/factfile/jsonschema/1-0-0", + "data": { + "name": "echo order demo", + "tasks": [ + { + "name": "echo alpha {{ env }}", + "executor": "shell", + "command": "echo", + "arguments": [ "alpha" ], + "dependsOn": [], + "onResult": { + "terminateJobWithSuccess": [ 3 ], + "continueJob": [ 0 ] + } + }, + { + "name": "echo beta", + "executor": "shell", + "command": "echo", + "arguments": [ "beta" ], + "dependsOn": [ "echo alpha {{ env }}" ], + "onResult": { + "terminateJobWithSuccess": [ 3 ], + "continueJob": [ 0 ] + } + }, + { + "name": "echo omega", + "executor": "shell", + "command": "echo", + "arguments": [ "and omega!" ], + "dependsOn": [ "echo beta" ], + "onResult": { + "terminateJobWithSuccess": [ 3 ], + "continueJob": [ 0 ] + } + } + ] + } +} diff --git a/src/factotum/parser/mod.rs b/src/factotum/parser/mod.rs index 8fd3e6a..94e1cba 100644 --- a/src/factotum/parser/mod.rs +++ b/src/factotum/parser/mod.rs @@ -136,27 +136,34 @@ fn parse_valid_json(file: &str, let mut ff = factfile::Factfile::new(compact_json, decoded_json.name.clone()); for file_task in decoded_json.tasks.iter() { + let final_name = if let Some(ref subs) = conf { + try!(templater::decorate_str(&file_task.name, &subs)) + } else { + file_task.name.clone() + }.to_string(); + // TODO errs in here - ? add task should Result not panic! - info!("adding task '{}'", file_task.name); + info!("adding task '{}'", final_name); if file_task.onResult.continueJob.len() == 0 { return Err(format!("the task '{}' has no way to continue successfully.", - file_task.name)); + final_name)); } else { for cont in file_task.onResult.continueJob.iter() { if file_task.onResult .terminateJobWithSuccess .iter() .any(|conflict| conflict == cont) { - return Err(format!("the task '{}' has conflicting actions.", file_task.name)); + return Err(format!("the task '{}' has conflicting actions.", final_name)); } } } let mut decorated_args = vec![]; + let mut decorated_deps = vec![]; if let Some(ref subs) = conf { info!("applying variables command and args of '{}'", - &file_task.name); + &final_name); info!("before:\n\tcommand: '{}'\n\targs: '{}'", file_task.command, @@ -171,14 +178,25 @@ fn parse_valid_json(file: &str, info!("after:\n\tcommand: '{}'\n\targs: '{}'", decorated_command, decorated_args.join(" ")); + + for dep in file_task.dependsOn.iter() { + decorated_deps.push(try!(templater::decorate_str(dep, &subs))) + } + + info!("after:\n\tcommand: '{}'\n\tdeps: '{}'", + decorated_command, + decorated_deps.join(" ")); } else { - info!("No config specified, writing args as undecorated strings"); + info!("No config specified, writing args & deps as undecorated strings"); for arg in file_task.arguments.iter() { decorated_args.push(arg.to_string()); } + for dep in file_task.dependsOn.iter() { + decorated_deps.push(dep.to_string()); + } } - let deps: Vec<&str> = file_task.dependsOn.iter().map(AsRef::as_ref).collect(); + let deps: Vec<&str> = decorated_deps.iter().map(AsRef::as_ref).collect(); let args: Vec<&str> = decorated_args.iter().map(AsRef::as_ref).collect(); let (terminate_mappings, continue_mappings) = match overrides { @@ -190,7 +208,7 @@ fn parse_valid_json(file: &str, } }; - ff.add_task(&file_task.name, + ff.add_task(&final_name, &deps, &file_task.executor, &file_task.command, From 94501ce8d60405a19d540ff49514ea5ada959d07 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Thu, 19 Sep 2019 07:59:35 +0200 Subject: [PATCH 03/12] Update Copyright years to 2016-2019 (closes #115) --- README.md | 2 +- src/factotum/executor/execution_strategy/mod.rs | 2 +- src/factotum/executor/execution_strategy/tests.rs | 2 +- src/factotum/executor/mod.rs | 2 +- src/factotum/executor/task_list/mod.rs | 2 +- src/factotum/executor/task_list/tests.rs | 2 +- src/factotum/executor/tests.rs | 2 +- src/factotum/factfile/dot/mod.rs | 2 +- src/factotum/factfile/dot/tests.rs | 2 +- src/factotum/factfile/mod.rs | 2 +- src/factotum/factfile/tests.rs | 2 +- src/factotum/mod.rs | 2 +- src/factotum/parser/mod.rs | 2 +- src/factotum/parser/schemavalidator/mod.rs | 2 +- src/factotum/parser/schemavalidator/tests.rs | 2 +- src/factotum/parser/templater/mod.rs | 2 +- src/factotum/parser/templater/tests.rs | 2 +- src/factotum/parser/tests.rs | 2 +- src/factotum/sequencer/mod.rs | 2 +- src/factotum/sequencer/tests.rs | 2 +- src/factotum/tests.rs | 2 +- src/factotum/webhook/jobcontext/mod.rs | 2 +- src/factotum/webhook/jobcontext/tests.rs | 2 +- src/factotum/webhook/jobupdate/mod.rs | 2 +- src/factotum/webhook/jobupdate/tests.rs | 2 +- src/factotum/webhook/mod.rs | 2 +- src/factotum/webhook/tests.rs | 2 +- src/main.rs | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 6d71f7c..6c7b016 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ Factotum is written in **[Rust](https://www.rust-lang.org/)**. ## Copyright and license -Factotum is copyright 2016-2018 Snowplow Analytics Ltd. +Factotum is copyright 2016-2019 Snowplow Analytics Ltd. Licensed under the **[Apache License, Version 2.0][license]** (the "License"); you may not use this software except in compliance with the License. diff --git a/src/factotum/executor/execution_strategy/mod.rs b/src/factotum/executor/execution_strategy/mod.rs index 2f73417..c6a681d 100644 --- a/src/factotum/executor/execution_strategy/mod.rs +++ b/src/factotum/executor/execution_strategy/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/execution_strategy/tests.rs b/src/factotum/executor/execution_strategy/tests.rs index e83efa5..0f233da 100644 --- a/src/factotum/executor/execution_strategy/tests.rs +++ b/src/factotum/executor/execution_strategy/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/mod.rs b/src/factotum/executor/mod.rs index 47b9f21..79af2de 100644 --- a/src/factotum/executor/mod.rs +++ b/src/factotum/executor/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/task_list/mod.rs b/src/factotum/executor/task_list/mod.rs index 32d4969..3eadb4f 100644 --- a/src/factotum/executor/task_list/mod.rs +++ b/src/factotum/executor/task_list/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/task_list/tests.rs b/src/factotum/executor/task_list/tests.rs index a420501..ad05337 100644 --- a/src/factotum/executor/task_list/tests.rs +++ b/src/factotum/executor/task_list/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/tests.rs b/src/factotum/executor/tests.rs index a665b4c..a3aaa72 100644 --- a/src/factotum/executor/tests.rs +++ b/src/factotum/executor/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/factfile/dot/mod.rs b/src/factotum/factfile/dot/mod.rs index 8cd2d32..1918c49 100644 --- a/src/factotum/factfile/dot/mod.rs +++ b/src/factotum/factfile/dot/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/factfile/dot/tests.rs b/src/factotum/factfile/dot/tests.rs index a52c85d..331495c 100644 --- a/src/factotum/factfile/dot/tests.rs +++ b/src/factotum/factfile/dot/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/factfile/mod.rs b/src/factotum/factfile/mod.rs index 001281e..88806a1 100644 --- a/src/factotum/factfile/mod.rs +++ b/src/factotum/factfile/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/factfile/tests.rs b/src/factotum/factfile/tests.rs index eb55e7c..2bdebe0 100644 --- a/src/factotum/factfile/tests.rs +++ b/src/factotum/factfile/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/mod.rs b/src/factotum/mod.rs index f02f9b4..c4e590b 100644 --- a/src/factotum/mod.rs +++ b/src/factotum/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/mod.rs b/src/factotum/parser/mod.rs index 94e1cba..3a3ced2 100644 --- a/src/factotum/parser/mod.rs +++ b/src/factotum/parser/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/schemavalidator/mod.rs b/src/factotum/parser/schemavalidator/mod.rs index 8269cf0..b045281 100644 --- a/src/factotum/parser/schemavalidator/mod.rs +++ b/src/factotum/parser/schemavalidator/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/schemavalidator/tests.rs b/src/factotum/parser/schemavalidator/tests.rs index 03b548c..b35f49b 100644 --- a/src/factotum/parser/schemavalidator/tests.rs +++ b/src/factotum/parser/schemavalidator/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/templater/mod.rs b/src/factotum/parser/templater/mod.rs index ee04306..41adf62 100644 --- a/src/factotum/parser/templater/mod.rs +++ b/src/factotum/parser/templater/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/templater/tests.rs b/src/factotum/parser/templater/tests.rs index fc6614a..7f6e296 100644 --- a/src/factotum/parser/templater/tests.rs +++ b/src/factotum/parser/templater/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/tests.rs b/src/factotum/parser/tests.rs index 78855c8..6d1fb8d 100644 --- a/src/factotum/parser/tests.rs +++ b/src/factotum/parser/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/sequencer/mod.rs b/src/factotum/sequencer/mod.rs index c3125b6..2194953 100644 --- a/src/factotum/sequencer/mod.rs +++ b/src/factotum/sequencer/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/sequencer/tests.rs b/src/factotum/sequencer/tests.rs index 3bb4270..ff4a9ff 100644 --- a/src/factotum/sequencer/tests.rs +++ b/src/factotum/sequencer/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/tests.rs b/src/factotum/tests.rs index fd7309c..932ef60 100644 --- a/src/factotum/tests.rs +++ b/src/factotum/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/jobcontext/mod.rs b/src/factotum/webhook/jobcontext/mod.rs index 57ed0eb..0d740fc 100644 --- a/src/factotum/webhook/jobcontext/mod.rs +++ b/src/factotum/webhook/jobcontext/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/jobcontext/tests.rs b/src/factotum/webhook/jobcontext/tests.rs index 49302e2..4919816 100644 --- a/src/factotum/webhook/jobcontext/tests.rs +++ b/src/factotum/webhook/jobcontext/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/jobupdate/mod.rs b/src/factotum/webhook/jobupdate/mod.rs index eeeee5b..36ba445 100644 --- a/src/factotum/webhook/jobupdate/mod.rs +++ b/src/factotum/webhook/jobupdate/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/jobupdate/tests.rs b/src/factotum/webhook/jobupdate/tests.rs index d1f80e9..ff08abf 100644 --- a/src/factotum/webhook/jobupdate/tests.rs +++ b/src/factotum/webhook/jobupdate/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/mod.rs b/src/factotum/webhook/mod.rs index 95872e7..8386121 100644 --- a/src/factotum/webhook/mod.rs +++ b/src/factotum/webhook/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/tests.rs b/src/factotum/webhook/tests.rs index b9cc1e7..f8565d0 100644 --- a/src/factotum/webhook/tests.rs +++ b/src/factotum/webhook/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/main.rs b/src/main.rs index bca6904..d49f3d1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2018 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License From edf153e1737d5b14e507e43b8d1e0654b877a8db Mon Sep 17 00:00:00 2001 From: jbeemster Date: Thu, 19 Sep 2019 09:54:56 +0200 Subject: [PATCH 04/12] Add ability to template the name of a Factotum DAG (closes #117) --- samples/echo-with-dynamic-name.factfile | 2 +- src/factotum/parser/mod.rs | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/samples/echo-with-dynamic-name.factfile b/samples/echo-with-dynamic-name.factfile index 20ab395..f654360 100644 --- a/samples/echo-with-dynamic-name.factfile +++ b/samples/echo-with-dynamic-name.factfile @@ -1,7 +1,7 @@ { "schema": "iglu:com.snowplowanalytics.factotum/factfile/jsonschema/1-0-0", "data": { - "name": "echo order demo", + "name": "echo order demo {{ env }}", "tasks": [ { "name": "echo alpha {{ env }}", diff --git a/src/factotum/parser/mod.rs b/src/factotum/parser/mod.rs index 3a3ced2..5900c01 100644 --- a/src/factotum/parser/mod.rs +++ b/src/factotum/parser/mod.rs @@ -133,7 +133,14 @@ fn parse_valid_json(file: &str, let schema: SelfDescribingJson = try!(json::decode(file).map_err(|e| e.to_string())); let compact_json:String = try!(json::encode(&schema).map_err(|e| e.to_string())); let decoded_json = schema.data; - let mut ff = factfile::Factfile::new(compact_json, decoded_json.name.clone()); + + let final_dag_name = if let Some(ref subs) = conf { + try!(templater::decorate_str(&decoded_json.name, &subs)) + } else { + decoded_json.name.clone() + }.to_string(); + + let mut ff = factfile::Factfile::new(compact_json, final_dag_name); for file_task in decoded_json.tasks.iter() { let final_name = if let Some(ref subs) = conf { From bec9d91859ae6bb73d059cf9ea3e03e64fc52fd8 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Fri, 20 Sep 2019 09:34:33 +0200 Subject: [PATCH 05/12] Ensure raw factfile is templated to allow webhooks to work (closes #118) --- samples/echo-with-dynamic-name.factfile | 2 +- src/factotum/parser/mod.rs | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/samples/echo-with-dynamic-name.factfile b/samples/echo-with-dynamic-name.factfile index f654360..ae20ca9 100644 --- a/samples/echo-with-dynamic-name.factfile +++ b/samples/echo-with-dynamic-name.factfile @@ -7,7 +7,7 @@ "name": "echo alpha {{ env }}", "executor": "shell", "command": "echo", - "arguments": [ "alpha" ], + "arguments": [ "alpha {{ env }}" ], "dependsOn": [], "onResult": { "terminateJobWithSuccess": [ 3 ], diff --git a/src/factotum/parser/mod.rs b/src/factotum/parser/mod.rs index 5900c01..021c95b 100644 --- a/src/factotum/parser/mod.rs +++ b/src/factotum/parser/mod.rs @@ -134,13 +134,19 @@ fn parse_valid_json(file: &str, let compact_json:String = try!(json::encode(&schema).map_err(|e| e.to_string())); let decoded_json = schema.data; + let final_compact_json:String = if let Some(ref subs) = conf { + try!(templater::decorate_str(&compact_json, &subs)) + } else { + compact_json.clone() + }.to_string(); + let final_dag_name = if let Some(ref subs) = conf { try!(templater::decorate_str(&decoded_json.name, &subs)) } else { decoded_json.name.clone() }.to_string(); - let mut ff = factfile::Factfile::new(compact_json, final_dag_name); + let mut ff = factfile::Factfile::new(final_compact_json, final_dag_name); for file_task in decoded_json.tasks.iter() { let final_name = if let Some(ref subs) = conf { From c23f0719807e56921c0d018be397620f9f3bfff4 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Thu, 26 Dec 2019 07:14:59 +0100 Subject: [PATCH 06/12] Fix failing tests on Rust 1.40.0 (closes #120) --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index d49f3d1..83439f7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -899,7 +899,7 @@ fn validate_ok_factfile_bad() { Ok(_) => panic!("Validation returning valid for invalid file"), Err(msg) => { let expected = format!("'{}' is not a valid", test_file_path); - assert_eq!(expected, msg[5..expected.len() + 5]) // ignore red colour code + assert!(msg.contains(&expected)) } } } From 7099ee90c8af67c2e3d1fe4f34b2112df2b89f53 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Thu, 26 Dec 2019 08:20:43 +0100 Subject: [PATCH 07/12] Bump hyper to 0.10.+ to support OpenSSL 1.1 (closes #119) --- Cargo.toml | 3 ++- src/factotum/webhook/mod.rs | 6 +++++- src/main.rs | 1 + vagrant/up.bash | 2 +- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 7df474b..a0d6585 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,8 @@ mustache = "0.7.0" rand = "0.3" rust-crypto = "^0.2" uuid = { version = "0.2", features = ["v4"] } -hyper = "0.9" +hyper = "^0.10" +hyper-native-tls = "0.3.0" libc = "0.2.17" ifaces = "0.0.3" dns-lookup = "0.2.1" diff --git a/src/factotum/webhook/mod.rs b/src/factotum/webhook/mod.rs index 8386121..96818f6 100644 --- a/src/factotum/webhook/mod.rs +++ b/src/factotum/webhook/mod.rs @@ -91,11 +91,15 @@ pub struct Webhook { impl Webhook { pub fn http_post(url: &str, data: &str) -> Result { use hyper::Client; + use hyper::net::HttpsConnector; + use hyper_native_tls::NativeTlsClient; use hyper::header::{Headers, ContentType}; use hyper::mime::{Mime, TopLevel, SubLevel, Attr, Value}; use hyper::status; - let client = Client::new(); + let ssl = NativeTlsClient::new().unwrap(); + let connector = HttpsConnector::new(ssl); + let client = Client::with_connector(connector); let mut headers = Headers::new(); headers.set(ContentType(Mime(TopLevel::Application, SubLevel::Json, diff --git a/src/main.rs b/src/main.rs index 83439f7..ecf8b87 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,7 @@ extern crate rand; extern crate crypto; extern crate uuid; extern crate hyper; +extern crate hyper_native_tls; extern crate libc; extern crate ifaces; extern crate dns_lookup; diff --git a/vagrant/up.bash b/vagrant/up.bash index bef8fbe..a3863fb 100755 --- a/vagrant/up.bash +++ b/vagrant/up.bash @@ -7,7 +7,7 @@ echo "=======================" echo "INSTALLING DEPENDENCIES" echo "-----------------------" apt-get update -apt-get install -y language-pack-en git unzip libyaml-dev python3-pip python-pip python-yaml python-paramiko python-jinja2 libssl-dev +apt-get install -y language-pack-en git unzip libyaml-dev python3-pip python-pip python-yaml python-paramiko python-jinja2 libssl-dev pkg-config echo "=======================" echo "INSTALLING RUST & CARGO" From 095f3bee3543c89d07271b6022708f202c40f8d5 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Fri, 16 Oct 2020 16:37:06 +0200 Subject: [PATCH 08/12] Append tags to the environment so as to make them available to sub-processes (closes #121) --- .../echo-with-dynamic-name-from-tag.factfile | 41 +++++++++ src/factotum/parser/mod.rs | 22 +---- src/factotum/parser/tests.rs | 22 ----- src/main.rs | 89 +++++++++++++++++-- 4 files changed, 125 insertions(+), 49 deletions(-) create mode 100644 samples/echo-with-dynamic-name-from-tag.factfile diff --git a/samples/echo-with-dynamic-name-from-tag.factfile b/samples/echo-with-dynamic-name-from-tag.factfile new file mode 100644 index 0000000..b3f26c9 --- /dev/null +++ b/samples/echo-with-dynamic-name-from-tag.factfile @@ -0,0 +1,41 @@ +{ + "schema": "iglu:com.snowplowanalytics.factotum/factfile/jsonschema/1-0-0", + "data": { + "name": "echo order demo {{ tag:env }}", + "tasks": [ + { + "name": "echo alpha {{ tag:env }}", + "executor": "shell", + "command": "echo", + "arguments": [ "alpha {{ tag:env }}" ], + "dependsOn": [], + "onResult": { + "terminateJobWithSuccess": [ 3 ], + "continueJob": [ 0 ] + } + }, + { + "name": "echo beta", + "executor": "shell", + "command": "echo", + "arguments": [ "beta" ], + "dependsOn": [ "echo alpha {{ tag:env }}" ], + "onResult": { + "terminateJobWithSuccess": [ 3 ], + "continueJob": [ 0 ] + } + }, + { + "name": "echo omega", + "executor": "shell", + "command": "echo", + "arguments": [ "and omega!" ], + "dependsOn": [ "echo beta" ], + "onResult": { + "terminateJobWithSuccess": [ 3 ], + "continueJob": [ 0 ] + } + } + ] + } +} diff --git a/src/factotum/parser/mod.rs b/src/factotum/parser/mod.rs index 021c95b..3205d2d 100644 --- a/src/factotum/parser/mod.rs +++ b/src/factotum/parser/mod.rs @@ -35,7 +35,7 @@ pub enum OverrideResultMappings { } pub fn parse(factfile: &str, - env: Option, + env: Option, overrides: OverrideResultMappings) -> Result { info!("reading {} into memory", factfile); @@ -48,17 +48,9 @@ pub fn parse(factfile: &str, parse_str(&f, factfile, env, overrides) } -pub fn inflate_env(env: &str) -> Result { - Json::from_str(env).map_err(|err| { - format!("Supplied environment/config '{}' is not valid JSON: {}", - env, - Error::description(&err)) - }) -} - fn parse_str(json: &str, from_filename: &str, - env: Option, + env: Option, overrides: OverrideResultMappings) -> Result { info!("parsing json:\n{}", json); @@ -70,15 +62,7 @@ fn parse_str(json: &str, info!("'{}' matches the factotum schema definition!", from_filename); - let conf = if let Some(c) = env { - info!("inflating config:\n{}", c); - Some(try!(inflate_env(&c))) - } else { - info!("no config specified!"); - None - }; - - parse_valid_json(json, conf, overrides).map_err(|msg| { + parse_valid_json(json, env, overrides).map_err(|msg| { format!("'{}' is not a valid factotum factfile: {}", from_filename, msg) diff --git a/src/factotum/parser/tests.rs b/src/factotum/parser/tests.rs index 6d1fb8d..da68e8c 100644 --- a/src/factotum/parser/tests.rs +++ b/src/factotum/parser/tests.rs @@ -176,25 +176,3 @@ fn overrides_set_noop_values() { } } - -#[test] -fn inflate_env_produces_json() { - let sample = "{\"hello\":\"world\"}"; - if let Ok(j) = inflate_env(sample) { - assert_eq!(Json::from_str(sample).unwrap(), j) - } else { - panic!("valid json did not produce inflated json") - } -} - -#[test] -fn inflate_env_bad_json() { - let invalid = "{\"hello\":\"world\""; // missing final } - if let Err(msg) = inflate_env(invalid) { - assert_eq!("Supplied environment/config '{\"hello\":\"world\"' is not valid JSON: failed \ - to parse json", - msg) - } else { - panic!("invalid json parsed successfully") - } -} diff --git a/src/main.rs b/src/main.rs index ecf8b87..6e2e981 100644 --- a/src/main.rs +++ b/src/main.rs @@ -50,6 +50,8 @@ use std::env; use hyper::Url; use std::sync::mpsc; use std::net; +use rustc_serialize::json::{self, Json, ToJson}; +use std::collections::BTreeMap; #[cfg(test)] use std::fs::File; use std::collections::HashMap; @@ -320,14 +322,14 @@ fn dot(factfile: &str, start_from: Option) -> Result { Ok(ff.as_dotfile(start_from)) } -fn validate(factfile: &str, env: Option) -> Result { +fn validate(factfile: &str, env: Option) -> Result { match factotum::parser::parse(factfile, env, OverrideResultMappings::None) { Ok(_) => Ok(format!("'{}' is a valid Factfile!", factfile).green().to_string()), Err(msg) => Err(msg.red().to_string()), } } -fn parse_file_and_simulate(factfile: &str, env: Option, start_from: Option) -> i32 { +fn parse_file_and_simulate(factfile: &str, env: Option, start_from: Option) -> i32 { parse_file_and_execute_with_strategy(factfile, env, start_from, @@ -342,7 +344,7 @@ fn parse_file_and_simulate(factfile: &str, env: Option, start_from: Opti } fn parse_file_and_execute(factfile: &str, - env: Option, + env: Option, start_from: Option, webhook_url: Option, job_tags: Option>, @@ -359,7 +361,7 @@ fn parse_file_and_execute(factfile: &str, } fn parse_file_and_execute_with_strategy(factfile: &str, - env: Option, + env: Option, start_from: Option, strategy: F, override_result_map: OverrideResultMappings, @@ -669,6 +671,44 @@ fn test_tag_map() { assert_eq!(with_comma, expected_comma); } +fn json_str_to_btreemap(j: &str) -> Result, String> { + json::decode(j).map_err(|err| { + format!("Supplied string '{}' is not valid JSON: {}", + j, + Error::description(&err)) + }) +} + +fn str_to_json(s: &str) -> Result { + Json::from_str(s).map_err(|err| { + format!("Supplied string '{}' is not valid JSON: {}", + s, + Error::description(&err)) + }) +} + +#[test] +fn str_to_json_produces_json() { + let sample = "{\"hello\":\"world\"}"; + if let Ok(j) = str_to_json(sample) { + assert_eq!(Json::from_str(sample).unwrap(), j) + } else { + panic!("valid json did not produce inflated json") + } +} + +#[test] +fn str_to_json_bad_json() { + let invalid = "{\"hello\":\"world\""; // missing final } + if let Err(msg) = str_to_json(invalid) { + assert_eq!("Supplied string '{\"hello\":\"world\"' is not valid JSON: failed \ + to parse json", + msg) + } else { + panic!("invalid json parsed successfully") + } +} + fn get_log_config() -> Result { let file_appender = match log4rs::appender::FileAppender::builder(".factotum/factotum.log").build() { Ok(fa) => fa, @@ -709,7 +749,6 @@ fn main() { } fn factotum() -> i32 { - if let Err(log) = init_logger() { println!("Log initialization error: {}", log); return PROC_OTHER_ERROR; @@ -729,6 +768,40 @@ fn factotum() -> i32 { None }; + // Environment should always be present as tags can populate the env + let env_str: String = if let Some(c) = args.flag_env { + c + } else { + "{}".to_string() + }; + + let env_json: Option = { + match json_str_to_btreemap(&env_str) { + Ok(mut a) => { + if let Some(tm) = tag_map.as_ref() { + for (key, value) in tm { + let tag_key = format!("tag:{}", key.to_string()); + a.insert(tag_key, value.to_string()); + } + } + + match str_to_json(&json::encode(&a).unwrap()) { + Ok(a) => { + Some(a) + } + Err(e) => { + print!("{}", e); + return PROC_OTHER_ERROR; + } + } + } + Err(e) => { + print!("{}", e); + return PROC_OTHER_ERROR; + } + } + }; + if args.flag_no_colour { env::set_var("CLICOLOR", "0"); } @@ -774,16 +847,16 @@ fn factotum() -> i32 { if !args.flag_dry_run { parse_file_and_execute(&args.arg_factfile, - args.flag_env, + env_json, args.flag_start, args.flag_webhook, tag_map, args.flag_max_stdouterr_size) } else { - parse_file_and_simulate(&args.arg_factfile, args.flag_env, args.flag_start) + parse_file_and_simulate(&args.arg_factfile, env_json, args.flag_start) } } else if args.cmd_validate { - match validate(&args.arg_factfile, args.flag_env) { + match validate(&args.arg_factfile, env_json) { Ok(msg) => { println!("{}", msg); PROC_SUCCESS From 0b41b88a6b678e77c96ac4a605352bd9ef60cd9e Mon Sep 17 00:00:00 2001 From: jbeemster Date: Thu, 26 Dec 2019 09:31:12 +0100 Subject: [PATCH 09/12] Target Ubuntu Trusty for Linux builds (closes #122) --- .travis.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index a765776..f206342 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ language: rust +dist: trusty rust: -- stable -- beta -- nightly -os: + - stable + - beta + - nightly +os: - linux - osx matrix: From 8a1a797d3381164721d84b8f347a8a6c6de6345f Mon Sep 17 00:00:00 2001 From: jbeemster Date: Sun, 7 Feb 2021 19:56:48 +0100 Subject: [PATCH 10/12] Migrate to Git Actions and remove Bintray (closes #124) --- .github/workflows/cd.yml | 125 +++++++++++++++++++++++ .github/workflows/ci.yml | 62 +++++++++++ .gitignore | 2 + .travis.yml | 24 ----- .travis/build.sh | 16 --- .travis/deploy/deploy.factfile | 53 ---------- .travis/deploy/tasks/check_release.rb | 61 ----------- .travis/deploy/tasks/provision.sh | 7 -- .travis/deploy/tasks/release_config.yaml | 27 ----- .travis/deploy/tasks/ship_release.sh | 12 --- Makefile | 60 +++++++++++ README.md | 9 +- 12 files changed, 252 insertions(+), 206 deletions(-) create mode 100644 .github/workflows/cd.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 100755 .travis/build.sh delete mode 100644 .travis/deploy/deploy.factfile delete mode 100755 .travis/deploy/tasks/check_release.rb delete mode 100755 .travis/deploy/tasks/provision.sh delete mode 100644 .travis/deploy/tasks/release_config.yaml delete mode 100755 .travis/deploy/tasks/ship_release.sh create mode 100644 Makefile diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..234e42b --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,125 @@ +name: cd + +on: + push: + tags: + - '*' + +jobs: + ubuntu: + name: Compile Linux + strategy: + matrix: + os: [ubuntu-18.04] + runs-on: ${{ matrix.os }} + + steps: + - name: Install latest rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + default: true + override: true + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + run: make test + + - name: Extract tag version from ref + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Build + run: make zip + env: + PLATFORM: linux + BUILD_VERSION: ${{ steps.get_version.outputs.VERSION }} + + - name: Upload binary + uses: actions/upload-artifact@v2 + with: + name: factotum_${{ steps.get_version.outputs.VERSION }}_linux_x86_64.zip + path: build/compiled/factotum_${{ steps.get_version.outputs.VERSION }}_linux_x86_64.zip + + macos: + name: Compile macOS + strategy: + matrix: + os: [macos-10.15] + runs-on: ${{ matrix.os }} + + steps: + - name: Install latest rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-apple-darwin + default: true + override: true + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + run: make test + + - name: Extract tag version from ref + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Build + run: make zip + env: + PLATFORM: darwin + BUILD_VERSION: ${{ steps.get_version.outputs.VERSION }} + + - name: Upload binary + uses: actions/upload-artifact@v2 + with: + name: factotum_${{ steps.get_version.outputs.VERSION }}_darwin_x86_64.zip + path: build/compiled/factotum_${{ steps.get_version.outputs.VERSION }}_darwin_x86_64.zip + + release: + needs: ["ubuntu", "macos"] + + name: Release + strategy: + matrix: + os: [ubuntu-18.04] + runs-on: ${{ matrix.os }} + + steps: + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + tag_name: ${{ github.ref }} + release_name: Release ${{ github.ref }} + draft: false + prerelease: false + + - name: Extract tag version from ref + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - run: mkdir -p ./build/compiled + + - uses: actions/download-artifact@v2 + with: + name: factotum_${{ steps.get_version.outputs.VERSION }}_linux_x86_64.zip + path: build/compiled + + - uses: actions/download-artifact@v2 + with: + name: factotum_${{ steps.get_version.outputs.VERSION }}_darwin_x86_64.zip + path: build/compiled + + - name: Upload release binaries + uses: alexellis/upload-assets@0.2.3 + env: + GITHUB_TOKEN: ${{ github.token }} + with: + asset_paths: '["./build/compiled/*"]' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..b2d3cd5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,62 @@ +name: ci + +on: + push: + branches: + - '*' + - '*/*' + - '**' + +jobs: + ubuntu: + name: Compile & Test + strategy: + matrix: + os: [ubuntu-18.04] + runs-on: ${{ matrix.os }} + + steps: + - name: Install latest rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + default: true + override: true + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + run: make test + + - name: Build + run: make debug + + - uses: Swatinem/rust-cache@v1 + + macos: + name: Compile & Test + strategy: + matrix: + os: [macos-10.15] + runs-on: ${{ matrix.os }} + + steps: + - name: Install latest rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: x86_64-apple-darwin + default: true + override: true + + - name: Checkout code + uses: actions/checkout@v2 + + - name: Test + run: make test + + - name: Build + run: make debug + + - uses: Swatinem/rust-cache@v1 diff --git a/.gitignore b/.gitignore index 043807d..b1d0461 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,5 @@ Cargo.lock .factotum .vagrant +# Project +build/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index f206342..0000000 --- a/.travis.yml +++ /dev/null @@ -1,24 +0,0 @@ -language: rust -dist: trusty -rust: - - stable - - beta - - nightly -os: - - linux - - osx -matrix: - allow_failures: - - rust: nightly -script: - - $TRAVIS_BUILD_DIR/.travis/build.sh -deploy: - skip_cleanup: true - provider: script - script: ./target/debug/factotum run .travis/deploy/deploy.factfile - on: - tags: true -env: - global: - - secure: cqb1OSopo5lo0vD2PGzjqhZ3Ku7jBl//qRaOR1tqRNRvGYeU4sXpqh0g9UC0EB+tHWLvhotLYlZMNVMN4Fbqa/PVT79jo66DrEDrMcx5Attk7cITjXZQsIlEUCuEGxPJqNuLv5JAFO4b4o3LQIhgVhagEvafvh7mpyrHAq/u8DeBZjqQFEEjfzZ6p+7YyDduZrwwcON3Ipq0nZ7XBZhqAhy/93n5NWOtGv6yXVJ+t643k+OmqvFIWpvytKx9pi63s/QU30uu3VRgBAyAxn66wc3Y8lT4Vjn6RDMajLwoV+5NxV6oIo/ih1xVHiP6lknMwaPncBaQF5KcL3t1KnozGozhL0lbN4GFRC73DsKX1m/eJOFh40XmD/5q7ClVXmELFE6aJyLIh0M/xhacOyudMS+QXTviD54y58fE7wOPEtyAe3ITIBooRUlBCfr6ezWhPtMR3H3QXhqTg39rMCIFReLLD/yUK7LBqrWlwRtWvcJLwzNwMJ1U6PlR+Kc8GrPCUwrPSdrZe3nAXV8RgCs4Pw1Osz1U0F9G+lZFwSOIls/AR6yhudiLu0Sx0e+KvDeVjK+JokqPe4oj9jLxvn/Og3I/ku++96F2d/Wv6MaLI+KsDZiCPzWE6HpFTYmVkAc/4QQwKjs/YsjzSY4wsUf1neboGHVzR0ioO+yO3CCq7cE= - - secure: VFjLGez/gPkKvgV0SekgxL3Ws2Z/nd97IM7GmZUpyUutesqefopw49N4uas97t1DQ1Oz2U3yLAE3lnK8ivf7A2nLLoxNdo5fldjsFP/Ugfybg294zV/7V42nmZ6evw9q7DBzEUzb2595m+iJggcEr9rxINXfRO81vdczRwnmOLPkiM33RCmYPH0h0E6xxTcDcvAXpAQ0ubcg8Rvy8TdxFqQPzxiM8IWYuoYa6p7eazCvrBs2D12suhp3j6jMFRTIhOo4hZ5RawGCvH2jD/52y2DVMOgJ/Ha9MK+MAl7irxPjRSC+towfRF1iOJt8XdklL4QLF4F1948/m1SCp5BIfmM1ANkIDkaEDwoTac7HQT9o4G5fQN8TC6FFJjLBDqzGOOzQlDILafG3pQv6ZnAAgHAXEKI/kIXOHX1BwFQ65FRsFGw0+qhEwOb5zeVNzWhTfgZ6Y47LYmnjeVu8hHwVot5TsYBcx1bX+uQsxe2Si6MDN0OT5Sr1X7Z5sodja+YDedkIfmqXRv59IX9oxiFQLt6ZR0igRzb7ElgvuxOFuHyx6Z5ZhFUg95E5x4cURrZCqT1uzVapT8JLcZRv0xaNg2nmss/j3Vrku4hL1tzSCL2DT0GpG9RqXbetbVXKwZAlYO+5OYQCvmaKKx5dMPpwF/JcKqAZ+JvJnUwX6TLBTnQ= diff --git a/.travis/build.sh b/.travis/build.sh deleted file mode 100755 index 32b0767..0000000 --- a/.travis/build.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -e - -if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - echo "Configuring openssl libs for OSX..." - #brew install openssl - export OPENSSL_INCLUDE_DIR=`brew --prefix openssl`/include - export OPENSSL_LIB_DIR=`brew --prefix openssl`/lib - echo "...done!" -fi - -if [ "$1" == "--release" ]; then - cargo build --verbose --release -else - cargo build --verbose - cargo test --verbose -fi diff --git a/.travis/deploy/deploy.factfile b/.travis/deploy/deploy.factfile deleted file mode 100644 index 796aaba..0000000 --- a/.travis/deploy/deploy.factfile +++ /dev/null @@ -1,53 +0,0 @@ -{ - "schema": "iglu:com.snowplowanalytics.factotum/factfile/jsonschema/1-0-0", - "data": { - "name": "deploy factotum releases", - "tasks": [ - { - "name": "is-candidate-arch", - "executor": "shell", - "command": ".travis/deploy/tasks/check_release.rb", - "arguments": [], - "dependsOn": [], - "onResult": { - "terminateJobWithSuccess": [ 2 ], - "continueJob": [ 0 ] - } - }, - { - "name": "provision-release-manager", - "executor": "shell", - "command": ".travis/deploy/tasks/provision.sh", - "arguments": [], - "dependsOn": [ "is-candidate-arch" ], - "onResult": { - "terminateJobWithSuccess": [], - "continueJob": [ 0 ] - } - }, - { - "name": "build-release-artifact", - "executor": "shell", - "command": ".travis/build.sh", - "arguments": [ "--release" ], - "dependsOn": [ "is-candidate-arch" ], - "onResult": { - "terminateJobWithSuccess": [], - "continueJob": [ 0 ] - } - }, - { - "name": "ship-release-artifact", - "executor": "shell", - "command": ".travis/deploy/tasks/ship_release.sh", - "arguments": [], - "dependsOn": [ "build-release-artifact" ], - "onResult": { - "terminateJobWithSuccess": [], - "continueJob": [ 0 ] - } - } - - ] - } -} diff --git a/.travis/deploy/tasks/check_release.rb b/.travis/deploy/tasks/check_release.rb deleted file mode 100755 index 580c950..0000000 --- a/.travis/deploy/tasks/check_release.rb +++ /dev/null @@ -1,61 +0,0 @@ -#!/usr/bin/env ruby - -def perror(msg, warn_only=false) - if warn_only then - puts "INFO: #{msg}" - exit 2 - end - STDERR.puts "ERROR: #{msg}" - exit 1 -end - -def get_toml_version - contents = File.read("Cargo.toml") - version = contents.match("version\s*=\s*\"(.*)\"") - if version.nil? - perror("Couldn't get project version from Cargo.toml") - else - version[1] - end -end - -arch=ENV['TRAVIS_OS_NAME'] -tag=ENV['TRAVIS_TAG'] - -rust_version=ENV['TRAVIS_RUST_VERSION'] - -if arch.nil? - perror "Operating system is unknown (TRAVIS_OS_NAME not set)" -end - -if tag.nil? - perror "Tag version is unknown (TRAVIS_TAG not set)" -end - -if rust_version.nil? - perror "Rust version is unknown (TRAVIS_RUST_VERSION not set)" -end - -if rust_version != "stable" - perror "Not deploying from non-stable Rust", true -end - -bintray_user=ENV['BINTRAY_SNOWPLOW_GENERIC_USER'] -bintray_key=ENV['BINTRAY_SNOWPLOW_GENERIC_API_KEY'] - -if bintray_user.nil? - perror "Bintray user is unknown (BINTRAY_SNOWPLOW_GENERIC_USER is not set)" -end - -if bintray_key.nil? - perror "Bintray key is unknown (BINTRAY_SNOWPLOW_GENERIC_API_KEY is not set)" -end - -if tag.match(/^\d+\.\d+\.\d+-?.*$/).nil? - perror "Ignoring tag '#{tag}' as it isn't a deployable version", true -end - -toml_version = get_toml_version -if tag != toml_version - perror "Tag '#{tag}' does not match the version in Cargo.toml ('#{toml_version}')" -end diff --git a/.travis/deploy/tasks/provision.sh b/.travis/deploy/tasks/provision.sh deleted file mode 100755 index 8c1ce5d..0000000 --- a/.travis/deploy/tasks/provision.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e - -if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - pip2 install --user release-manager==0.1.0 -else - pip install --user release-manager==0.1.0 -fi diff --git a/.travis/deploy/tasks/release_config.yaml b/.travis/deploy/tasks/release_config.yaml deleted file mode 100644 index ff1964e..0000000 --- a/.travis/deploy/tasks/release_config.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- -# Required: local settings -local: - root_dir : <%= ENV['TRAVIS_BUILD_DIR'] %> - -# Required: packages to be deployed -targets: - - type : "bintray" # Options: bintray - user : <%= ENV['BINTRAY_SNOWPLOW_GENERIC_USER'] %> - password : <%= ENV['BINTRAY_SNOWPLOW_GENERIC_API_KEY'] %> - -packages: - - repo : "snowplow-generic" - name : "factotum" - user_org : "snowplow" - publish : true - override : false - continue_on_conflict : false - version : <%= ENV['TRAVIS_TAG'] %> - - # Required: Artifact - artifacts: - - prefix : "factotum_" - suffix : <%= ENV['RM_SUFFIX'] %> - type : "zip" - binary_paths: - - target/release/factotum \ No newline at end of file diff --git a/.travis/deploy/tasks/ship_release.sh b/.travis/deploy/tasks/ship_release.sh deleted file mode 100755 index 1ede13d..0000000 --- a/.travis/deploy/tasks/ship_release.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/bash - -# ship release using release manager - -if [ "${TRAVIS_OS_NAME}" == "osx" ]; then - SUFFIX="_darwin_x86_64" - export PATH=$PATH:/Users/travis/Library/Python/2.7/bin -else - SUFFIX="_linux_x86_64" -fi - -env RM_SUFFIX=${SUFFIX} release-manager --config .travis/deploy/tasks/release_config.yaml --make-version --make-artifact --upload-artifact diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..a3b2d22 --- /dev/null +++ b/Makefile @@ -0,0 +1,60 @@ +.PHONY: debug release zip test check-env clean + +# ----------------------------------------------------------------------------- +# CONSTANTS +# ----------------------------------------------------------------------------- + +version = $(shell cat Cargo.toml | grep "^version = \"" | sed -n 's/^.*version = "\(.*\)".*/\1/p' | xargs) + +build_dir = build +target_dir = target +factotum_dir = .factotum + +compiled_dir = $(build_dir)/compiled + +# ----------------------------------------------------------------------------- +# BUILDING +# ----------------------------------------------------------------------------- + +debug: + cargo build --verbose + +release: + cargo build --verbose --release + +zip: release check-env +ifeq ($(version),$(BUILD_VERSION)) + mkdir -p $(compiled_dir) + (cd target/release && zip -r staging.zip factotum) + mv target/release/staging.zip $(compiled_dir)/factotum_$(version)_$(PLATFORM)_x86_64.zip +else + $(error BUILD_VERSION and Cargo.toml version do not match - cannot release) +endif + +# ----------------------------------------------------------------------------- +# TESTING +# ----------------------------------------------------------------------------- + +test: + cargo test --verbose + +# ----------------------------------------------------------------------------- +# HELPERS +# ----------------------------------------------------------------------------- + +check-env: +ifndef PLATFORM + $(error PLATFORM is undefined) +endif +ifndef BUILD_VERSION + $(error BUILD_VERSION is undefined) +endif + +# ----------------------------------------------------------------------------- +# CLEANUP +# ----------------------------------------------------------------------------- + +clean: + rm -rf $(build_dir) + rm -rf $(target_dir) + rm -rf $(factotum_dir) diff --git a/README.md b/README.md index 6c7b016..1d6794b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Factotum -[![Build Status][travis-image]][travis] [![Release][release-image]][releases] [![Apache License 2.0][license-image]][license] +[![Release][release-image]][releases] [![Apache License 2.0][license-image]][license] A dag running tool designed for efficiently running complex jobs with non-trivial dependency trees. @@ -15,8 +15,8 @@ A dag running tool designed for efficiently running complex jobs with non-trivia Assuming you're running **64 bit Linux**: ```{bash} -wget https://bintray.com/artifact/download/snowplow/snowplow-generic/factotum_0.5.0_linux_x86_64.zip -unzip factotum_0.5.0_linux_x86_64.zip +wget https://github.com/snowplow/factotum/releases/download/0.6.0/factotum_0.6.0_linux_x86_64.zip +unzip factotum_0.6.0_linux_x86_64.zip ./factotum --version ``` @@ -141,9 +141,6 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -[travis-image]: https://travis-ci.org/snowplow/factotum.svg?branch=master -[travis]: https://travis-ci.org/snowplow/factotum - [license-image]: http://img.shields.io/badge/license-Apache--2-blue.svg?style=flat [license]: http://www.apache.org/licenses/LICENSE-2.0 From ae8913b79768c8d013801542365fbd6b5fe82e29 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Sun, 7 Feb 2021 20:04:02 +0100 Subject: [PATCH 11/12] Update Copyright years to 2016-2021 (closes #125) --- README.md | 2 +- src/factotum/executor/execution_strategy/mod.rs | 2 +- src/factotum/executor/execution_strategy/tests.rs | 2 +- src/factotum/executor/mod.rs | 2 +- src/factotum/executor/task_list/mod.rs | 2 +- src/factotum/executor/task_list/tests.rs | 2 +- src/factotum/executor/tests.rs | 2 +- src/factotum/factfile/dot/mod.rs | 2 +- src/factotum/factfile/dot/tests.rs | 2 +- src/factotum/factfile/mod.rs | 2 +- src/factotum/factfile/tests.rs | 2 +- src/factotum/mod.rs | 2 +- src/factotum/parser/mod.rs | 2 +- src/factotum/parser/schemavalidator/mod.rs | 2 +- src/factotum/parser/schemavalidator/tests.rs | 2 +- src/factotum/parser/templater/mod.rs | 2 +- src/factotum/parser/templater/tests.rs | 2 +- src/factotum/parser/tests.rs | 2 +- src/factotum/sequencer/mod.rs | 2 +- src/factotum/sequencer/tests.rs | 2 +- src/factotum/tests.rs | 2 +- src/factotum/webhook/jobcontext/mod.rs | 2 +- src/factotum/webhook/jobcontext/tests.rs | 2 +- src/factotum/webhook/jobupdate/mod.rs | 2 +- src/factotum/webhook/jobupdate/tests.rs | 2 +- src/factotum/webhook/mod.rs | 2 +- src/factotum/webhook/tests.rs | 2 +- src/main.rs | 2 +- 28 files changed, 28 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 1d6794b..c16f529 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ Factotum is written in **[Rust](https://www.rust-lang.org/)**. ## Copyright and license -Factotum is copyright 2016-2019 Snowplow Analytics Ltd. +Factotum is copyright 2016-2021 Snowplow Analytics Ltd. Licensed under the **[Apache License, Version 2.0][license]** (the "License"); you may not use this software except in compliance with the License. diff --git a/src/factotum/executor/execution_strategy/mod.rs b/src/factotum/executor/execution_strategy/mod.rs index c6a681d..d51c7e5 100644 --- a/src/factotum/executor/execution_strategy/mod.rs +++ b/src/factotum/executor/execution_strategy/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/execution_strategy/tests.rs b/src/factotum/executor/execution_strategy/tests.rs index 0f233da..f664f2e 100644 --- a/src/factotum/executor/execution_strategy/tests.rs +++ b/src/factotum/executor/execution_strategy/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/mod.rs b/src/factotum/executor/mod.rs index 79af2de..c922265 100644 --- a/src/factotum/executor/mod.rs +++ b/src/factotum/executor/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/task_list/mod.rs b/src/factotum/executor/task_list/mod.rs index 3eadb4f..90095c0 100644 --- a/src/factotum/executor/task_list/mod.rs +++ b/src/factotum/executor/task_list/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/task_list/tests.rs b/src/factotum/executor/task_list/tests.rs index ad05337..5993101 100644 --- a/src/factotum/executor/task_list/tests.rs +++ b/src/factotum/executor/task_list/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/executor/tests.rs b/src/factotum/executor/tests.rs index a3aaa72..7974866 100644 --- a/src/factotum/executor/tests.rs +++ b/src/factotum/executor/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/factfile/dot/mod.rs b/src/factotum/factfile/dot/mod.rs index 1918c49..37c6d72 100644 --- a/src/factotum/factfile/dot/mod.rs +++ b/src/factotum/factfile/dot/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/factfile/dot/tests.rs b/src/factotum/factfile/dot/tests.rs index 331495c..e870019 100644 --- a/src/factotum/factfile/dot/tests.rs +++ b/src/factotum/factfile/dot/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/factfile/mod.rs b/src/factotum/factfile/mod.rs index 88806a1..9bca965 100644 --- a/src/factotum/factfile/mod.rs +++ b/src/factotum/factfile/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/factfile/tests.rs b/src/factotum/factfile/tests.rs index 2bdebe0..3479795 100644 --- a/src/factotum/factfile/tests.rs +++ b/src/factotum/factfile/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/mod.rs b/src/factotum/mod.rs index c4e590b..cb6edbb 100644 --- a/src/factotum/mod.rs +++ b/src/factotum/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/mod.rs b/src/factotum/parser/mod.rs index 3205d2d..7056264 100644 --- a/src/factotum/parser/mod.rs +++ b/src/factotum/parser/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/schemavalidator/mod.rs b/src/factotum/parser/schemavalidator/mod.rs index b045281..c184f3e 100644 --- a/src/factotum/parser/schemavalidator/mod.rs +++ b/src/factotum/parser/schemavalidator/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/schemavalidator/tests.rs b/src/factotum/parser/schemavalidator/tests.rs index b35f49b..e3b3525 100644 --- a/src/factotum/parser/schemavalidator/tests.rs +++ b/src/factotum/parser/schemavalidator/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/templater/mod.rs b/src/factotum/parser/templater/mod.rs index 41adf62..712f97a 100644 --- a/src/factotum/parser/templater/mod.rs +++ b/src/factotum/parser/templater/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/templater/tests.rs b/src/factotum/parser/templater/tests.rs index 7f6e296..86e7bad 100644 --- a/src/factotum/parser/templater/tests.rs +++ b/src/factotum/parser/templater/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/parser/tests.rs b/src/factotum/parser/tests.rs index da68e8c..c0a824b 100644 --- a/src/factotum/parser/tests.rs +++ b/src/factotum/parser/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/sequencer/mod.rs b/src/factotum/sequencer/mod.rs index 2194953..4411696 100644 --- a/src/factotum/sequencer/mod.rs +++ b/src/factotum/sequencer/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/sequencer/tests.rs b/src/factotum/sequencer/tests.rs index ff4a9ff..39bac4a 100644 --- a/src/factotum/sequencer/tests.rs +++ b/src/factotum/sequencer/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/tests.rs b/src/factotum/tests.rs index 932ef60..7285b82 100644 --- a/src/factotum/tests.rs +++ b/src/factotum/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/jobcontext/mod.rs b/src/factotum/webhook/jobcontext/mod.rs index 0d740fc..e04509b 100644 --- a/src/factotum/webhook/jobcontext/mod.rs +++ b/src/factotum/webhook/jobcontext/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/jobcontext/tests.rs b/src/factotum/webhook/jobcontext/tests.rs index 4919816..9a283f6 100644 --- a/src/factotum/webhook/jobcontext/tests.rs +++ b/src/factotum/webhook/jobcontext/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/jobupdate/mod.rs b/src/factotum/webhook/jobupdate/mod.rs index 36ba445..7ca82da 100644 --- a/src/factotum/webhook/jobupdate/mod.rs +++ b/src/factotum/webhook/jobupdate/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/jobupdate/tests.rs b/src/factotum/webhook/jobupdate/tests.rs index ff08abf..c661b14 100644 --- a/src/factotum/webhook/jobupdate/tests.rs +++ b/src/factotum/webhook/jobupdate/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/mod.rs b/src/factotum/webhook/mod.rs index 96818f6..9afeaec 100644 --- a/src/factotum/webhook/mod.rs +++ b/src/factotum/webhook/mod.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/factotum/webhook/tests.rs b/src/factotum/webhook/tests.rs index f8565d0..9ea95f4 100644 --- a/src/factotum/webhook/tests.rs +++ b/src/factotum/webhook/tests.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License diff --git a/src/main.rs b/src/main.rs index 6e2e981..a8049bc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -// Copyright (c) 2016-2019 Snowplow Analytics Ltd. All rights reserved. +// Copyright (c) 2016-2021 Snowplow Analytics Ltd. All rights reserved. // // This program is licensed to you under the Apache License Version 2.0, and // you may not use this file except in compliance with the Apache License From 2c8af2fe085ee53afad6b97121c09871eab4d9a9 Mon Sep 17 00:00:00 2001 From: jbeemster Date: Sun, 7 Feb 2021 20:07:55 +0100 Subject: [PATCH 12/12] Prepared for release --- CHANGELOG | 14 ++++++++++++++ Cargo.toml | 2 +- README.md | 4 ++-- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index e16d00a..3181fee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,17 @@ +Version 0.6.0 (2021-02-07) +-------------------------- +Fix Vagrant build environment (#114) +Add ability to template the name of a step in a Factotum DAG (#113) +Add ability to template the name of a Factotum DAG (#117) +Update Copyright years to 2016-2019 (#115) +Ensure raw factfile is templated to allow webhooks to work (#118) +Fix failing tests on Rust 1.40.0 (#120) +Bump hyper to 0.10.+ to support OpenSSL 1.1 (#119) +Target Ubuntu Trusty for Linux builds (#122) +Append tags to the environment so as to make them available to sub-processes (#121) +Migrate to Git Actions and remove Bintray (#124) +Update Copyright years to 2016-2021 (#125) + Version 0.5.0 (2018-06-26) -------------------------- Configurable max event size for webhook updates (#94) diff --git a/Cargo.toml b/Cargo.toml index a0d6585..d3c5505 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "factotum" -version = "0.5.0" +version = "0.6.0" authors = ["Ed Lewis ", "Josh Beemster "] [dependencies] diff --git a/README.md b/README.md index c16f529..7755a0a 100644 --- a/README.md +++ b/README.md @@ -126,7 +126,7 @@ Factotum is written in **[Rust](https://www.rust-lang.org/)**. * on Linux/Mac - `curl -sSf https://static.rust-lang.org/rustup.sh | sh` * Clone this repository - `git clone git@github.com:snowplow/factotum.git` * `cd factotum` -* Compile and run a demo - `cargo run -- samples/echo.factfile` +* Compile and run a demo - `cargo run -- run samples/echo.factfile` ## Copyright and license @@ -144,5 +144,5 @@ limitations under the License. [license-image]: http://img.shields.io/badge/license-Apache--2-blue.svg?style=flat [license]: http://www.apache.org/licenses/LICENSE-2.0 -[release-image]: http://img.shields.io/badge/release-0.5.0-blue.svg?style=flat +[release-image]: http://img.shields.io/badge/release-0.6.0-blue.svg?style=flat [releases]: https://github.com/snowplow/factotum/releases