Skip to content

Instantly share code, notes, and snippets.

intent('What does this app do?', 'What can I do here?',
reply('This is a news project.'));
const API_KEY = '7bdfb1b10aca41c6becea47611b7c35a';
let savedArticles = [];
// News by Source
intent('Give me the news from $(source* (.*))', (p) => {
let NEWS_API_URL = `https://newsapi.org/v2/top-headlines?apiKey=${API_KEY}`;
# Option-1 : Createting docker image using command module
---
- hosts: all
become: true
tasks:
- name: stop current running container
command: docker stop nodejs-devops-container
ignore_errors: yes
- name: remove stopped container
- name: Download AWS CLI bundle.
shell: "cd /tmp && rm -rf /tmp/awscli* && curl 'https://s3.amazonaws.com/aws-cli/awscli-bundle.zip' -o 'awscli-bundle.zip'"
- name: Update repositories cache and install "unzip" package
apt:
name: unzip
update_cache: yes
- name: Unzip AWS CLI bundle.
shell: "cd /tmp && unzip awscli-bundle.zip"
version: 0.2
phases:
install:
commands:
- echo install serverless framework
- npm install -g serverless
pre_build:
commands:
functions:
hello:
handler: handler.hello
events:
- http:
path: test
method: get
service: serverless-cicd
provider:
name: aws
runtime: nodejs12.x
stage: dev
region: ap-south-1
service: serverless-cicd
provider:
name: aws
runtime: nodejs12.x
stage: dev
region: ap-south-1
'use strict';
module.exports.hello = async event => {
return {
statusCode: 200,
body: JSON.stringify(
{
message: 'Go Serverless v3.0! Your function executed successfully!'
},
null,
deploy:
provider: elasticbeanstalk
region: 'ap-south-1'
app: 'docker-nodeauth'
env: 'DockerNodeauth-env'
bucket_name: 'elasticbeanstalk-ap-south-1-583044482327'
bucket_path: 'docker-nodeauth'
on:
branch: master
access_key_id:
sudo: required
services:
- docker
before_install:
- docker build -t beingjd/docker-nodeauth -f Dockerfile .
script:
- docker run -e CI=true beingjd/docker-nodeauth npm test