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:
parent
2e9189a53c
commit
37515f337a
24
.zuul.yaml
24
.zuul.yaml
|
@ -13,19 +13,25 @@
|
||||||
- project:
|
- project:
|
||||||
check:
|
check:
|
||||||
jobs:
|
jobs:
|
||||||
- airship-airshipui-lint-unit
|
- airshipui-test
|
||||||
|
- airshipui-lint
|
||||||
gate:
|
gate:
|
||||||
jobs:
|
jobs:
|
||||||
- airship-airshipui-lint-unit
|
- airshipui-test
|
||||||
|
- airshipui-lint
|
||||||
post:
|
post:
|
||||||
jobs:
|
jobs:
|
||||||
- airshipui-upload-git-mirror
|
- airshipui-upload-git-mirror
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: airship-airshipui-lint-unit
|
name: airshipui-test
|
||||||
pre-run: playbooks/airship-airshipui-deploy-docker.yaml
|
pre-run: playbooks/install-go.yaml
|
||||||
run: playbooks/airship-airshipui-lint-unit.yaml
|
run: playbooks/airshipui-test/run.yaml
|
||||||
nodeset: airship-airshipui-single-node
|
|
||||||
|
- job:
|
||||||
|
name: airshipui-lint
|
||||||
|
pre-run: playbooks/install-go.yaml
|
||||||
|
run: playbooks/airshipui-lint/run.yaml
|
||||||
|
|
||||||
- job:
|
- job:
|
||||||
name: airshipui-upload-git-mirror
|
name: airshipui-upload-git-mirror
|
||||||
|
@ -85,9 +91,3 @@
|
||||||
/tp/MjZpSzeWVBeshm3rFSEKUSIh6Ny09pT6//Cb0mhaitr+q7hHo0OdCiiovuoE/05Q9
|
/tp/MjZpSzeWVBeshm3rFSEKUSIh6Ny09pT6//Cb0mhaitr+q7hHo0OdCiiovuoE/05Q9
|
||||||
4zLKXC0a6/DRvnpq1jZL5cssNrf5sjrspIPe2yf/gy+NDG+eN/2zyAYhHgaA5rDOPwpjo
|
4zLKXC0a6/DRvnpq1jZL5cssNrf5sjrspIPe2yf/gy+NDG+eN/2zyAYhHgaA5rDOPwpjo
|
||||||
bpCTetrKmxTJbwMjPML5oRLef5GJU1zGLOmNA68AOGlt5RFC1lSUPe+ZTW8QTM=
|
bpCTetrKmxTJbwMjPML5oRLef5GJU1zGLOmNA68AOGlt5RFC1lSUPe+ZTW8QTM=
|
||||||
|
|
||||||
- nodeset:
|
|
||||||
name: airship-airshipui-single-node
|
|
||||||
nodes:
|
|
||||||
- name: primary
|
|
||||||
label: ubuntu-bionic
|
|
||||||
|
|
19
Dockerfile
19
Dockerfile
|
@ -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" ]
|
|
28
Makefile
28
Makefile
|
@ -9,17 +9,6 @@ TOOLBINDIR := tools/bin
|
||||||
LINTER := $(TOOLBINDIR)/golangci-lint
|
LINTER := $(TOOLBINDIR)/golangci-lint
|
||||||
LINTER_CONFIG := .golangci.yaml
|
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
|
COVERAGE_OUTPUT := coverage.out
|
||||||
|
|
||||||
TESTFLAGS ?=
|
TESTFLAGS ?=
|
||||||
|
@ -76,20 +65,3 @@ lint: $(LINTER)
|
||||||
$(LINTER):
|
$(LINTER):
|
||||||
mkdir -p $(TOOLBINDIR)
|
mkdir -p $(TOOLBINDIR)
|
||||||
./tools/install_linter
|
./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
|
|
||||||
|
|
||||||
|
|
|
@ -74,9 +74,7 @@ func initRoutes(router *service.Router) {
|
||||||
if err != nil || !found {
|
if err != nil || !found {
|
||||||
contentResponse.Add(component.NewText(errMsg))
|
contentResponse.Add(component.NewText(errMsg))
|
||||||
} else {
|
} else {
|
||||||
frame := component.NewIFrame(
|
frame := component.NewIFrame("http://127.0.0.1:8001/workflows", "Argo Workflows UI")
|
||||||
"http://127.0.0.1:8001/workflows",
|
|
||||||
"Argo Workflows UI")
|
|
||||||
contentResponse.Add(frame)
|
contentResponse.Add(frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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
|
|
|
@ -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
|
|
|
@ -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"
|
|
@ -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"
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
- hosts: all
|
||||||
|
name: Install Go
|
||||||
|
roles:
|
||||||
|
- install-go
|
Loading…
Reference in New Issue