$cf_front_app_static_conf = "${cf_front_app}/cmd/web/env/prod.env"
+ $cf_bot_app = "${cf_home}/bot"
+
file { "/var/lib/postgres/data/certs":
ensure => directory,
mode => "0700",
$front_version = lookup("cryptoportfolio::front_version") |$key| { {} }
$front_sha256 = lookup("cryptoportfolio::front_sha256") |$key| { {} }
+ $bot_version = lookup("cryptoportfolio::bot_version") |$key| { {} }
+ $bot_sha256 = lookup("cryptoportfolio::bot_sha256") |$key| { {} }
+
+ unless empty($bot_version) {
+ ensure_packages(["python", "python-pip"])
+
+ file { $cf_bot_app:
+ ensure => "directory",
+ mode => "0700",
+ owner => $cf_user,
+ group => $cf_group,
+ require => User[$cf_user],
+ }
+
+ archive { "${cf_home}/${bot_version}.tar.gz":
+ path => "${cf_home}/${bot_version}.tar.gz",
+ source => "https://git.immae.eu/releases/cryptoportfolio/trader/trader_${bot_version}.tar.gz",
+ checksum_type => "sha256",
+ checksum => $bot_sha256,
+ cleanup => false,
+ extract => true,
+ user => "cryptoportfolio",
+ username => $facts["ec2_metadata"]["hostname"],
+ password => generate_password(24, $password_seed, "ldap"),
+ extract_path => $cf_bot_app,
+ require => [User[$cf_user], File[$cf_bot_app]],
+ } ~>
+ exec { "py-cryptoportfolio-dependencies":
+ cwd => $cf_bot_app,
+ user => $cf_user,
+ environment => ["HOME=${cf_home}"],
+ command => "/usr/bin/make install",
+ require => User[$cf_user],
+ refreshonly => true,
+ }
+ }
+
unless empty($front_version) {
ensure_packages(["go", "npm", "nodejs", "yarn"])