Skip to content

Commit

Permalink
resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenjunMa committed Mar 29, 2022
2 parents 2296602 + f431199 commit b645614
Show file tree
Hide file tree
Showing 48 changed files with 1,147 additions and 524 deletions.
17 changes: 17 additions & 0 deletions .github/pr-title-checker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"LABEL": {
"name": "title needs formatting",
"color": "EEEEEE"
},
"CHECKS": {
"prefixes": ["fix: ", "feat: ","doc: ","ci: ","chore: "],
"regexp": "docs\\(v[0-9]\\): ",
"regexpFlags": "i",
"ignoreLabels" : ["dont-check-PRs-with-this-label", "meta"]
},
"MESSAGES": {
"success": "All OK",
"failure": "Failing CI PR title check",
"notice": ""
}
}
4 changes: 2 additions & 2 deletions .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ jobs:
uses: actions/checkout@v2

- name: Run Integrate tests.
run: make wasm-integrate
run: make wasm-integrate-ci

runtime-integrate:
name: runtime-integrate
Expand All @@ -100,4 +100,4 @@ jobs:
uses: actions/checkout@v2

- name: Run Integrate tests.
run: make runtime-integrate
run: make runtime-integrate-ci
19 changes: 19 additions & 0 deletions .github/workflows/pr_title_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: "PR Title Checker"
on:
pull_request_target:
types:
- opened
- edited
- synchronize
- labeled
- unlabeled

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: thehanimo/pr-title-checker@v1.3.4
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
pass_on_octokit_error: false
configuration_path: ".github/pr-title-checker-config.json"
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Auto build and push docker image to docker hub when releasing tags
---
name: Auto Layotto Build and Push image

on:
create

jobs:
publish_image:
name: Build and Push Layotto image
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2.3.5
with:
submodules: recursive

- name: Extract Tags name
if: ${{ startsWith(github.ref, 'refs/tags/') }}
id: tag_env
shell: bash
run: |
echo "##[set-output name=version;]$(echo ${GITHUB_REF##*/})"
- name: Login to Docker Hub
if: ${{ startsWith(github.ref, 'refs/tags/') }}
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build Layotto Image
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
make image tag=${{ steps.tag_env.outputs.version }}
- name: Push Layotto Docker image
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: |
docker push layotto/layotto:${{ steps.tag_env.outputs.version }}
41 changes: 22 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ MAJOR_VERSION = $(shell cat VERSION)
TARGET = layotto
ARM_TARGET = layotto.aarch64
PROJECT_NAME = mosn.io/layotto
CONFIG_FILE = runtime_config.json
BUILD_IMAGE = godep-builder
IMAGE_NAME = layotto
GIT_VERSION = $(shell git log -1 --pretty=format:%h)
REPOSITORY = layotto/${IMAGE_NAME}
CONFIG_FILE = runtime_config.json
BUILD_IMAGE = godep-builder
GIT_VERSION = $(shell git log -1 --pretty=format:%h)
SCRIPT_DIR = $(shell pwd)/etc/script

SCRIPT_DIR = $(shell pwd)/etc/script
IMAGE_NAME = layotto
REPOSITORY = layotto/${IMAGE_NAME}
IMAGE_BUILD_DIR = IMAGEBUILD

IMAGE_TAG := $(tag)

ifeq ($(IMAGE_TAG),)
IMAGE_TAG := dev-${MAJOR_VERSION}-${GIT_VERSION}
endif

build-local:
@rm -rf build/bundles/${MAJOR_VERSION}/binary
Expand All @@ -35,19 +42,17 @@ build-arm64:
mv ${ARM_TARGET} build/bundles/${MAJOR_VERSION}/binary
@cd build/bundles/${MAJOR_VERSION}/binary && $(shell which md5sum) -b ${ARM_TARGET} | cut -d' ' -f1 > ${ARM_TARGET}.md5

image:
docker build --rm -t ${BUILD_IMAGE} build/contrib/builder/binary
docker run --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE} make build-local
@rm -rf IMAGEBUILD
cp -r build/contrib/builder/image IMAGEBUILD && cp build/bundles/${MAJOR_VERSION}/binary/${TARGET} IMAGEBUILD && cp -r configs IMAGEBUILD && cp -r etc IMAGEBUILD
docker build --rm -t ${REPOSITORY}:${MAJOR_VERSION}-${GIT_VERSION} IMAGEBUILD
rm -rf IMAGEBUILD
image: build-local
@rm -rf ${IMAGE_BUILD_DIR}
cp -r build/contrib/builder/image ${IMAGE_BUILD_DIR} && cp build/bundles/${MAJOR_VERSION}/binary/${TARGET} ${IMAGE_BUILD_DIR} && cp -r configs ${IMAGE_BUILD_DIR} && cp -r etc ${IMAGE_BUILD_DIR}
docker build --rm -t ${REPOSITORY}:${IMAGE_TAG} ${IMAGE_BUILD_DIR}
rm -rf ${IMAGE_BUILD_DIR}

wasm-integrate:
wasm-integrate-ci:
docker build --rm -t ${BUILD_IMAGE} build/contrib/builder/image/faas
docker run --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -v $(shell pwd)/test/wasm/wasm_test.sh:/go/src/${PROJECT_NAME}/wasm_test.sh -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE} sh ./wasm_test.sh

runtime-integrate:
runtime-integrate-ci:
docker build --rm -t ${BUILD_IMAGE} build/contrib/builder/image/integrate
docker run --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -v $(shell pwd)/test/runtime/integrate_test.sh:/go/src/${PROJECT_NAME}/integrate_test.sh -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE} sh ./integrate_test.sh

Expand All @@ -58,7 +63,5 @@ build-linux-wasm-layotto:
docker build --rm -t ${BUILD_IMAGE} build/contrib/builder/image/faas
docker run --rm -v $(shell pwd):/go/src/${PROJECT_NAME} -w /go/src/${PROJECT_NAME} ${BUILD_IMAGE} go build -tags wasmer -o layotto /go/src/${PROJECT_NAME}/cmd/layotto

license-checker:
docker run -it --rm -v $(pwd):/github/workspace apache/skywalking-eyes header fix

.PHONY: build
build-linux-wasm-local:
go build -tags wasmer -o layotto $(shell pwd)/cmd/layotto
Loading

0 comments on commit b645614

Please sign in to comment.