Packages
An example implementation for an Elixir custom runtime on AWS Lambda
Current section
Files
Jump to
Current section
Files
lib/mix/tasks/zip.ex
# Copyright 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT-0
defmodule Mix.Tasks.Zip do
use Mix.Task
@shortdoc "zip the contents of the current release"
def run(_) do
path = release_path(app_name())
cmd = "cd #{path} && zip -r lambda.zip * && cp lambda.zip #{System.cwd()}"
System.cmd("sh", ["-c", cmd])
end
defp app_name() do
Mix.Project.config()
|> Keyword.fetch!(:app)
|> to_string
end
defp release_path(app) do
"_build/#{Mix.env()}/rel/#{app}/"
end
end