containers: clean-up build code

The containers code use a code path for installing things which
can all be done using existing CI tooling, let's use that rather
than build our stuff from scratch.

Change-Id: I1bcf5dfaac62666f48f7cce70d53244814b0b7db
This commit is contained in:
Mohammed Naser 2018-12-18 14:59:05 -05:00
parent a9bf7fb236
commit b6ad606bd2
2 changed files with 21 additions and 59 deletions

View File

@ -1,37 +1,25 @@
---
- hosts: all - hosts: all
roles:
- configure-swap
- install-docker
tasks: tasks:
- name: Create logging folders
- name: setup swap
block:
- command: fallocate -l20g /swap
- file:
path: /swap
mode: 0600
- command: mkswap /swap
- command: swapon /swap
become: True
- name: setup logging
shell:
cmd: |
mkdir logs
ln -s $(pwd)/logs /tmp/logs
mkdir -p /tmp/logs/{ansible,build}
executable: /bin/bash
chdir: "{{ zuul.project.src_dir }}"
- name: copy setup script
copy:
src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tools/install_docker_UBUNTU.sh"
dest: /tmp/setup.sh
mode: 0755
- name: run node setup script
shell: /tmp/setup.sh
become: true
- name: changing permission of Docker socket to 666
file: file:
path: /run/docker.sock path: "/tmp/logs/{{ item }}"
mode: 666 state: directory
with_items:
- ansible
- build
- name: Link logs output folder
file:
src: /tmp/logs
dest: "{{ zuul.project.src_dir }}/logs"
state: link
- name: Install dependencies
become: true become: true
pip:
name: docker
state: present

View File

@ -1,26 +0,0 @@
#!/bin/bash
set -o xtrace
set -o errexit
# Setup Docker repo and add signing key
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get -y install --no-install-recommends docker-ce
sudo systemctl start docker --now
sudo docker info
sudo apt-get install python-pip
sudo pip install docker
echo "Completed $0."