Merge branch 'master' of ssh://github.com/BBVA/kapow

This commit is contained in:
Héctor Hurtado
2020-08-17 16:20:41 +02:00
11 changed files with 74 additions and 25 deletions
+1
View File
@@ -0,0 +1 @@
1.14.3
+29
View File
@@ -0,0 +1,29 @@
name: Bump Go
on:
schedule:
- cron: 00 7 * * *
push:
branches:
- master
jobs:
go-bump:
runs-on: ubuntu-20.04
steps:
- name: Clone current repo
uses: actions/checkout@v2
- name: Bump Go
id: go-bump
uses: panchoh/go-bump@master
- name: Create pull request
uses: peter-evans/create-pull-request@v2
with:
title: ${{ steps.go-bump.outputs.pr-title }}
commit-message: ${{ steps.go-bump.outputs.pr-title }}
branch: ${{ steps.go-bump.outputs.branch-name }}
+5 -3
View File
@@ -5,9 +5,6 @@ on:
tags:
- v*.*.*
env:
GO_VERSION: 1.14.4
jobs:
build:
@@ -18,6 +15,11 @@ jobs:
with:
fetch-depth: 0
- name: Load Go version
id: go-version
run: |
echo "::set-env name=GO_VERSION::$(tr -d '\n' < .github/versions/go)"
- uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
+23
View File
@@ -0,0 +1,23 @@
name: Test
on:
push:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Lint
uses: golangci/golangci-lint-action@v1
with:
version: v1.27
- name: Build
run: |
make test race build
- name: Spec test
run: |
docker run --mount type=bind,source=$(pwd)/build/kapow,target=/usr/local/bin/kapow bbvalabsci/kapow-spec-test-suite:latest behave --tags=~@skip
+1 -1
View File
@@ -2,7 +2,7 @@
<img alt="Kapow! Logo" src="https://raw.githubusercontent.com/BBVA/kapow/master/docs/source/_static/logo.png" width=300 />
<h3 align="center">If you can script it, you can HTTP it.</h3>
<p align="center">
<a href="https://circleci.com/gh/BBVA/kapow/tree/master"><img alt="Test status" src="https://circleci.com/gh/BBVA/kapow/tree/master.svg?style=svg" /></a>
<a href="https://github.com/BBVA/kapow/actions?query=workflow%3ATest"><img alt="Test status" src="https://github.com/BBVA/kapow/workflows/Test/badge.svg" /></a>
<a href="https://goreportcard.com/badge/github.com/bbva/kapow"><img alt="Go Report" src="https://goreportcard.com/badge/github.com/bbva/kapow" /></a>
<a href="https://github.com/BBVA/kapow/issues/"><img alt="Open Issues" src="https://img.shields.io/github/issues/BBVA/kapow" /></a>
<a href="https://kapow.readthedocs.io"><img alt="Documentation" src="https://img.shields.io/readthedocs/kapow" /></a>
+1 -1
View File
@@ -21,7 +21,7 @@ Overview
/
├─ request
│ ├──── method Used HTTP Method (GET, POST)
│ ├──── method HTTP Method used (GET, POST)
│ ├──── host Host part of the URL
│ ├──── path Complete URL path (URL-unquoted)
│ ├──── matches
@@ -84,8 +84,6 @@ whole thing documented in one html file, served with *Kapow!*.
:linenos:
$ cat index.pow
#!/usr/bin/env bash
kapow route add / - <<-'EOF'
cat howto.html | kapow set /response/body
EOF
@@ -99,22 +97,19 @@ source. In fact, a `pow` file is just a regular shell script.
Debugging scripts
-----------------
Kapow! redirect standard output and standard error of the pow file given on server
startup to its own standard output and error, so you can use ``set -x`` at the beginning
of the script in order to be able to see all the commands expanded and usethat information
for debugging.
Since *Kapow!* redirects the standard output and the standard error of the `pow`
file given on server startup to its own, you can leverage ``set -x`` to see the
commands that are being executed, and use that for debugging.
In order to be able to debug user request executions, the server subcommand has
a ``--debug`` option flag that redirects the script standard output and standard error
to Kapow! standard output, so you can use ``set -x`` at the beginning of the script
the same way as in pow files.
To support debugging user request executions, the server subcommand has a
``--debug`` option flag that prompts *Kapow!* to redirect both the script's
standard output and standard error to *Kapow!*'s standard output, so you can
leverage ``set -x`` the same way as with `pow` files.
.. code-block:: console
$ cat withdebug.pow
#!/usr/bin/env bash
kapow route add / - <<-'EOF'
set -x
echo "This will be seen in the log"
+2 -2
View File
@@ -1,8 +1,8 @@
Welcome to *Kapow!*
===================
.. image:: https://circleci.com/gh/BBVA/kapow/tree/master.svg?style=svg
:target: https://circleci.com/gh/BBVA/kapow/tree/master
.. image:: https://github.com/BBVA/kapow/workflows/Test/badge.svg
:target: https://github.com/BBVA/kapow/actions?query=workflow%3ATest
.. image:: https://goreportcard.com/badge/github.com/bbva/kapow
:target: https://goreportcard.com/report/github.com/bbva/kapow
.. image:: https://img.shields.io/github/issues/BBVA/kapow
+3 -4
View File
@@ -21,9 +21,8 @@ What have we done?
**Junior**
Got it! There're a
`lot of resources to work with </theory/resource_tree.rst>`_, I see that we
can write to the response. Do you think this will work for us?
Got it! There're a :ref:`lot of resources to work with <resource-tree>`.
I see that we can write to the response. Do you think this will work for us?
**Senior**
@@ -47,7 +46,7 @@ What have we done?
**Senior**
Looks good to me, clean and simple, and it is a very good idea to use ``GET``
here as it wont change anything in the server. Let's restart *Kapow!* and try it.
here as it won't change anything in the server. Let's restart *Kapow!* and try it.
**Junior**
+1 -1
View File
@@ -56,7 +56,7 @@ I Need my Report!
**Junior**
And why *Susan* can't ``ssh`` into the server herself to see all of this?
And why can't *Susan* ``ssh`` into the server herself to see all of this?
**Senior**
+1 -1
View File
@@ -424,7 +424,7 @@ following resource paths:
/ The root of the resource paths tree
├─ request All information related to the HTTP request. Read-Only
│ ├──── method Used HTTP Method (GET, POST)
│ ├──── method HTTP Method used (GET, POST)
│ ├──── host Host part of the URL
│ ├──── path Complete URL path (URL-unquoted)
│ ├──── matches Previously matched URL path parts