Sha256: 2cf477f8ab9a678b27faa562251289c3d877b8bbedb5929cc213d62c46b44671

Contents?: true

Size: 853 Bytes

Versions: 11

Compression:

Stored size: 853 Bytes

Contents

# frozen_string_literal: true

module Neptuno
  module Environment
    # Build docker container for Neptuno project
    class Update < Neptuno::CLI::Base
      desc 'Environment: Update all environment files'

      def call
        env_path = "#{neptuno_path}/environments/"
        services.each do |service|
          service_env_path = env_path + service
          if File.exist?("#{service_env_path}/key") && File.exist?("#{service_env_path}/secrets.gpg")
            system("cd #{service_env_path} && gpg --pinentry-mode loopback --passphrase-file key secrets.gpg")
            system("cd #{service_env_path} && cat default secrets > local_env")
            system("cd #{service_env_path} && rm secrets")
          else
            system("cd #{service_env_path} && ln -sf default local_env")
          end
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
neptuno-1.4.10 lib/neptuno/environment/update.rb
neptuno-1.0.10 lib/neptuno/environment/update.rb
neptuno-1.0.9 lib/neptuno/environment/update.rb
neptuno-1.0.8 lib/neptuno/environment/update.rb
neptuno-1.0.7 lib/neptuno/environment/update.rb
neptuno-1.0.6 lib/neptuno/environment/update.rb
neptuno-1.0.5 lib/neptuno/environment/update.rb
neptuno-1.0.3 lib/neptuno/environment/update.rb
neptuno-1.0.2 lib/neptuno/environment/update.rb
neptuno-1.0.1 lib/neptuno/environment/update.rb
neptuno-1.0.0 lib/neptuno/environment/update.rb