forked from RedHatInsights/edge-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.travis.yml
49 lines (49 loc) · 2.08 KB
/
.travis.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
42
43
44
45
46
47
48
49
---
arch: amd64 # Full VM on AWS or GCE
dist: focal # Ubuntu Focal 20.04
services: docker
language: go
go: "1.21"
os: linux # Linux OS
env:
global:
- FLEET_MANAGEMENT_ORG: quay.io/fleet-management
branches:
only:
- main
- api-snake
before_install:
- |
# if [ "$TRAVIS_PULL_REQUEST" != false ]; then
# export TAG="pr-${TRAVIS_PULL_REQUEST}"
# export LIBFDO_IMAGE="${FLEET_MANAGEMENT_ORG}/pr-checks:${TAG}-libfdo"
# export EDGE_API_IMAGE="${FLEET_MANAGEMENT_ORG}/pr-checks:${TAG}-edge-api"
# else
export TAG="latest"
export LIBFDO_IMAGE="${FLEET_MANAGEMENT_ORG}/libfdo-data:${TAG}"
export EDGE_API_IMAGE="${FLEET_MANAGEMENT_ORG}/edge-api:${TAG}"
# fi
jobs:
include:
# - stage: "Build libfdo-data"
# script:
# - if [ "$TRAVIS_PULL_REQUEST" != false ]; then echo "LABEL quay.expires-after=2d" >> ./test-container/Dockerfile; fi
# - docker build -t ${LIBFDO_IMAGE} -f ./test-container/Dockerfile .
# - docker login quay.io -u ${FLEETER_BOT:-${FLEETER_BOT_PR}} -p ${FLEETER_PASS:-${FLEETER_PASS_PR}} >/dev/null 2>&1
# - docker push ${LIBFDO_IMAGE}
# - stage: "Build & Test"
# name: "Build edge-api"
# script:
# - if [ "$TRAVIS_PULL_REQUEST" != false ]; then echo "LABEL quay.expires-after=2d" >> ./Dockerfile; fi
# - sed -i 's|registry.access.redhat.com/ubi8/ubi|quay.io/centos/centos:stream8|' ./Dockerfile
# - sed -i 's|.*ubi-micro-build.*ubi.repo||' ./Dockerfile
# - sed -i "s|${FLEET_MANAGEMENT_ORG}/libfdo-data|${LIBFDO_IMAGE}|" ./Dockerfile
# - docker build -t ${EDGE_API_IMAGE} -f ./Dockerfile .
# - docker login quay.io -u ${FLEETER_BOT:-${FLEETER_BOT_PR}} -p ${FLEETER_PASS:-${FLEETER_PASS_PR}} >/dev/null 2>&1
# - docker push ${EDGE_API_IMAGE}
- name: "Code Linting"
script:
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.49.0
- golangci-lint --version
- make golangci-lint
- "[ $(make -s golangci-lint | wc -l) -eq 0 ]"