     with {:ok, environment} <- select_environment(config),
          {:ok, release}     <- select_release(config),
          {:ok, release}     <- apply_environment(release, environment),
+         {:ok, release}     <- apply_configuration(release, config),
          {:ok, output_dir}  <- create_output_dir(release),
          {:ok, apps}        <- copy_applications(release, output_dir),
          :ok                <- create_release_info(release, output_dir, apps),

  end

  defp create_start_clean(rel_dir, output_dir, options) do
    case :systools.make_script('start_clean', options) do
      :ok ->
        File.cp!(Path.join(rel_dir, "start_clean.boot"),

      {:error, reason} ->
        {:error, "failed to create release directory: #{rel_dir}\n  Reason: #{reason}"}
      :ok ->
        release_file     = Path.join(rel_dir, "#{relname}.rel")
        start_clean_file = Path.join(rel_dir, "start_clean.rel")
        start_clean_rel  = %{release | :applications => [:kernel, :stdlib]}
        start_clean_apps = Enum.map(start_clean_rel.applications, &get_app_metadata(&1, release.applications))
        with :ok <- write_relfile(release_file, release, apps),
             :ok <- write_relfile(start_clean_file, start_clean_rel, start_clean_apps),
             :ok <- write_binfile(release, output_dir, rel_dir),
             :ok <- generate_relup(release, output_dir, rel_dir), do: :ok
    end
  end

