-
Notifications
You must be signed in to change notification settings - Fork 12
/
.gitlab-ci.yml
41 lines (36 loc) · 1.4 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
image: docker:latest
services:
- docker:dind
stages:
- build
- upload
variables:
BUILD_CONTAINER_IMAGE: computermouth/sudeb:jessie
UPLOAD_CONTAINER: $CI_REGISTRY/nextthingco/ci-tools:stable
ARTIFACT_0: /upload/build.zip
build:
stage: build
script:
- docker pull $BUILD_CONTAINER_IMAGE
- docker run --privileged -v $PWD:/opt/builddir -w /opt/builddir --rm $BUILD_CONTAINER_IMAGE /bin/bash -c "sudo apt-get update && sudo apt-get install -yqq git build-essential zip wget tar gzip && wget https://storage.googleapis.com/golang/go1.8.3.linux-amd64.tar.gz && sudo tar -C /usr/local -xzf go1.8.3.linux-amd64.tar.gz && sudo ln -s /usr/local/go/bin/* /usr/bin/ && GOPATH=~/go make get && GOPATH=~/go make && GOPATH=~/go make test && GOPATH=~/go make release && pushd build && zip -r ../build.zip ."
- ls
artifacts:
paths:
- build.zip
upload:
stage: upload
script:
- echo "UPLOAD!!!"
- docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
- docker pull $UPLOAD_CONTAINER
- docker run
-e GHVAR_AWS_ID=${GHVAR_AWS_ID}
-e GHVAR_AWS_PW=${GHVAR_AWS_PW}
-e GHVAR_AWS_REGION=${GHVAR_AWS_REGION}
-e CI_PROJECT_NAME=${CI_PROJECT_NAME}
-e CI_BUILD_REF_NAME=${CI_BUILD_REF_SLUG}
-e CI_BUILD_ID=${CI_BUILD_ID}
-e ARTIFACT_0=${ARTIFACT_0}
--rm -v $PWD:/upload -w /upload
$UPLOAD_CONTAINER ci-s3-upload
${ARTIFACT_0}