.gitlab-ci.yml: add automated aws push on release
This commit is contained in:
parent
f63639782c
commit
642076a231
@ -6,6 +6,7 @@ stages:
|
|||||||
- build-docker
|
- build-docker
|
||||||
- docker-registry-master
|
- docker-registry-master
|
||||||
- docker-registry-tags
|
- docker-registry-tags
|
||||||
|
- aws-upload-tags
|
||||||
|
|
||||||
check-dco:
|
check-dco:
|
||||||
stage: check-dco
|
stage: check-dco
|
||||||
@ -21,28 +22,33 @@ check-dco:
|
|||||||
build-src:
|
build-src:
|
||||||
stage: build-src
|
stage: build-src
|
||||||
image: debian:buster
|
image: debian:buster
|
||||||
variables:
|
|
||||||
GOPATH: $CI_PROJECT_DIR
|
|
||||||
except:
|
except:
|
||||||
- master
|
- master
|
||||||
- tags
|
- tags
|
||||||
before_script:
|
before_script:
|
||||||
- apt update
|
- bash $CI_PROJECT_DIR/scripts/gitlab-ci-build-prescript
|
||||||
- apt install -y curl gnupg git make golang
|
script:
|
||||||
- mkdir -p /go/src /go/bin /go/pkg
|
|
||||||
- export GOPATH=/go
|
- export GOPATH=/go
|
||||||
- export PATH=$PATH:/go/bin
|
- export PATH=$PATH:/go/bin
|
||||||
- curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
|
||||||
- ln -s $CI_PROJECT_DIR /go/src/$CI_PROJECT_NAME
|
|
||||||
- curl -sL https://deb.nodesource.com/setup_10.x | bash -
|
|
||||||
- apt update
|
|
||||||
- apt install -y nodejs
|
|
||||||
- npm install -g yarn@1.10.0
|
|
||||||
script:
|
|
||||||
- cd /go/src/$CI_PROJECT_NAME
|
- cd /go/src/$CI_PROJECT_NAME
|
||||||
- make devel
|
- make devel
|
||||||
- make prod
|
- make prod
|
||||||
|
|
||||||
|
aws-upload-tags:
|
||||||
|
stage: aws-upload-tags
|
||||||
|
image: debian:buster
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
before_script:
|
||||||
|
- bash $CI_PROJECT_DIR/scripts/gitlab-ci-build-prescript
|
||||||
|
script:
|
||||||
|
- export GOPATH=/go
|
||||||
|
- export PATH=$PATH:/go/bin
|
||||||
|
- cd /go/src/$CI_PROJECT_NAME
|
||||||
|
- make prod
|
||||||
|
- cd build/prod && tar -zcvf /commento-linux-amd64-$(git describe --tags).tgz .
|
||||||
|
- aws s3 cp /commento-linux-amd64-$(git describe --tags).tgz s3://commento-release/
|
||||||
|
|
||||||
build-docker:
|
build-docker:
|
||||||
stage: build-docker
|
stage: build-docker
|
||||||
image: docker:stable
|
image: docker:stable
|
||||||
|
17
scripts/gitlab-ci-build-prescript
Normal file
17
scripts/gitlab-ci-build-prescript
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
mkdir -p /go/src /go/bin /go/pkg
|
||||||
|
ln -s $CI_PROJECT_DIR /go/src/$CI_PROJECT_NAME
|
||||||
|
|
||||||
|
apt update
|
||||||
|
apt install -y curl gnupg git make golang python
|
||||||
|
export GOPATH=/go
|
||||||
|
export PATH=$PATH:/go/bin
|
||||||
|
curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh
|
||||||
|
|
||||||
|
curl -sL https://deb.nodesource.com/setup_10.x | bash -
|
||||||
|
apt install -y nodejs
|
||||||
|
npm install -g yarn@1.10.0
|
||||||
|
|
||||||
|
apt install -y python python-pip
|
||||||
|
pip install awscli
|
Loading…
Reference in New Issue
Block a user