Skip to content

magjed4289/TestrayAutomatedTasks

Repository files navigation

TestrayAutomatedTasks

Scripts to run automation between Liferay, Testray, and Jira.


✅ Dependencies

1. Install Python (if not already installed)

Mac
brew install python
Linux (Ubuntu/Debian)
sudo apt update && sudo apt install python3
Fedora
sudo dnf install python3

2. Install pip

Mac

If you installed Python via Homebrew, pip is already included.

Linux (Ubuntu/Debian)
sudo apt install python3-pip
Fedora
sudo dnf install python3-pip

3. Install jira-cli

This is required to check Jira ticket statuses and for future Jira automation features.

Install globally using npm:

sudo npm install -g jira-cli

Configure jira-cli:

jira config

🔗 More info: npmjs.com/package/jira-cli


📦 Clone the Repository

Clone this repo into your preferred working directory:

gh repo clone magjed4289/TestrayAutomatedTasks

⚙️ Configure Environment Variables

  1. Move the .automated_tasks.env file outside and at the same level as the TestrayAutomatedTasks directory.

  2. Edit .automated_tasks.env and fill in the required variables.

Your file tree should look like this:

your-workspace/
├── TestrayAutomatedTasks/
└── .automated_tasks.env

🔐 Jira API Token Setup

  1. Go to your Jira ProfileManage Your AccountSecurity tab.
  2. Under API tokens, click Create and manage API tokens.
  3. Generate a new token and copy it.

🖥️ Setup on Your Machine

  1. In your home directory (~), create a hidden folder named .jira-user:

    mkdir ~/.jira-user
  2. Inside the .jira-user folder, create two files (no file extensions):

    • token: Paste your copied API token into this file.
    • user: Enter the email address associated with your Jira account.

    Your folder structure should look like this:

    ~/.jira-user/
    ├── token
    └── user
    

⚙️ What Happens on First Run

  • When you run the automation script for the first time:
    • Your API token will be securely encrypted for future use.
    • The plain token file will be automatically deleted after encryption.

📥 Install Python Dependencies

From the root of the TestrayAutomatedTasks directory:

pip install -r requirements.txt

▶️ How to Use

Run the script from the correct subdirectory:

cd /your/path/to/repo/TestrayAutomatedTasks/liferay/teams/headless
python3 headless_testray.py

🧠 Optional: Add an Alias for Convenience and Create a Virtual Environment

To avoid typing the full path every time, you can add an alias in your .bashrc or .zshrc:

alias rta='cd /your/path/to/TestrayAutomatedTasks && \
[ -d ".venv" ] || python3 -m venv .venv && \
source .venv/bin/activate && \
pip install -r requirements.txt && \
cd liferay/teams/headless && \
python3 headless_testray.py'

After saving, apply the changes:

source ~/.bashrc
# or if using zsh
source ~/.zshrc

Now you can run the automation with:

rta

🪪 License

MIT License

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages