Use role from airshipctl to install docker

Change-Id: Ia353f7a1e428379a9e50f34e55fdfda33953dfa9
This commit is contained in:
Shturm, Svetlana 2021-04-07 13:03:17 -05:00
parent 43946aac5b
commit bfc7e1e981
6 changed files with 40 additions and 18 deletions

View File

@ -32,11 +32,26 @@ else
GOBIN=$(shell go env GOBIN)
endif
# Proxy options
HTTP_PROXY ?= http://proxy.foo.com:8000
HTTPS_PROXY ?= https://proxy.foo.com:8000
NO_PROXY ?= localhost,127.0.0.1,.svc.cluster.local
USE_PROXY ?= false
DOCKER_CMD_FLAGS ?=
# Docker proxy flags
DOCKER_PROXY_FLAGS := --build-arg http_proxy=$(HTTP_PROXY)
DOCKER_PROXY_FLAGS += --build-arg https_proxy=$(HTTPS_PROXY)
DOCKER_PROXY_FLAGS += --build-arg HTTP_PROXY=$(HTTP_PROXY)
DOCKER_PROXY_FLAGS += --build-arg HTTPS_PROXY=$(HTTPS_PROXY)
DOCKER_PROXY_FLAGS += --build-arg no_proxy=$(NO_PROXY)
DOCKER_PROXY_FLAGS += --build-arg NO_PROXY=$(NO_PROXY)
ifeq ($(USE_PROXY), true)
DOCKER_CMD_FLAGS += $(DOCKER_PROXY_FLAGS)
endif
kubernetes:
./tools/deployment/install-k8s.sh
@ -86,14 +101,12 @@ generate: controller-gen
images: docker-build-controller docker-build-jump-host
# Build the SIP Docker image
# NOTE: DOCKER_PROXY_FLAGS can be empty.
docker-build-controller:
docker build ${DOCKER_PROXY_FLAGS} --build-arg BASE_IMAGE=${SIP_BASE_IMAGE} . -t ${SIP_IMG}
docker build ${DOCKER_CMD_FLAGS} --build-arg BASE_IMAGE=${SIP_BASE_IMAGE} . -t ${SIP_IMG}
# Build the Jump Host Docker image
# NOTE: DOCKER_PROXY_FLAGS can be empty.
docker-build-jump-host:
docker build ${DOCKER_PROXY_FLAGS} -f images/jump-host/Dockerfile --build-arg BASE_IMAGE=${JUMP_HOST_BASE_IMAGE} . -t ${JUMP_HOST_IMG}
docker build ${DOCKER_CMD_FLAGS} -f images/jump-host/Dockerfile --build-arg BASE_IMAGE=${JUMP_HOST_BASE_IMAGE} . -t ${JUMP_HOST_IMG}
docker-push-controller:
docker push ${SIP_IMG}

View File

@ -1,8 +1,8 @@
- hosts: ubuntu-bionic
tasks:
- name: Run ensure-docker
- name: Run docker-install
include_role:
name: ensure-docker
name: docker-install
- name: Install Dependent Packages
apt:
pkg:

View File

@ -13,7 +13,7 @@
tasks:
- name: Setup Docker
include_role:
name: ensure-docker
name: docker-install
- name: Install Dependent Packages
apt:
@ -42,9 +42,10 @@
params:
DOCKER_IMAGE_TAG: latest
DOCKER_REGISTRY: "{{ image_repo }}"
HTTP_PROXY: "{{ proxy.http_proxy }}"
HTTPS_PROXY: "{{ proxy.https_proxy }}"
NO_PROXY: "{{ proxy.no_proxy }}"
USE_PROXY: "{{ proxy.enabled | lower }}"
HTTP_PROXY: "{{ proxy.http }}"
HTTPS_PROXY: "{{ proxy.https }}"
NO_PROXY: "{{ proxy.noproxy }}"
DOCKER_IMAGE_PREFIX: "{{ docker_image_prefix }}"
target: images
@ -54,9 +55,10 @@
params:
DOCKER_IMAGE_TAG: "{{ zuul.newrev }}"
DOCKER_REGISTRY: "{{ image_repo }}"
HTTP_PROXY: "{{ proxy.http_proxy }}"
HTTPS_PROXY: "{{ proxy.https_proxy }}"
NO_PROXY: "{{ proxy.no_proxy }}"
USE_PROXY: "{{ proxy.enabled | lower }}"
HTTP_PROXY: "{{ proxy.http }}"
HTTPS_PROXY: "{{ proxy.https }}"
NO_PROXY: "{{ proxy.noproxy }}"
DOCKER_IMAGE_PREFIX: "{{ docker_image_prefix }}"
target: images

View File

@ -24,9 +24,9 @@
update_cache: yes
state: present
become: yes
- name: Run ensure-docker
- name: Run docker-install
include_role:
name: ensure-docker
name: docker-install
- name: Download Extract and install Golang
become: yes
unarchive:

View File

@ -12,16 +12,22 @@
name: airship-deploy-sip
run: playbooks/integration-tests.yaml
description: Deploys kubernetes and sip
roles:
- zuul: airship/airshipctl
timeout: 9600
- job:
name: airship-sip-test-suite
description: Install kube-builder and tests make functionality.
run: playbooks/test-sip.yaml
roles:
- zuul: airship/airshipctl
timeout: 9600
- job:
name: airship-sip-publish-images
description: Publishes SIP Docker images to image repository.
run: playbooks/publish-images.yaml
roles:
- zuul: airship/airshipctl
timeout: 9600
secrets:
- name: sip_image_repo_credentials

View File

@ -3,9 +3,10 @@
docker_image_prefix: airshipit
image_repo: quay.io
proxy:
http_proxy: ""
https_proxy: ""
no_proxy: ""
enabled: false
http: ""
https: ""
noproxy: ""
check:
jobs: