openssl genrsa -out server.key 2048
openssl req -new -x509 -key server.key -out server.pem -days 3650
| go version | |
| # Tested with: | |
| # go version go1.17.6 linux/amd64 | |
| # go version go1.18.3 linux/amd64 | |
| pwd | |
| # /tmp/go-test | |
| go mod init example.com/user/go-test | |
| # go: creating new go.mod: module example.com/user/go-test | 
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/signal" | |
| "syscall" | |
| ) | |
| func main() { | 
| package main | |
| import ( | |
| "image" | |
| _ "image/gif" | |
| _ "image/jpeg" | |
| _ "image/png" | |
| "io" | |
| "mime" | 
| image: golang:1.8-alpine # The alpine builds are much smaller but lack tools we need, we'll add them later | |
| stages: | |
| - build | |
| - test | |
| before_script: | |
| - apk --update --upgrade add git curl-dev openssh curl ca-certificates # This is how we add system dependencies. | |
| # You may need less or more packages for your app. | |
| - curl -sS https://glide.sh/get | sh | |
| - mkdir -p /go/src/gitlab.com/ | 
| # Make it executable | |
| sudo chmod +x etc/init.d/myapp | |
| # Try it: | |
| sudo service myapp start | |
| # Make it run upon boot: | |
| sudo update-rc.d myapp defaults | 
| #!/bin/bash | |
| # | |
| # chkconfig: 35 95 05 | |
| # description: Hello world application. | |
| # Run at startup: sudo chkconfig hello-world on | |
| # Load functions from library | |
| . /etc/init.d/functions | 
| var prompt = require('prompt'); | |
| var config = require('config'); | |
| var peter = require('./peter.js'); | |
| if(!config.has('app.promptSchema') || !config.has('app.google') || !config.has('peter')) { | |
| throw "Error: Check your config."; | |
| } | |
| prompt.start(); |