1
This repository has been archived on 2022-11-04. You can view files and clone it, but cannot push or open issues or pull requests.
fwzookeeper_helper/.gitlab-ci.yml

51 lines
1.1 KiB
YAML
Raw Normal View History

2019-03-02 18:37:06 +04:00
image: lab.wtfteam.pro:4567/containers/tdlib-go
stages:
- test
- build
- deploy
before_script:
- go version
- mkdir -p $GOPATH/src/lab.wtfteam.pro/fat0troll/
2019-03-02 18:38:51 +04:00
- ln -s $(pwd) $GOPATH/src/lab.wtfteam.pro/fat0troll/fw_zookeeper_helper
- cd $GOPATH/src/lab.wtfteam.pro/fat0troll/fw_zookeeper_helper
2019-03-02 18:37:06 +04:00
lint:
stage: test
script:
- pwd
- golangci-lint run
test:
stage: test
script:
- pwd
- go test -test.v -cover `go list ./... | grep -v examples | grep -v internal`
build:
stage: build
script:
- pwd
2019-03-02 18:55:52 +04:00
- CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -ldflags '-w -extldflags "-static"'
2019-03-02 18:37:06 +04:00
artifacts:
untracked: true
expire_in: 4 hours
paths:
2019-03-02 18:58:11 +04:00
- fw_zookeeper_helper
2019-03-02 18:37:06 +04:00
deploy:
stage: deploy
only:
- master
before_script:
- apk add --no-cache openssh-client
- mkdir -p ~/.ssh
- echo "$DEPLOY_KEY" | tr -d '\r' > ~/.ssh/id_rsa
- chmod 600 ~/.ssh/id_rsa
- eval "$(ssh-agent -s)"
- ssh-add ~/.ssh/id_rsa
- ssh-keyscan -H $DEPLOY_HOST >> ~/.ssh/known_hosts
script:
2019-03-02 18:58:11 +04:00
- scp fw_zookeeper_helper $DEPLOY_USER@$DEPLOY_HOST:/usr/local/bin/