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

Repo reorganisation #2

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open
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
13 changes: 8 additions & 5 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Produce RapidPro flows
name: Produce Poll Wrappers
on:
workflow_dispatch

Expand All @@ -12,18 +12,21 @@ jobs:
uses: actions/checkout@v4

- name: Install Node dependencies
working-directory: technical
run: npm ci

- name: Install Python dependencies
working-directory: technical
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Run pipeline
run: python -m parenttext_pipeline.cli pull_data compile_flows
working-directory: technical
run: python -m parenttext_pipeline.cli pull_data compile_flows

- name: Publish output folder
- name: Publish poll_wrappers.json
uses: actions/upload-artifact@v3
with:
name: Output Files
path: output
name: Poll Wrappers File
path: technical/output/poll_wrappers.json
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# Example poll wrapper

This project builds RapidPro flows
This project creates the wrapper flows that should be used alongside a poll within RapidPro. There is a pipeline which takes the csv inputs in the 'poll data' folder and creates the wrappers.

## Usage

The pipeline is intended to be run by triggering a Github Actions workflow or by running commands on the command line.

## Github actions (work in progress)
## Github actions

1. Navigate to the page for the [Produce RapidPro Flows][1] action
1. Navigate to the page for the [Produce Poll Wrappers][1] action
2. Click on the _Run workflow_ button; a drop-down will appear
3. Make sure _Branch_ is set to _main_
4. Click on the green _Run workflow_ button
Expand All @@ -20,6 +21,7 @@ These steps need to be followed if you want to run the pipeline from the command

1. Clone or fork the repo to a local folder
1. Install Python >= 3.8
1. Change to the 'techical' folder where the config.json file is held and all code should be run from `cd technical`
1. Create a Python virtual environment `python -m venv .venv`
1. Activate the environment:
- Linux: `source .venv/bin/activate`
Expand All @@ -28,11 +30,9 @@ These steps need to be followed if you want to run the pipeline from the command
1. Install project Python dependencies `pip install -r requirements.txt`
1. Install latest Node and NPM Long-Term Support (LTS) versions
1. Install project Node dependencies `npm install`
1. Make sure you have a correct `credentials.json` file in the same directory as the cloned repo.

## Run


```
python -m parenttext_pipeline.cli pull_data compile_flows
```
Expand Down
5 changes: 0 additions & 5 deletions input/meta.json

This file was deleted.

2 changes: 1 addition & 1 deletion poll_data/poll_metadata.csv
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ID,poll_type,poll_name
ExampleDummyPoll,poll_type,
ExampleDummyPoll,poll_type,HIV Poll
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion config.json → technical/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"subformat": "csv",
"files_dict": {
"workspace_data": "workspace_data",
"poll_data": "poll_data"
"poll_data": "../poll_data"
}
},
"expiration_times": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions technical/input/meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pipeline_version": "1.0.1.dev11+g0f9c6d8",
"config_version": "1.0.0",
"pull_timestamp": "2024-11-07 14:31:26.485539+00:00"
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.