Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 34 additions & 8 deletions ecs-cli/Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions ecs-cli/modules/cli/local/local_app.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ package local

import (
"fmt"

"github.com/aws/amazon-ecs-cli/ecs-cli/modules/cli/local/network"
"github.com/docker/docker/client"
"github.com/sirupsen/logrus"
"github.com/urfave/cli"
)

Expand All @@ -26,3 +30,17 @@ func Create(c *cli.Context) {
// 3. write to docker-compose.local.yml file
fmt.Println("foo") // placeholder
}

// Up creates a Compose file from an ECS task definition and runs it locally.
//
// The Amazon ECS Local Endpoints container needs to be running already for any local ECS task to work
// (see https://github.com/awslabs/amazon-ecs-local-container-endpoints).
// If the container is not running, this command creates a new network for all local ECS tasks to join
// and communicate with the Amazon ECS Local Endpoints container.
func Up(c *cli.Context) {
docker, err := client.NewEnvClient() // Temporary client created to test network.Setup()
if err != nil {
logrus.Fatal("Could not connect to docker", err)
}
network.Setup(docker)
}
16 changes: 16 additions & 0 deletions ecs-cli/modules/cli/local/network/generate_mock.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Copyright 2015-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file accompanying this file. This file is distributed
// on an "AS IS" BASIS, 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.

package network

//go:generate mockgen.sh github.com/aws/amazon-ecs-cli/ecs-cli/modules/cli/local/network LocalEndpointsStarter mock_network/network.go
125 changes: 125 additions & 0 deletions ecs-cli/modules/cli/local/network/mock_network/network.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading