Skip to content

Commit 4ec53c5

Browse files
authored
Merge pull request #255 from src-d/ci-cd-travis
Signed-off-by: David Pordomingo <[email protected]>
2 parents 7c60a40 + 4adedc5 commit 4ec53c5

13 files changed

+42
-408
lines changed

β€Ž.drone.yml

-104
This file was deleted.

β€Ž.travis.yml

+37-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,49 @@ before_install:
99
- nvm use 8
1010
- npm install -g yarn
1111

12+
stages:
13+
- name: test-linters-build
14+
- name: staging
15+
if: branch = staging AND type = push
16+
- name: release
17+
if: tag IS present
18+
- name: release-helm
19+
if: tag IS present
20+
1221
jobs:
1322
include:
14-
- stage: Tests, linters and build
23+
- name: 'Tests and linters'
24+
stage: test-linters-build
1525
script:
1626
- make lint-frontend
1727
- make test-frontend
1828
- make lint-backend
1929
- make test
2030
- make validate-commit
21-
- script:
31+
- name: 'Build'
32+
stage: test-linters-build
33+
script:
34+
- make build-app
35+
- name: 'Deploy to staging'
36+
stage: staging
37+
script:
38+
# Do not allow for subsequents script steps to run in case previous one fails
39+
- make build-app && VERSION=commit-${TRAVIS_COMMIT:0:7} make docker-push && HELM_RELEASE=code-annotation HELM_CHART=code-annotation K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/infra/ --version 0.1.0 --set image.tag=commit-${TRAVIS_COMMIT:0:7} -f .helm-staging.yml" make deploy
40+
- name: 'Release'
41+
stage: release
42+
script:
2243
- make build-app
44+
- DOCKER_PUSH_LATEST=true make docker-push
45+
deploy:
46+
provider: releases
47+
api_key: $GITHUB_TOKEN
48+
file_glob: true
49+
file: build/*.tar.gz
50+
skip_cleanup: true
51+
on:
52+
tags: true
53+
go: 1.9.x
54+
- name: 'Deploy to production'
55+
stage: release-helm
56+
script:
57+
- B64_CA_CRT=$PRODUCTION_B64_CA_CRT SERVICE_ACCOUNT_TOKEN=$PRODUCTION_SERVICE_ACCOUNT_TOKEN CLUSTER_ENDPOINT=$PRODUCTION_CLUSTER_ENDPOINT HELM_RELEASE=code-annotation HELM_CHART=code-annotation K8S_NAMESPACE=default HELM_ARGS="--repo https://src-d.github.io/charts/infra/ --version 0.1.0 --set image.tag=$TRAVIS_TAG -f .helm-production.yml" make deploy

β€ŽDockerfile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
FROM alpine:3.7
1+
FROM debian:buster-slim
22
ADD ./build/bin /bin
33

4-
RUN apk --update upgrade && \
5-
apk add --no-cache ca-certificates
4+
RUN apt-get update && \
5+
apt-get install -y --no-install-recommends --no-install-suggests \
6+
ca-certificates \
7+
&& apt-get clean
68
RUN mkdir /var/code-annotation
79

810
ENTRYPOINT ["/bin/server"]

β€Žhelm-charts/code-annotation/.helmignore

-21
This file was deleted.

β€Žhelm-charts/code-annotation/Chart.yaml

-4
This file was deleted.

β€Žhelm-charts/code-annotation/README.md

-53
This file was deleted.

β€Žhelm-charts/code-annotation/templates/_helpers.tpl

-16
This file was deleted.

β€Žhelm-charts/code-annotation/templates/deployment.yaml

-72
This file was deleted.

β€Žhelm-charts/code-annotation/templates/ingress.yaml

-32
This file was deleted.

β€Žhelm-charts/code-annotation/templates/persistent-volume-claim.yaml

-12
This file was deleted.

0 commit comments

Comments
Β (0)