Skip to content

Commit

Permalink
Merge branch 'dev' into staging
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Apr 25, 2024
2 parents edc050b + a8aa43a commit 42f1359
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 28 deletions.
20 changes: 10 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,34 @@ thrift_py: ## Builds python code from thrift file
rm -rf gen-py

dev-build: ## Build and Start the docker-compose.dev.yml
docker-compose -f docker-compose.dev.yml up --build
docker compose -f docker-compose.dev.yml up --build

dev-d: ## Build and Start the docker-compose.dev.yml
docker-compose -f docker-compose.dev.yml up -d
docker compose -f docker-compose.dev.yml up -d

dev-build-d: ## Build and Start the docker-compose.dev.yml
docker-compose -f docker-compose.dev.yml up --build -d
docker compose -f docker-compose.dev.yml up --build -d

dev: ## Build and Start the docker-compose.dev.yml
docker-compose -f docker-compose.dev.yml up
docker compose -f docker-compose.dev.yml up

dev-build-bibigrid: ## Build and Start the docker-compose.dev.yml with bibigrid
docker-compose -f docker-compose.dev.bibigrid.yml up --build
docker compose -f docker-compose.dev.bibigrid.yml up --build

dev-bibigrid: ## Build and Start the docker-compose.dev.yml with bibigrid
docker-compose -f docker-compose.dev.bibigrid.yml up
docker compose -f docker-compose.dev.bibigrid.yml up

dev-build-bibigrid-d: ## Build and Start the docker-compose.dev.yml with bibigrid
docker-compose -f docker-compose.dev.bibigrid.yml up --build -d
docker compose -f docker-compose.dev.bibigrid.yml up --build -d

dev-bibigrid-d: ## Build and Start the docker-compose.dev.yml with bibigrid
docker-compose -f docker-compose.dev.bibigrid.yml up -d
docker compose -f docker-compose.dev.bibigrid.yml up -d

production: ## Build Release from .env
docker-compose -f docker-compose.yml up --build -d
docker compose -f docker-compose.yml up --build -d

production-bibigrid: ## Build Release from .env and with bibigrid
docker-compose -f docker-compose.bibigrid.yml up --build -d
docker compose -f docker-compose.bibigrid.yml up --build -d

client_logs: ## Logs from Client
docker logs client_portal-client_1
Expand Down
19 changes: 1 addition & 18 deletions plays/setup_basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
- general_variables.yml


roles:
- role: geerlingguy.docker
tags: always


pre_tasks:
- name: Verify Ansible version
assert:
Expand Down Expand Up @@ -37,18 +32,6 @@
become: no
tags: always

- name: Import deadsnake PPA for python3.8
ansible.builtin.apt_repository:
repo: ppa:deadsnakes/ppa
update_cache: yes
tags: always

- name: Install python3.8
apt:
state: latest
name: python3.8
tags: always

- name: Install python3-pip
apt:
state: latest
Expand All @@ -57,7 +40,7 @@

- name: Install list of packages
apt:
name: ['libffi-dev', 'libssl-dev', 'jq', 'python3-setuptools']
name: [ 'libffi-dev', 'libssl-dev', 'jq', 'python3-setuptools' ]
state: present
update_cache: yes
tags: always
Expand Down
81 changes: 81 additions & 0 deletions plays/setup_docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
---
- name: Install Docker on Ubuntu
hosts: gateway
become: true
vars:
arch_mapping: # Map ansible architecture {{ ansible_architecture }} names to Docker's architecture names
x86_64: amd64
aarch64: arm64

tasks:
- name: Update and upgrade all packages to the latest version
ansible.builtin.apt:
update_cache: true
upgrade: dist
cache_valid_time: 3600

- name: Install required packages
ansible.builtin.apt:
pkg:
- apt-transport-https
- ca-certificates
- curl
- gnupg
- software-properties-common

- name: Create directory for Docker's GPG key
ansible.builtin.file:
path: /etc/apt/keyrings
state: directory
mode: '0755'

- name: Add Docker's official GPG key
ansible.builtin.apt_key:
url: https://download.docker.com/linux/ubuntu/gpg
keyring: /etc/apt/keyrings/docker.gpg
state: present

- name: Print architecture variables
ansible.builtin.debug:
msg: "Architecture: {{ ansible_architecture }}, Codename: {{ ansible_lsb.codename }}"

- name: Add Docker repository
ansible.builtin.apt_repository:
repo: >-
deb [arch={{ arch_mapping[ansible_architecture] | default(ansible_architecture) }}
signed-by=/etc/apt/keyrings/docker.gpg]
https://download.docker.com/linux/ubuntu {{ ansible_lsb.codename }} stable
filename: docker
state: present

- name: Install Docker and related packages
ansible.builtin.apt:
name: "{{ item }}"
state: present
update_cache: true
loop:
- docker-ce
- docker-ce-cli
- containerd.io
- docker-buildx-plugin
- docker-compose-plugin

- name: Add Docker group
ansible.builtin.group:
name: docker
state: present

- name: Add user to Docker group
ansible.builtin.user:
name: "{{ ansible_user }}"
groups: docker
append: true

- name: Enable and start Docker services
ansible.builtin.systemd:
name: "{{ item }}"
enabled: true
state: started
loop:
- docker.service
- containerd.service
1 change: 1 addition & 0 deletions site.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
- import_playbook: plays/setup_docker.yml
- import_playbook: plays/setup_basics.yml
- import_playbook: plays/setup_client.yml

0 comments on commit 42f1359

Please sign in to comment.