#!/bin/bash # Copyright 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. # This script is meant for use inside the clean build dockerfile and makes # assumptions related to that. It should not be run on its own. set -ex cd /src/amazon-ecs-agent DIRTY_WARNING=$(cat <<EOW ***WARNING*** You currently have uncommitted or unstaged changes in your git repository. The release build will not include those and the result may behave differently than expected due to that. Please commit, stash, or remove all uncommitted or unstaged files before creating a release build. EOW ) [ ! -z "$(git status --porcelain)" ] && echo "$DIRTY_WARNING" # Fresh clone to ensure our build doesn't rely on anything outside of vcs # The config values 'user.name' and 'user.email' are used to make git-clone # happy when running in a container as a non-root user. git clone -c user.name="cleanbuild" -c user.email="cleanbuild" /src/amazon-ecs-agent /go/src/github.com/aws/amazon-ecs-agent # Allows the build to be marked as 'clean' so we can distinguish a properly # created build. export ECS_RELEASE="cleanbuild" cd /go/src/github.com/aws/amazon-ecs-agent exec ./scripts/build true /out