OpenAPI 2

Submitted by Lizhe on Tue, 11/17/2020 - 08:02

启动Swagger的本地服务器最简单的办法就是 docker

docker pull swaggerapi/swagger-editor

docker run --rm -p 80:8080 swaggerapi/swagger-editor

 

20201117035645

因为实在不喜欢 Java , 这里用 golang 做一个例子

swagger文档的 info 信息,写在package 之前

// Package Helloworld API.

//

OpenAPI 1

Submitted by Lizhe on Tue, 11/17/2020 - 02:15

OpenAPI ( OAS ) 是一个语言无关的 RESTful API 接口规范,

数据类型

OAS 使用几种已知的 format 格式来详细定义所使用的 type 数据类型。

20201117101817

OpenAPI的 根对象

Gitflow 2

Submitted by Lizhe on Wed, 11/11/2020 - 02:41

这一次我们试试 sourcetree 对 Git flow 的支持,不用命令行了 ,毕竟日常工作也不能天天命令行

 

20201111105450

 

20201111125148

 

Gitflow 1

Submitted by Lizhe on Tue, 11/10/2020 - 06:58

关于Gitflow本身,这里先不说了,请参考

https://www.jianshu.com/p/41910dc6ef29

这里重点是尝试一下工具的使用

 

  1. brew install git-flow

20201110030144

然后克隆repo

git clone https://pactera-lizhe@bitbucket.org/pactera-lizhe/hellogitflow.git

 

cd 到 项目文件夹下后, 初始化

 

Github build golang docker image

Submitted by Lizhe on Tue, 10/20/2020 - 10:23

 

name: Docker Image CI

 

on:

  push:

    branches: [ master ]

  pull_request:

    branches: [ master ]

 

jobs:

 

  build:

 

    runs-on: ubuntu-latest

 

    steps:

    - uses: actions/checkout@v2

 

    - name: Build and Push Docker Iamge

      uses: docker/build-push-action@v1

      with: 

        username: ${{ secrets.username }}

        password: ${{ secrets.password }}

CircleCI build golang docker image

Submitted by Lizhe on Tue, 10/20/2020 - 10:20

 

version: 2

jobs:

  build:

    docker:

      - image: golang:alpine3.12

        auth:

          username: libaibai

          password: $password

 

    steps:

      - checkout

      - setup_remote_docker:

          version: 19.03.13

          docker_layer_caching: false

      - run:

          name: Install Docker client

          command: apk add docker-cli

      - run: |

          TAG=0.1

hybris 2005 版本集群配置笔记 2

Submitted by Lizhe on Thu, 10/15/2020 - 07:45

这里需要先将前面启动的 hybris 容器化

正常来说 hybris 可以被分割打成几个不同的 image , 分别用于启动 solr 和 tomcat 等

这里图省事就不分割了,单独的镜像大约 6GB

 

FROM ubuntu

COPY ./jdk-11.0.8_linux-x64_bin.deb /root/
RUN apt update -y && apt install -y libasound2
RUN dpkg -i /root/jdk-11.0.8_linux-x64_bin.deb
RUN update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk-11.0.8/bin/java" 1
RUN update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk-11.0.8/bin/javac" 1

hybris 2005 版本集群配置笔记 1

Submitted by Lizhe on Wed, 10/14/2020 - 08:05

本篇仅尝试 常规局域网内,不涉及 kubernetes

首先来配置数据库

docker run -p 3306:3306 --name mysql  -e MYSQL_ROOT_PASSWORD=root -d mysql:5.7

create database integration;

 

20201014035926

 

CREATE USER hybris IDENTIFIED BY 'hybris';

GRANT ALL PRIVILEGES ON integration.* TO hybris WITH GRANT OPTION;

 

拷贝 jdbc 驱动到

Rasa forms

Submitted by Lizhe on Thu, 09/03/2020 - 02:25

一种常见情形是,使用聊天机器人来搜集用户提供的信息,在rasa中,一般这种行为叫做

slot filling

需要在 policy 中添加

 

policies:

  - name: FormPolicy

  - name: MemoizationPolicy

  - name: TEDPolicy

    max_history: 5

    epochs: 100

  - name: MappingPolicy

 

这里我使用的是官方例子,不过做了一些小修改 

 

## request restaurant happy path

* request_restaurant

    - restaurant_form

    - form{"name": "restaurant_form"}

    - form{"name": null}