Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Create Github Actions tests workflow #1

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Test suite
on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-16.04, ubuntu-18.04]
rails_env: [staging, production]
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.6
uses: actions/setup-python@v2
if: ${{ matrix.os != 'ubuntu-16.04' }}
with:
python-version: 3.6

# https://github.com/pypa/pip/pull/9189
- name: Install python3.6 on Ubuntu 16.04
if: ${{ matrix.os == 'ubuntu-16.04' }}
run: |
sudo add-apt-repository -y ppa:deadsnakes/ppa
sudo apt-get update
sudo apt-get install -y python3.6 python3.6-dev python3.6-venv
wget https://bootstrap.pypa.io/get-pip.py
sudo -H python3.6 get-pip.py
sudo ln -s /usr/bin/python3.6 /usr/local/bin/python3
sudo ln -s /usr/bin/python3.6 /usr/local/bin/python
- name: Install Ansible
run: pip install ansible
- name: Update system packages
run: sudo apt-get update -y
- name: Install OpenSSH
run: sudo apt-get install -y openssh-server
- name: Generate dummy SSH key
run: ssh-keygen -t rsa -N "" -f ~/.ssh/id_rsa
- name: Create hosts file
run: echo "localhost ansible_connection=local ansible_user=root" > hosts
- name: Run CONSUL installer
run: ansible-playbook consul.yml -i hosts --extra-vars "env=${{ matrix.rails_env }} domain=localhost errbit=True" -vvv
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ A remote server with one of the supported distributions:
- Ubuntu 16.04 x64
- Ubuntu 18.04 x64

Access to a remote server via public ssh key without password.
Access to a remote server via public ssh key without password. If you don't have a SSH key pair yet, you can generate it with `ssh-keygen` command on Linux based systems, this key will be added to the `deploy` user `.ssh/authorized_keys` file during installation process so the machine from where running the installer has access to the servers as the `deploy` user.
The default user is `deploy` but you can [use any user](#using-a-different-user-than-deploy) with sudo privileges.

```
Expand Down
2 changes: 1 addition & 1 deletion roles/errbit/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- name: Use bundler 1.x
replace:
path: "{{ errbit_dir }}/Gemfile.lock"
regexp: ' 2.1.2'
regexp: ' 2.1.4'
replace: ' 1.17.1'

- name: Create log folder
Expand Down
12 changes: 11 additions & 1 deletion roles/mongodb/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
- name: Install MongoDB
- name: Uninstall preinstalled MongoDB versions
apt:
name:
- mongodb*
- mongodb-org*
purge: yes
state: absent
ignore_errors: yes

- name: Install latest MongoDB version
apt:
name:
- mongodb
- mongodb-server
state: present