Refactor build to include Go
Adding the baclient code to Drydock requires a refactor of the build automation to support multiple languages and multiple artifacts included in a single Docker image NOTE: the go source here is a placeholder 'hello world' sample Change-Id: I1b4883f018b33b3d4fcd7cbcb6cba660fcdc93de
This commit is contained in:
parent
5344ed1957
commit
0f39a55942
@ -1,2 +1 @@
|
|||||||
.tox
|
.tox
|
||||||
**/build
|
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -104,3 +104,7 @@ ENV/
|
|||||||
|
|
||||||
# VIM
|
# VIM
|
||||||
.*.swp
|
.*.swp
|
||||||
|
|
||||||
|
# Chart artifacts
|
||||||
|
charts/drydock/charts
|
||||||
|
charts/drydock/requirements.lock
|
||||||
|
17
Makefile
17
Makefile
@ -12,18 +12,20 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
BUILD_DIR := $(shell mktemp -d)
|
BUILD_DIR := $(shell mkdir -p build && mktemp -d -p build)
|
||||||
DOCKER_REGISTRY ?= quay.io
|
DOCKER_REGISTRY ?= quay.io
|
||||||
IMAGE_NAME ?= drydock
|
IMAGE_NAME ?= drydock
|
||||||
IMAGE_PREFIX ?= airshipit
|
IMAGE_PREFIX ?= airshipit
|
||||||
IMAGE_TAG ?= dev
|
IMAGE_TAG ?= dev
|
||||||
HELM := $(BUILD_DIR)/helm
|
HELM := $(shell realpath $(BUILD_DIR))/helm
|
||||||
PROXY ?= http://proxy.foo.com:8000
|
PROXY ?= http://proxy.foo.com:8000
|
||||||
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
|
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
|
||||||
USE_PROXY ?= false
|
USE_PROXY ?= false
|
||||||
PUSH_IMAGE ?= false
|
PUSH_IMAGE ?= false
|
||||||
LABEL ?= commit-id
|
LABEL ?= commit-id
|
||||||
IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
IMAGE ?= ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
|
||||||
|
GO_BUILDER ?= docker.io/golang:1.10-alpine
|
||||||
|
|
||||||
export
|
export
|
||||||
|
|
||||||
# Build all docker images for this project
|
# Build all docker images for this project
|
||||||
@ -101,12 +103,17 @@ helm-install:
|
|||||||
# Make targets intended for use by the primary targets above.
|
# Make targets intended for use by the primary targets above.
|
||||||
|
|
||||||
.PHONY: build_drydock
|
.PHONY: build_drydock
|
||||||
build_drydock: external_dep
|
build_drydock: external_dep build_baclient
|
||||||
export; tools/drydock_image_build.sh
|
export; tools/drydock_image_build.sh
|
||||||
ifeq ($(PUSH_IMAGE), true)
|
ifeq ($(PUSH_IMAGE), true)
|
||||||
docker push $(IMAGE)
|
docker push $(IMAGE)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Make target for building bootaction signal client
|
||||||
|
.PHONY: build_baclient
|
||||||
|
build_baclient: external_dep
|
||||||
|
docker run -tv $(shell realpath go):/work -v $(shell realpath $(BUILD_DIR)):/build -e GOPATH=/work $(GO_BUILDER) go build -o /build/baclient baclient
|
||||||
|
|
||||||
.PHONY: docs
|
.PHONY: docs
|
||||||
docs: clean drydock_docs
|
docs: clean drydock_docs
|
||||||
|
|
||||||
@ -132,7 +139,6 @@ genconfig:
|
|||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(BUILD_DIR)/*
|
|
||||||
rm -rf build
|
rm -rf build
|
||||||
rm -rf docs/build
|
rm -rf docs/build
|
||||||
rm -rf charts/drydock/charts
|
rm -rf charts/drydock/charts
|
||||||
@ -143,6 +149,5 @@ pep8: external_dep
|
|||||||
tox -e pep8
|
tox -e pep8
|
||||||
|
|
||||||
.PHONY: helm_lint
|
.PHONY: helm_lint
|
||||||
helm_lint: clean helm-init
|
helm_lint: helm-init
|
||||||
tools/helm_tk.sh $(HELM)
|
|
||||||
$(HELM) lint charts/drydock
|
$(HELM) lint charts/drydock
|
||||||
|
9
go/src/baclient/baclient.go
Normal file
9
go/src/baclient/baclient.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
)
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
fmt.Printf("Hello World!\n")
|
||||||
|
}
|
@ -18,6 +18,7 @@ ARG TRUSTED_UBUNTU_REPO=no
|
|||||||
ARG ALLOW_UNAUTHENTICATED=false
|
ARG ALLOW_UNAUTHENTICATED=false
|
||||||
ARG PIP_TRUSTED_HOST=foo.com
|
ARG PIP_TRUSTED_HOST=foo.com
|
||||||
ARG PIP_INDEX_URL=https://pypi.org/simple
|
ARG PIP_INDEX_URL=https://pypi.org/simple
|
||||||
|
ARG BUILD_DIR
|
||||||
ENV container docker
|
ENV container docker
|
||||||
ENV PORT 9000
|
ENV PORT 9000
|
||||||
ENV LC_ALL C.UTF-8
|
ENV LC_ALL C.UTF-8
|
||||||
@ -37,15 +38,15 @@ WORKDIR /tmp/drydock
|
|||||||
RUN ./hostdeps.sh; \
|
RUN ./hostdeps.sh; \
|
||||||
rm -r /var/lib/apt/lists/*
|
rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
COPY ./requirements-lock.txt /tmp/drydock/
|
COPY ./python/requirements-lock.txt /tmp/drydock/
|
||||||
RUN pip3 install \
|
RUN pip3 install \
|
||||||
--no-cache-dir \
|
--no-cache-dir \
|
||||||
-r /tmp/drydock/requirements-lock.txt
|
-r /tmp/drydock/requirements-lock.txt
|
||||||
|
|
||||||
|
COPY ./python /tmp/drydock/python
|
||||||
|
COPY ${BUILD_DIR}/baclient /tmp/drydock/python/drydock_provisioner/assets/baclient
|
||||||
|
|
||||||
COPY . /tmp/drydock
|
WORKDIR /tmp/drydock/python
|
||||||
|
|
||||||
WORKDIR /tmp/drydock
|
|
||||||
RUN python3 setup.py install
|
RUN python3 setup.py install
|
||||||
|
|
||||||
EXPOSE $PORT
|
EXPOSE $PORT
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user