Skip to content

Instantly share code, notes, and snippets.

View ujwaldhakal's full-sized avatar
🏁
.

Ujwal Dhakal ujwaldhakal

🏁
.
View GitHub Profile
module.exports = async (robot) => {
robot.hear (`@deployer`,async (bot) => {
bot.send(`Roger that! Please wait.`);
bot.send(`Github Action has been triggered successfully`);
});
}
robot.hear (`@${process.env.BOT_ID}`,async (bot) => {
// @deploy api featurex to production
const payload = bot.message.text.split(" ")
const service = payload[2];
const branch = payload[3];
const environment = payload[5];
const username = bot.message.user.name;
bot.send(`Roger that! Please wait.`);
if(!validateCommand(bot,username,service,branch,environment)) {
return;
@ujwaldhakal
ujwaldhakal / gist:b0d333df8cbcc98950f2c7213ee46803
Created June 13, 2021 16:13
Hubot deployer workflow file
name: deploy
on:
repository_dispatch:
types: [deploy-service]
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
# Build Stage 1
# This build created a staging docker image
#
FROM node:10.15.2-alpine AS appbuild
WORKDIR /usr/src/app
COPY package.json ./
RUN npm install
COPY ./src ./src
# Build Stage 2
const express = require('express')
const app = express()
const port = 8080
app.get('/', (req, res) => {
res.send('hello world')
})
app.get('/healthcheck', (req, res) => {
provider "google-beta" {
credentials = "${file(var.credential_file_path)}"
project = var.project
region = var.region
version = "~> 3.43"
}
terraform {
backend "gcs" {
prefix = "api"
@ujwaldhakal
ujwaldhakal / deploy.go
Last active April 27, 2021 16:17
Deployment file for blog
package main
import (
"os"
"os/exec"
"github.com/ujwaldhakal/go-gcp-docker-utils/docker"
"github.com/ujwaldhakal/go-gcp-docker-utils/git"
"github.com/ujwaldhakal/go-gcp-docker-utils/utils"
)
@ujwaldhakal
ujwaldhakal / cloud run
Created November 5, 2019 17:43
Deploys on google cloud run
name: Build and Push
on:
push:
branches:
- master
jobs:
build_publish_gcr:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1