Skip to content

Commit

Permalink
readme update
Browse files Browse the repository at this point in the history
  • Loading branch information
freekode committed Jan 7, 2024
1 parent c6d5805 commit ffa5a10
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
name: build

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -31,3 +33,6 @@ jobs:
- name: Build frontend
working-directory: ./ui
run: npm ci && npm run build

- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
12 changes: 10 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: release

on:
push:
branches: [ main ]
tags: [v*]
workflow_dispatch:

env:
Expand Down Expand Up @@ -42,14 +42,22 @@ jobs:
- name: Push image
run: |
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
VERSION=latest
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
docker push $IMAGE_ID:latest
jar:
Expand Down
48 changes: 42 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,51 @@ device.

## How to run

Run with `docker-compose`

### TrainingPeaks Authentication Cookie
### JAR
1. You need Java 21. The project has executable jar.
To start it first of all you need to have Java 21. You can install any JDK, links to installation instructions
[Amazon Corretto](https://docs.aws.amazon.com/corretto/latest/corretto-21-ug/downloads-list.html),
[OpenJDK](https://jdk.java.net/21/),
[Oracle JDK](https://www.oracle.com/java/technologies/downloads/)
2. Download project jar from the [latest release](https://github.com/freekode/tp2intervals/releases/latest)
3. Run the command
```shell
java -jar tp2intervals.jar
```

If you want to have ui on different port
```shell
java -Dserver.port=9090 -jar tp2intervals.jar
```

4. UI will be available on `http://localhost:8080` or on another port which you choose

### Docker
You need to have installed Docker engine, instruction how to install [you can find here.](https://docs.docker.com/engine/install/)

Next run the project with docker command:
```shell
docker run -rm --name tp2intervals -p 8080:80 ghcr.io/freekode/tp2intervals/tp2intervals:latest
```

Or with `docker-compose`
```yaml
version: '3.1'
services:
app:
image: ghcr.io/freekode/tp2intervals/tp2intervals:latest
container_name: tp2intervals
ports:
- '8080:80'
```

## TrainingPeaks Authentication Cookie

How to get authentication cookie for your user:

1. Copy only cookie `Production_tpAuth` or all of them from the browser on TrainingPeaks page
1. Copy cookie `Production_tpAuth` (key and value, smth like `Production_tpAuth=very_long_string`) from the browser on TrainingPeaks page
2. Save cookies on config page

## Known Issues
## Known IssuesATM

ATM only time duration based intervals in workouts are supported
Only time duration based intervals in workouts are supported

0 comments on commit ffa5a10

Please sign in to comment.