-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #62 from joaovitor3/add_ci
Adiciona integração contínua
- Loading branch information
Showing
10 changed files
with
192 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
image: python:3.6-slim | ||
|
||
variables: | ||
BOT_IMAGE: $DOCKERHUB_USER/bot | ||
COACH_IMAGE: $DOCKERHUB_USER/coach | ||
|
||
stages: | ||
- test style | ||
- test stories | ||
- build requirements | ||
- build coach | ||
- build | ||
|
||
|
||
############################################################# | ||
#################### TEST STYLE ############################# | ||
############################################################# | ||
test style: | ||
stage: test style | ||
script: | ||
- pip -V | ||
- python -V | ||
- pip install -r requirements.txt | ||
- flake8 --exclude venv | ||
|
||
|
||
############################################################# | ||
############### TEST STORIES ################################ | ||
############################################################# | ||
test stories: | ||
stage: test stories | ||
image: docker | ||
tags: | ||
- docker | ||
services: | ||
- docker:dind | ||
script: | ||
- docker build -f docker/coach.Dockerfile -t $COACH_IMAGE:latest . | ||
- docker build -f docker/bot.Dockerfile -t $BOT_IMAGE:latest . | ||
- docker run --rm $BOT_IMAGE:latest make test-stories | ||
|
||
|
||
############################################################# | ||
############### BUILD REQUIREMENTS ########################## | ||
############################################################# | ||
build requirements: | ||
stage: build requirements | ||
image: docker | ||
tags: | ||
- docker | ||
services: | ||
- docker:dind | ||
script: | ||
- docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASSWORD | ||
- cd ./docker/bot | ||
- ./build-base.sh publish | ||
only: | ||
refs: | ||
- master | ||
changes: | ||
- ./docker/bot/requirements.txt | ||
environment: homolog | ||
|
||
|
||
############################################################# | ||
############### BUILD COACH ################################# | ||
############################################################# | ||
build coach: | ||
stage: build coach | ||
image: docker | ||
tags: | ||
- docker | ||
services: | ||
- docker:dind | ||
script: | ||
- docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASSWORD | ||
- docker build -f docker/coach.Dockerfile -t $COACH_IMAGE:latest . | ||
- docker push $COACH_IMAGE:latest | ||
only: | ||
- master | ||
environment: homolog | ||
|
||
|
||
############################################################# | ||
############### BUILD BOT ################################### | ||
############################################################# | ||
build bot: | ||
stage: build | ||
image: docker | ||
tags: | ||
- docker | ||
services: | ||
- docker:dind | ||
script: | ||
- docker login -u $DOCKERHUB_USER -p $DOCKERHUB_PASSWORD | ||
- docker build -f docker/bot.Dockerfile -t $BOT_IMAGE:latest . | ||
- docker push $BOT_IMAGE:latest | ||
only: | ||
- master | ||
environment: homolog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,12 @@ | ||
from rasa_core_sdk import Action | ||
from rasa_core_sdk.events import SlotSet | ||
import requests | ||
import random | ||
|
||
|
||
class ActionTest(Action): | ||
def name(self): | ||
return "action_test" | ||
def name(self): | ||
return "action_test" | ||
|
||
def run(self, dispatcher, tracker, domain): | ||
def run(self, dispatcher, tracker, domain): | ||
try: | ||
dispatcher.utter_message("Mensagem enviada por uma custom action.") | ||
dispatcher.utter_message("Mensagem enviada por uma custom action.") | ||
except ValueError: | ||
dispatcher.utter_message(ValueError) | ||
|
||
dispatcher.utter_message(ValueError) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ sklearn-crfsuite==0.3.6 | |
nltk==3.3 | ||
rocketchat-py-sdk==0.0.8 | ||
elasticsearch==6.3.1 | ||
flake8==3.7.8 | ||
|
||
|
Oops, something went wrong.