mirror of
https://github.com/simon987/Architeuthis.git
synced 2025-04-18 23:36:41 +00:00
jenkins setup
This commit is contained in:
parent
806bd9cdb4
commit
1442711bae
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
[](https://www.codefactor.io/repository/github/simon987/architeuthis)
|
[](https://www.codefactor.io/repository/github/simon987/architeuthis)
|
||||||

|

|
||||||
|
[](https://ci.simon987.net/job/architeuthis_builds/)
|
||||||
|
|
||||||
*NOTE: this is very WIP*
|
*NOTE: this is very WIP*
|
||||||
|
|
||||||
|
34
jenkins/Jenkinsfile
vendored
Normal file
34
jenkins/Jenkinsfile
vendored
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
def remote = [:]
|
||||||
|
remote.name = 'remote'
|
||||||
|
remote.host = env.DEPLOY_HOST
|
||||||
|
remote.user = env.DEPLOY_USER
|
||||||
|
remote.identityFile = '/var/lib/jenkins/.ssh/id_rsa'
|
||||||
|
remote.knownHosts = '/var/lib/jenkins/.ssh/known_hosts'
|
||||||
|
remote.allowAnyHosts = true
|
||||||
|
logLevel = 'FINER'
|
||||||
|
|
||||||
|
pipeline {
|
||||||
|
agent none
|
||||||
|
environment {
|
||||||
|
GOOS='linux'
|
||||||
|
CGO_ENABLED='1'
|
||||||
|
HOME='.'
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Build & deploy') {
|
||||||
|
agent {
|
||||||
|
docker {
|
||||||
|
image 'golang:latest'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
steps {
|
||||||
|
sh 'mkdir -p /go/src/github.com/simon987/Architeuthis'
|
||||||
|
sh 'cp *.go "/go/src/github.com/simon987/Architeuthis"'
|
||||||
|
sh 'cd /go/src/github.com/simon987/Architeuthis && go get ./...'
|
||||||
|
sh 'cd /go/src/github.com/simon987/Architeuthis && go build -a -installsuffix cgo -o "${WORKSPACE}/architeuthis" .'
|
||||||
|
sh 'tar -czf ${BUILD_NUMBER}_architeuthis.tar.gz config.json architeuthis'
|
||||||
|
sshPut remote: remote, from: env.BUILD_NUMBER + '_architeuthis.tar.gz', into: 'architeuthis/webroot/'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
6
main.go
6
main.go
@ -123,9 +123,9 @@ func New() *Balancer {
|
|||||||
p := balancer.chooseProxy()
|
p := balancer.chooseProxy()
|
||||||
|
|
||||||
logrus.WithFields(logrus.Fields{
|
logrus.WithFields(logrus.Fields{
|
||||||
"proxy": p.Name,
|
"proxy": p.Name,
|
||||||
"connexions": p.Connections,
|
"conns": p.Connections,
|
||||||
"url": r.URL,
|
"url": r.URL,
|
||||||
}).Trace("Routing request")
|
}).Trace("Routing request")
|
||||||
|
|
||||||
resp, err := p.processRequest(r)
|
resp, err := p.processRequest(r)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user