This file contains hidden or 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
#!/usr/bin/env groovy | |
node { | |
//Clean workspace before doing anything | |
deleteDir() | |
try { | |
buildNumber = getCurrentBuildNumber() | |
dockerImage = "ducmeit1/simple-go-lambda:v${buildNumber}" | |
//Prepare stage will only checkout the last commit of master branch from remote git repository | |
stage('Prepare') { |
This file contains hidden or 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
FROM golang:1.12.13 | |
#Install zip package to using zip | |
RUN DEBIAN_FRONTEND=noninteractive \ | |
apt-get update && \ | |
apt-get install --no-install-recommends -y \ | |
zip | |
#Copy all project to src directory of default GOPATH address with name of project | |
COPY . /go/src/simple-go-lambda |
This file contains hidden or 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
.PHONY: all | |
all: build | |
#Set binary file name | |
PKG = main | |
#Set zip file name | |
ZIPNAME = build.zip | |
#Set default value for GOOS and GOARCH | |
GOOS = linux | |
GOARCH = amd64 |
This file contains hidden or 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
{ | |
"__inputs": [], | |
"__requires": [ | |
{ | |
"type": "grafana", | |
"id": "grafana", | |
"name": "Grafana", | |
"version": "5.4.3" | |
}, | |
{ |
This file contains hidden or 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
upstream backend { | |
192.168.0.1:8000; #server 1 | |
192.168.0.2:8001; #server 2 | |
balancer_by_lua_block { | |
//write your round robin code here | |
local host, port = picked_server() | |
if not host and not port then | |
ngx.status = ngx.HTTP_INTERNAL_SERVER_ERROR | |
ngx.say("no live upstream") |
This file contains hidden or 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
func setNewConfig() error { | |
cfg, err := promptSetNewConfig() | |
if err != nil { | |
return err | |
} | |
err = pkg.WriteConfigFile(cfg) | |
if err != nil { | |
return err | |
} |
This file contains hidden or 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
package common | |
import ( | |
"github.com/manifoldco/promptui" | |
"strconv" | |
) | |
func PromptString(name string) (string, error) { | |
prompt := promptui.Prompt{ | |
Label: name, |
This file contains hidden or 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
package pkg | |
import ( | |
"github.com/ducmeit1/zmp3/pkg/common" | |
"github.com/ducmeit1/zmp3/pkg/zingmp3" | |
"github.com/mitchellh/go-homedir" | |
"github.com/spf13/viper" | |
"os" | |
"path" | |
) |
This file contains hidden or 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
package cmd | |
import ( | |
"fmt" | |
"github.com/spf13/cobra" | |
) | |
var downloadSongCmd = &cobra.Command{ | |
Use: "song", | |
Short: "Download MP3 song from Zing MP3", |
This file contains hidden or 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
package main | |
import "github.com/ducmeit1/zmp3/cmd" | |
func main() { | |
cmd.Execute() | |
} |
NewerOlder