Remove docker build for zuul jobs

Instead of using docker to build, lint, and unit tests we can instead
use go directly using Zuul.

Change-Id: I4c22c4f977c94437717da73f52e9665b4e86040d
This commit is contained in:
Jordan Jensen 2019-12-31 13:14:42 -08:00
parent 2e9189a53c
commit 37515f337a
9 changed files with 38 additions and 104 deletions

View File

@ -13,19 +13,25 @@
- project:
check:
jobs:
- airship-airshipui-lint-unit
- airshipui-test
- airshipui-lint
gate:
jobs:
- airship-airshipui-lint-unit
- airshipui-test
- airshipui-lint
post:
jobs:
- airshipui-upload-git-mirror
- job:
name: airship-airshipui-lint-unit
pre-run: playbooks/airship-airshipui-deploy-docker.yaml
run: playbooks/airship-airshipui-lint-unit.yaml
nodeset: airship-airshipui-single-node
name: airshipui-test
pre-run: playbooks/install-go.yaml
run: playbooks/airshipui-test/run.yaml
- job:
name: airshipui-lint
pre-run: playbooks/install-go.yaml
run: playbooks/airshipui-lint/run.yaml
- job:
name: airshipui-upload-git-mirror
@ -85,9 +91,3 @@
/tp/MjZpSzeWVBeshm3rFSEKUSIh6Ny09pT6//Cb0mhaitr+q7hHo0OdCiiovuoE/05Q9
4zLKXC0a6/DRvnpq1jZL5cssNrf5sjrspIPe2yf/gy+NDG+eN/2zyAYhHgaA5rDOPwpjo
bpCTetrKmxTJbwMjPML5oRLef5GJU1zGLOmNA68AOGlt5RFC1lSUPe+ZTW8QTM=
- nodeset:
name: airship-airshipui-single-node
nodes:
- name: primary
label: ubuntu-bionic

View File

@ -1,19 +0,0 @@
ARG GO_IMAGE=docker.io/golang:1.13.1-stretch
ARG RELEASE_IMAGE=scratch
FROM ${GO_IMAGE} as builder
SHELL [ "/bin/bash", "-cex" ]
WORKDIR /usr/src/airshipui
# Take advantage of caching for dependency acquisition
COPY go.mod go.sum /usr/src/airshipui/
RUN go mod download
COPY . /usr/src/airshipui/
ARG MAKE_TARGET=build
RUN make ${MAKE_TARGET}
FROM ${RELEASE_IMAGE} as release
COPY --from=builder /usr/src/airshipui/bin/airshipui /usr/local/bin/airshipui
USER 65534
ENTRYPOINT [ "/usr/local/bin/airshipui" ]

View File

@ -9,17 +9,6 @@ TOOLBINDIR := tools/bin
LINTER := $(TOOLBINDIR)/golangci-lint
LINTER_CONFIG := .golangci.yaml
# build target when calling make in a docker container
DOCKER_MAKE_TARGET := build
# docker image options
DOCKER_REGISTRY ?= quay.io
DOCKER_IMAGE_NAME ?= airshipui
DOCKER_IMAGE_PREFIX ?= airshipit
DOCKER_IMAGE_TAG ?= dev
DOCKER_IMAGE ?= $(DOCKER_REGISTRY)/$(DOCKER_IMAGE_PREFIX)/$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_TAG)
DOCKER_TARGET_STAGE ?= release
COVERAGE_OUTPUT := coverage.out
TESTFLAGS ?=
@ -76,20 +65,3 @@ lint: $(LINTER)
$(LINTER):
mkdir -p $(TOOLBINDIR)
./tools/install_linter
# Configuration for building and testing in a docker image, which is necessary for
# go-related projects in zuul
.PHONY: docker-image
docker-image:
@docker build . --build-arg MAKE_TARGET=$(DOCKER_MAKE_TARGET) --tag $(DOCKER_IMAGE) --target $(DOCKER_TARGET_STAGE)
.PHONY: docker-image-lint
docker-image-lint: DOCKER_MAKE_TARGET = lint
docker-image-lint: DOCKER_TARGET_STAGE = builder
docker-image-lint: docker-image
.PHONY: docker-image-unit-tests
docker-image-unit-tests: DOCKER_MAKE_TARGET = test
docker-image-unit-tests: DOCKER_TARGET_STAGE = builder
docker-image-unit-tests: docker-image

View File

@ -74,9 +74,7 @@ func initRoutes(router *service.Router) {
if err != nil || !found {
contentResponse.Add(component.NewText(errMsg))
} else {
frame := component.NewIFrame(
"http://127.0.0.1:8001/workflows",
"Argo Workflows UI")
frame := component.NewIFrame("http://127.0.0.1:8001/workflows", "Argo Workflows UI")
contentResponse.Add(frame)
}

View File

@ -1,15 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- hosts: all
roles:
- install-docker

View File

@ -1,27 +0,0 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- hosts: primary
tasks:
- name: Run Linter
block:
- name: "make docker-image-lint"
make:
chdir: "{{ zuul.project.src_dir }}"
target: docker-image-lint
- name: Run Unit Tests
block:
- name: "make docker-image-unit-tests"
make:
chdir: "{{ zuul.project.src_dir }}"
target: docker-image-unit-tests

View File

@ -0,0 +1,10 @@
---
- hosts: all
name: Run linter
tasks:
- name: make lint
make:
target: lint
chdir: "{{ zuul.project.src_dir }}"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin"

View File

@ -0,0 +1,10 @@
---
- hosts: all
name: Run tests
tasks:
- name: make test
make:
target: test
chdir: "{{ zuul.project.src_dir }}"
environment:
PATH: "{{ ansible_env.PATH }}:/usr/local/go/bin"

View File

@ -0,0 +1,5 @@
---
- hosts: all
name: Install Go
roles:
- install-go