From 25d072a0ce4c1c432e6fb292b58dafba72a1525a Mon Sep 17 00:00:00 2001 From: Yee Hing Tong Date: Thu, 23 Jan 2020 19:11:52 -0800 Subject: [PATCH] removing unnecessary files --- boilerplate/lyft/docker_build/Makefile | 12 ---- boilerplate/lyft/docker_build/Readme.rst | 23 ------- boilerplate/lyft/docker_build/docker_build.sh | 67 ------------------- .../lyft/flyte_golang_compile/Readme.rst | 16 ----- .../flyte_golang_compile.Template | 26 ------- .../lyft/flyte_golang_compile/update.sh | 13 ---- .../golang_dockerfile/Dockerfile.GoTemplate | 33 --------- boilerplate/lyft/golang_dockerfile/Readme.rst | 16 ----- boilerplate/lyft/golang_dockerfile/update.sh | 13 ---- .../lyft/pull_request_template/Readme.rst | 8 --- .../pull_request_template.md | 36 ---------- .../lyft/pull_request_template/update.sh | 12 ---- 12 files changed, 275 deletions(-) delete mode 100644 boilerplate/lyft/docker_build/Makefile delete mode 100644 boilerplate/lyft/docker_build/Readme.rst delete mode 100755 boilerplate/lyft/docker_build/docker_build.sh delete mode 100644 boilerplate/lyft/flyte_golang_compile/Readme.rst delete mode 100644 boilerplate/lyft/flyte_golang_compile/flyte_golang_compile.Template delete mode 100755 boilerplate/lyft/flyte_golang_compile/update.sh delete mode 100644 boilerplate/lyft/golang_dockerfile/Dockerfile.GoTemplate delete mode 100644 boilerplate/lyft/golang_dockerfile/Readme.rst delete mode 100755 boilerplate/lyft/golang_dockerfile/update.sh delete mode 100644 boilerplate/lyft/pull_request_template/Readme.rst delete mode 100644 boilerplate/lyft/pull_request_template/pull_request_template.md delete mode 100755 boilerplate/lyft/pull_request_template/update.sh diff --git a/boilerplate/lyft/docker_build/Makefile b/boilerplate/lyft/docker_build/Makefile deleted file mode 100644 index 4019dab83..000000000 --- a/boilerplate/lyft/docker_build/Makefile +++ /dev/null @@ -1,12 +0,0 @@ -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst - -.PHONY: docker_build -docker_build: - IMAGE_NAME=$$REPOSITORY ./boilerplate/lyft/docker_build/docker_build.sh - -.PHONY: dockerhub_push -dockerhub_push: - IMAGE_NAME=lyft/$$REPOSITORY REGISTRY=docker.io ./boilerplate/lyft/docker_build/docker_build.sh diff --git a/boilerplate/lyft/docker_build/Readme.rst b/boilerplate/lyft/docker_build/Readme.rst deleted file mode 100644 index bb6af9b49..000000000 --- a/boilerplate/lyft/docker_build/Readme.rst +++ /dev/null @@ -1,23 +0,0 @@ -Docker Build and Push -~~~~~~~~~~~~~~~~~~~~~ - -Provides a ``make docker_build`` target that builds your image locally. - -Provides a ``make dockerhub_push`` target that pushes your final image to Dockerhub. - -The Dockerhub image will tagged ``:`` - -If git head has a git tag, the Dockerhub image will also be tagged ``:``. - -**To Enable:** - -Add ``lyft/docker_build`` to your ``boilerplate/update.cfg`` file. - -Add ``include boilerplate/lyft/docker_build/Makefile`` in your main ``Makefile`` _after_ your REPOSITORY environment variable - -:: - - REPOSITORY= - include boilerplate/lyft/docker_build/Makefile - -(this ensures the extra Make targets get included in your main Makefile) diff --git a/boilerplate/lyft/docker_build/docker_build.sh b/boilerplate/lyft/docker_build/docker_build.sh deleted file mode 100755 index f504c100c..000000000 --- a/boilerplate/lyft/docker_build/docker_build.sh +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst - -set -e - -echo "" -echo "------------------------------------" -echo " DOCKER BUILD" -echo "------------------------------------" -echo "" - -if [ -n "$REGISTRY" ]; then - # Do not push if there are unstaged git changes - CHANGED=$(git status --porcelain) - if [ -n "$CHANGED" ]; then - echo "Please commit git changes before pushing to a registry" - exit 1 - fi -fi - - -GIT_SHA=$(git rev-parse HEAD) - -IMAGE_TAG_SUFFIX="" -# for intermediate build phases, append -$BUILD_PHASE to all image tags -if [ -n "$BUILD_PHASE" ]; then - IMAGE_TAG_SUFFIX="-${BUILD_PHASE}" -fi - -IMAGE_TAG_WITH_SHA="${IMAGE_NAME}:${GIT_SHA}${IMAGE_TAG_SUFFIX}" - -RELEASE_SEMVER=$(git describe --tags --exact-match "$GIT_SHA" 2>/dev/null) || true -if [ -n "$RELEASE_SEMVER" ]; then - IMAGE_TAG_WITH_SEMVER="${IMAGE_NAME}:${RELEASE_SEMVER}${IMAGE_TAG_SUFFIX}" -fi - -# build the image -# passing no build phase will build the final image -docker build -t "$IMAGE_TAG_WITH_SHA" --target=${BUILD_PHASE} . -echo "${IMAGE_TAG_WITH_SHA} built locally." - -# if REGISTRY specified, push the images to the remote registy -if [ -n "$REGISTRY" ]; then - - if [ -n "${DOCKER_REGISTRY_PASSWORD}" ]; then - docker login --username="$DOCKER_REGISTRY_USERNAME" --password="$DOCKER_REGISTRY_PASSWORD" - fi - - docker tag "$IMAGE_TAG_WITH_SHA" "${REGISTRY}/${IMAGE_TAG_WITH_SHA}" - - docker push "${REGISTRY}/${IMAGE_TAG_WITH_SHA}" - echo "${REGISTRY}/${IMAGE_TAG_WITH_SHA} pushed to remote." - - # If the current commit has a semver tag, also push the images with the semver tag - if [ -n "$RELEASE_SEMVER" ]; then - - docker tag "$IMAGE_TAG_WITH_SHA" "${REGISTRY}/${IMAGE_TAG_WITH_SEMVER}" - - docker push "${REGISTRY}/${IMAGE_TAG_WITH_SEMVER}" - echo "${REGISTRY}/${IMAGE_TAG_WITH_SEMVER} pushed to remote." - - fi -fi diff --git a/boilerplate/lyft/flyte_golang_compile/Readme.rst b/boilerplate/lyft/flyte_golang_compile/Readme.rst deleted file mode 100644 index 9c5fc68e7..000000000 --- a/boilerplate/lyft/flyte_golang_compile/Readme.rst +++ /dev/null @@ -1,16 +0,0 @@ -Flyte Golang Compile -~~~~~~~~~~~~~~~~~~~~ - -Common compile script for Flyte golang services. - -**To Enable:** - -Add ``lyft/flyte_golang_compile`` to your ``boilerplate/update.cfg`` file. - -Add the following to your Makefile - -:: - - .PHONY: compile_linux - compile_linux: - PACKAGES={{ *your packages }} OUTPUT={{ /path/to/output }} ./boilerplate/lyft/flyte_golang_compile.sh diff --git a/boilerplate/lyft/flyte_golang_compile/flyte_golang_compile.Template b/boilerplate/lyft/flyte_golang_compile/flyte_golang_compile.Template deleted file mode 100644 index 987b82511..000000000 --- a/boilerplate/lyft/flyte_golang_compile/flyte_golang_compile.Template +++ /dev/null @@ -1,26 +0,0 @@ -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst - -if [ -z "$PACKAGES" ]; then - echo "PACKAGES environment VAR not set" - exit 1 -fi - -if [ -z "$OUTPUT" ]; then - echo "OUTPUT environment VAR not set" - exit 1 -fi - -# get the GIT_SHA and RELEASE_SEMVER - -GIT_SHA=$(git rev-parse HEAD) -RELEASE_SEMVER=$(git describe --tags --exact-match $GIT_SHA 2>/dev/null) - -CURRENT_PKG=github.com/lyft/{{ REPOSITORY }} -VERSION_PKG="${CURRENT_PKG}/vendor/github.com/lyft/flytestdlib" - -LDFLAGS="-X ${VERSION_PKG}/version.Build=${GIT_SHA} -X ${VERSION_PKG}/version.Version=${RELEASE_SEMVER}" - -GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags "$LDFLAGS" -o "$OUTPUT" "$PACKAGES" diff --git a/boilerplate/lyft/flyte_golang_compile/update.sh b/boilerplate/lyft/flyte_golang_compile/update.sh deleted file mode 100755 index 10fd11423..000000000 --- a/boilerplate/lyft/flyte_golang_compile/update.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -echo " - generating ${DIR}/flyte_golang_compile.sh" -sed -e "s/{{REPOSITORY}}/${REPOSITORY}/g" ${DIR}/flyte_golang_compile.Template > ${DIR}/flyte_golang_compile.sh diff --git a/boilerplate/lyft/golang_dockerfile/Dockerfile.GoTemplate b/boilerplate/lyft/golang_dockerfile/Dockerfile.GoTemplate deleted file mode 100644 index f83c1df97..000000000 --- a/boilerplate/lyft/golang_dockerfile/Dockerfile.GoTemplate +++ /dev/null @@ -1,33 +0,0 @@ -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst - -# Using go1.10.4 -FROM golang:1.10.4-alpine3.8 as builder -RUN apk add git openssh-client make curl - -# COPY only the go mod files for efficient caching -COPY go.mod go.sum /go/src/github.com/lyft/{{REPOSITORY}}/ -WORKDIR /go/src/github.com/lyft/{{REPOSITORY}} - -# Pull dependencies -RUN go mod download - -# COPY the rest of the source code -COPY . /go/src/github.com/lyft/{{REPOSITORY}}/ - -# This 'linux_compile' target should compile binaries to the /artifacts directory -# The main entrypoint should be compiled to /artifacts/{{REPOSITORY}} -RUN make linux_compile - -# update the PATH to include the /artifacts directory -ENV PATH="/artifacts:${PATH}" - -# This will eventually move to centurylink/ca-certs:latest for minimum possible image size -FROM alpine:3.8 -COPY --from=builder /artifacts /bin - -RUN apk --update add ca-certificates - -CMD ["{{REPOSITORY}}"] diff --git a/boilerplate/lyft/golang_dockerfile/Readme.rst b/boilerplate/lyft/golang_dockerfile/Readme.rst deleted file mode 100644 index f801ef98d..000000000 --- a/boilerplate/lyft/golang_dockerfile/Readme.rst +++ /dev/null @@ -1,16 +0,0 @@ -Golang Dockerfile -~~~~~~~~~~~~~~~~~ - -Provides a Dockerfile that produces a small image. - -**To Enable:** - -Add ``lyft/golang_dockerfile`` to your ``boilerplate/update.cfg`` file. - -Create and configure a ``make linux_compile`` target that compiles your go binaries to the ``/artifacts`` directory :: - - .PHONY: linux_compile - linux_compile: - RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o /artifacts {{ packages }} - -All binaries compiled to ``/artifacts`` will be available at ``/bin`` in your final image. diff --git a/boilerplate/lyft/golang_dockerfile/update.sh b/boilerplate/lyft/golang_dockerfile/update.sh deleted file mode 100755 index 7d8466326..000000000 --- a/boilerplate/lyft/golang_dockerfile/update.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -echo " - generating Dockerfile in root directory." -sed -e "s/{{REPOSITORY}}/${REPOSITORY}/g" ${DIR}/Dockerfile.GoTemplate > ${DIR}/../../../Dockerfile diff --git a/boilerplate/lyft/pull_request_template/Readme.rst b/boilerplate/lyft/pull_request_template/Readme.rst deleted file mode 100644 index b85a4ea12..000000000 --- a/boilerplate/lyft/pull_request_template/Readme.rst +++ /dev/null @@ -1,8 +0,0 @@ -Pull Request Template -~~~~~~~~~~~~~~~~~~~~~ - -Provides a Pull Request template. - -**To Enable:** - -Add ``lyft/golang_test_targets`` to your ``boilerplate/update.cfg`` file. diff --git a/boilerplate/lyft/pull_request_template/pull_request_template.md b/boilerplate/lyft/pull_request_template/pull_request_template.md deleted file mode 100644 index d646ece83..000000000 --- a/boilerplate/lyft/pull_request_template/pull_request_template.md +++ /dev/null @@ -1,36 +0,0 @@ -# Description -_Please replace this text with a description of what this PR accomplishes._ - -Mark each check box as complete when they are added to this PR. - -[ ] Flow Documented Below - -[ ] Edge and Failure Cases Documented Below - -[ ] Tests - -[ ] Documentation - -[ ] Added tracking JIRA - -## Flow -_Please describe the end-to-end flow._ -- _In the case of a feature, please describe the scenarios that will result in the exercise of these code paths._ -- _In the case of a bug fix, please describe the flow that resulted in the failure and describe how the fix addresses it. Also, note how the change does not affect other flows._ -- _In the case of a refactor, please describe how the flow might have been altered by the refactor, if applicable._ - -## Edge and Failure Cases -_Please document the edge and failure cases associated with this PR._ -- _In the case of a feature, please describe all edge and failure scenarios. If any of the scenarios are not testable in this PR, explain here._ -- _In the case of a bug fix, please describe any NEW edge and/or failure cases. If any of the scenarios are not testable in this PR, explain here._ -- _In the case of a refactor, please describe any NEW edge and/or failure cases. Note and explain any untested edge and/or failure cases._ - -## Test -_Please replace this text with a description of the tests added. General guideline - the more complex the functionality the richer the testing should be. If there are additional tests created in a separate PR, please link to those PRs._ - -## Documentation -_Please replace this text with a description of the documentation added. Currently documentation consists of adding comments -to methods, IDL messages and within functions. Suggestions about rst vs md will be made at another time._ - -## JIRA Link -_Please replace with a link to the JIRA tracking this work._ diff --git a/boilerplate/lyft/pull_request_template/update.sh b/boilerplate/lyft/pull_request_template/update.sh deleted file mode 100755 index 13f0c3b57..000000000 --- a/boilerplate/lyft/pull_request_template/update.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/env bash - -# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES. -# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY: -# -# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst - -set -e - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )" - -cp ${DIR}/pull_request_template.md ${DIR}/../../../pull_request_template.md