Skip to content

Commit

Permalink
Add a 2Keys OSS install to VM to help with testing
Browse files Browse the repository at this point in the history
  • Loading branch information
Gum-Joe committed Dec 20, 2020
1 parent df39ece commit 813106b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,18 @@ Vagrant.configure("2") do |config|
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/base/provision.yml"
end

# Installs 2Keys from source!
# TODO: Remove this once PyPi package published and before closing #72
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/base/twokeys-oss.yml"
end

## PROVISIONING SCRIPT TO SETUP CLIENT ##
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "ansible/client/provision.yml"
end

# 2KEYS BEGIN CUSTOM ANSIBLE PROVISING SCRIPTS
## PROVISING SCRIPTS TO SETUPP PROJECTS, KEYBOARDS ETC
{{{ twokeys_insert_ansible_provising }}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
apk:
name: linux-headers,build-base,python3-dev
state: present
- name: Install 2Keys
become: true
pip:
name: 2Keys
# TODO: Reenable once PyPi package published and don't want to build from source anymore
#- name: Install 2Keys
# become: true
# pip:
# name: 2Keys
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Ansible provisioning for alpine
# used to install 2Keys from the Open Source repo (useful for testing new feratures without publishing to PyPi)
# MUST RUN IN TANDEM WITH PROVISION.YML
---
- hosts: all
vars:
oss_branch: "v1.0.0-detector-improvements-1" # TODO: Change this variable when switching branch (and before merging #148)
oss_root: /support
oss_dirname: "{{ oss_root }}/twokeys"
oss_python_location: "{{ oss_dirname }}/detectors/detector-pi/detector"
oss_python_common_location: "{{ oss_dirname }}/detectors/common/python"
tasks:
- name: Update package index
become: true
apk:
update_cache: yes
- name: Install Git
become: true
apk:
name: git
state: present
- name: Install Pipenv
become: true
pip:
name: pipenv
- name: Create source directory
become: true
file:
path: "{{ oss_root }}" # We install all support sofwtare code here
state: directory
- name: Clone 2Keys
become: true
git:
repo: "https://github.com/Gum-Joe/2Keys"
dest: "{{ oss_dirname }}"
version: "{{ oss_branch }}"

- name: Install Dependencies for 2Keys Common
become: true
command: "chdir={{ oss_python_common_location }} pipenv install --system --dev"
- name: Install 2Keys Common
become: true
command: "chdir={{ oss_python_common_location }} pip install ."

- name: Install 2Keys dependencies
become: true
command: "chdir={{ oss_python_location }} pipenv install --system --dev"
- name: Install 2Keys
become: true
command: "chdir={{ oss_python_location }} pip install ."

- name: Validate
become: true
command: 2Keys --help

0 comments on commit 813106b

Please sign in to comment.