Skip to content
This repository has been archived by the owner on Apr 28, 2021. It is now read-only.

init #1

Merged
merged 20 commits into from
Aug 17, 2018
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
/vendor
/.idea
/data

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dává smysl to rovnou dát do generátoru? Najloš říkal že to skoro nikdy není a mívá ten datadir někde vedle a má jich třeba víc, ale jak vidím, tak nejsem jediný, kdo to takhle používá :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

taky to tak používám

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ before_script:
- export APP_IMAGE=keboola-component
- docker -v
- docker build -t $APP_IMAGE .
- docker run $APP_IMAGE composer ci
- docker run -e SLACK_TEST_TOKEN -e SLACK_TEST_CHANNEL $APP_IMAGE composer ci

# push test image to ECR
- docker pull quay.io/keboola/developer-portal-cli-v2:latest
Expand All @@ -31,3 +31,7 @@ deploy:
script: ./deploy.sh
on:
tags: true

notifications:
slack:
secure: me6ybncVMgT74BTFTqez9WGDiN4h7p2y3AONVnk/rwO431HJxLH98TOLE0FFB+uhFNm/wXompfwdJbTEG8Ezw1ilvciABKcfgB7z8wEcyv5qeDDRQk3opMZlupQjZcdU03/i2/IPCaKDHWmkCZFdNLaNpkSUm4UVrHADntKAO2KZgWv0rF6Z1Mwg2onK1MwprEpakXC+MlZFBl7wTVfKMhL3isEb4mSplqTs+N9ucUf2kek/8XhFAmERyNAtjYTroDroEDD1zAGxrPeRsFllXuDsb5v/v3xW3AzwXC8G132jfrR3YvBOM2aIaaZOeoxbsm8H5XkdV8NlTUWZZWPFayBHIeQopusukcoUZKmkXAlE08xLx2FYcE2I0UB0smfzmC7nBGOOn8YkWmSwBlrxPFbU+3+JLf8yrRAWcN5MkEUIFI8oqz2uoOP7CglGPlyz0tGNpPo2OozcEDsZSquGRuWNI9gyvSwggcB4uwJRW2vfVphjGl3vABfnB4pSqP9XMtyxJhp/tphqFWxJcw5xEDLqlCrRk0eGSSXmqg9HpqBZHA30S/6w+9Euh34gPG5t1bINPdTWNpBnMBrwIuylokuq+qIR9ZO55OXwbPvn9jKXgK2lwDG+aBnIaCFht/URg+e+Z2CINUcjNeId3BjlqDMoopc1zHADO6cmcgWIOXk=
54 changes: 49 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,63 @@
# my-component
# Slack Writer

[![Build Status](https://travis-ci.org/keboola/my-component.svg?branch=master)](https://travis-ci.org/keboola/my-component)
[![Build Status](https://travis-ci.com/keboola/wr-slack.svg?branch=master)](https://travis-ci.com/keboola/wr-slack)

> Fill in description
Keboola Connection Writer for [Slack](https://slack.com/)

# Usage

> fill in usage instructions
The following parameters are required:

- `#token` - Workspace token obtained when the application is installed
- `channel` - Channel to send the messages to, e.g. `#my-channel` or `@some-person`

At least one table has to be provided on input mapping and it must have one or two columns. If present, the second
column is assumed to be JSON string with message attachments.

Sample configuration:

```json
{
"storage": {
"input": {
"tables": [
{
"source": "in.c-main.messages",
"destination": "messages.csv"
}
]
}
},
"parameters": {
"#token": "xoxa-00000000",
"channel": "@some-person"
}
}
```

Sample table:

```
"message"
"A message with a <http://connection.keboola.com/|link>"
"A Multiline
message with *bold text*"
```

Sample table with attachments:

```
"first_col"
"some message","[{""text"":""some text"",""actions"":[{""type"":""button"",""name"":""response"",""value"":""yes"",""text"":""yes"",""style"":""primary""}]}]"
```


## Development

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ještě bych poprosil doplnit, kam se v testech posílají ty zprávy.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO nikam. Musis si nastavit env variables, v travisu nevidim, ze by neco meli zadane. Ja to testuju tak, ze jsem si zalozil svuj slack a kdyz to spoustim, tak tomu ty 2 promenne nastavim.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Datadir testy to někam sypou, ale bylo by fajn, abysme věděli kam - přesně proto, abysme nemuseli zakládat pokaždé vlastní slack :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ja vidim v travisu kanal wr-slack:
image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍


Clone this repository and init the workspace with following command:

```
git clone https://github.com/keboola/my-component
git clone https://github.com/keboola/wr-slack
cd my-component
docker-compose build
docker-compose run --rm dev composer install --no-scripts
Expand Down
15 changes: 10 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,30 +1,35 @@
{
"require": {
"PHP": "^7.1",
"guzzlehttp/guzzle": "^6.3",
"keboola/csv": "^2.0",
"keboola/php-component": "^4.1"
},
"require-dev": {
"jakub-onderka/php-parallel-lint": "^1.0",
"keboola/coding-standard": "^4.0",
"keboola/php-temp": "^1.0",
"phpstan/phpstan-shim": "^0.9.2",
"phpstan/phpstan-shim": "^0.10.3",
"phpunit/phpunit": "^7.0",
"symfony/process": "^4.0",
"keboola/datadir-tests": "^1.0"
"keboola/datadir-tests": "^2.1",
"mockery/mockery": "^1.1",
"phpstan/phpstan-mockery": "^0.10"
},
"autoload": {
"psr-4": {
"MyComponent\\": "src/"
"Keboola\\SlackWriter\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"MyComponent\\Tests\\": "tests/phpunit/"
"Keboola\\SlackWriter\\Tests\\": "tests/phpunit/",
"Keboola\\SlackWriter\\Tests\\Functional\\": "tests/functional/"
}
},
"scripts": {
"tests-phpunit": "phpunit",
"tests-datadir": "datadir-tests",
"tests-datadir": "phpunit tests/functional",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spoustet i phpstan

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ten se pouští na ř. 4 v rámci build scriptu

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mas pravdu!

"tests": [
"@tests-phpunit",
"@tests-datadir"
Expand Down
Loading