Setting Up Project Directories for PHX

Learn how to clone RWS Git repositories using the clone script and install Ansible Galaxy Roles and Collections to set up your development environment efficiently.

Run the Clone Script

sudo apt install git -y
export GIT_USER= # your gitlab user
export GIT_MAIL= # your gitlab mail
eval `ssh-agent -s`
ssh-add
curl -s -L https://gitlab.com/c2platform/phx/ansible/-/raw/master/clone.sh | bash

Create phx Alias

As part of setting up the C2 development environment see Setup Project Directory and Install Ansible we created two aliases c2 and c2-home.

alias c2-home='cd ~/git/gitlab/c2/ansible-dev'
alias c2='c2-home && source ~/.virtualenv/c2d/bin/activate'

For PHX development we create the phx alias as shown below.

alias phx='c2 && cd ~/git/gitlab/c2/ansible-gis'

Install Ansible Collections and Roles

Navigate to the root of the Ansible project and activate the Ansible virtual environment using the phx alias. Then, install roles and collections as follows:

source ~/.bashrc
phx # activate the PHX Ansible Virtual Environment
ansible-galaxy install -r roles/requirements.yml --force --no-deps -p roles/external
ansible-galaxy collection install -r collections/requirements.yml -p .

By following these steps, you’ll have your project directories set up and be ready for PHX development.



Last modified May 22, 2025: phx dev environment PHX-1 (98524a6)