Skip to content

Commit

Permalink
Added boilerplate automation (flyteorg#266)
Browse files Browse the repository at this point in the history
  • Loading branch information
yindia authored May 31, 2021
1 parent 85f3a05 commit 035b097
Show file tree
Hide file tree
Showing 36 changed files with 177 additions and 821 deletions.
4 changes: 2 additions & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'LYFT/BOILERPLATE' REPOSITORY:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

run:
skip-dirs:
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
export REPOSITORY=flytepropeller
include boilerplate/lyft/docker_build/Makefile
include boilerplate/lyft/golang_test_targets/Makefile
include boilerplate/lyft/end2end/Makefile
include boilerplate/flyte/docker_build/Makefile
include boilerplate/flyte/golang_test_targets/Makefile
include boilerplate/flyte/end2end/Makefile


.PHONY: update_boilerplate
update_boilerplate:
@curl https://raw.githubusercontent.com/flyteorg/boilerplate/master/boilerplate/update.sh -o boilerplate/update.sh
@boilerplate/update.sh

.PHONY: linux_compile
Expand Down
12 changes: 12 additions & 0 deletions boilerplate/flyte/docker_build/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

.PHONY: docker_build
docker_build:
IMAGE_NAME=$$REPOSITORY ./boilerplate/flyte/docker_build/docker_build.sh

.PHONY: dockerhub_push
dockerhub_push:
IMAGE_NAME=flyteorg/$$REPOSITORY REGISTRY=docker.io ./boilerplate/flyte/docker_build/docker_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ If git head has a git tag, the Dockerhub image will also be tagged ``<IMAGE>:<GI

**To Enable:**

Add ``lyft/docker_build`` to your ``boilerplate/update.cfg`` file.
Add ``flyteorg/docker_build`` to your ``boilerplate/update.cfg`` file.

Add ``include boilerplate/lyft/docker_build/Makefile`` in your main ``Makefile`` _after_ your REPOSITORY environment variable
Add ``include boilerplate/flyte/docker_build/Makefile`` in your main ``Makefile`` _after_ your REPOSITORY environment variable

::

REPOSITORY=<myreponame>
include boilerplate/lyft/docker_build/Makefile
include boilerplate/flyte/docker_build/Makefile

(this ensures the extra Make targets get included in your main Makefile)
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/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:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

set -e

Expand Down Expand Up @@ -47,7 +47,7 @@ echo "${IMAGE_TAG_WITH_SHA} built locally."
if [ -n "$REGISTRY" ]; then

if [ -n "${DOCKER_REGISTRY_PASSWORD}" ]; then
docker login ${REGISTRY} --username="$DOCKER_REGISTRY_USERNAME" --password="$DOCKER_REGISTRY_PASSWORD"
docker login --username="$DOCKER_REGISTRY_USERNAME" --password="$DOCKER_REGISTRY_PASSWORD"
fi

docker tag "$IMAGE_TAG_WITH_SHA" "${REGISTRY}/${IMAGE_TAG_WITH_SHA}"
Expand Down
12 changes: 12 additions & 0 deletions boilerplate/flyte/end2end/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# WARNING: THIS FILE IS MANAGED IN THE 'BOILERPLATE' REPO AND COPIED TO OTHER REPOSITORIES.
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

.PHONY: end2end_execute
end2end_execute:
./boilerplate/flyte/end2end/end2end.sh

.PHONY: k8s_integration_execute
k8s_integration_execute:
echo "pass"
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
#!/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:
# ONLY EDIT THIS FILE FROM WITHIN THE 'FLYTEORG/BOILERPLATE' REPOSITORY:
#
# TO OPT OUT OF UPDATES, SEE https://github.com/lyft/boilerplate/blob/master/Readme.rst
# TO OPT OUT OF UPDATES, SEE https://github.com/flyteorg/boilerplate/blob/master/Readme.rst

set -e

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"

OUT="${DIR}/tmp"
rm -rf ${OUT}
git clone https://github.com/lyft/flyte.git "${OUT}"
git clone https://github.com/flyteorg/flyte.git "${OUT}"

pushd ${OUT}

Expand Down
12 changes: 12 additions & 0 deletions boilerplate/flyte/golang_support_tools/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module github.com/flyteorg/boilerplate

go 1.16

require (
github.com/alvaroloes/enumer v1.1.2
github.com/flyteorg/flytestdlib v0.3.22
github.com/golangci/golangci-lint v1.38.0
github.com/vektra/mockery v0.0.0-20181123154057-e78b021dcbb5
)

replace github.com/vektra/mockery => github.com/enghabu/mockery v0.0.0-20191009061720-9d0c8670c2f0
Loading

0 comments on commit 035b097

Please sign in to comment.