From 6ec9f995dfefed312c81fd980e23e49ca28adab3 Mon Sep 17 00:00:00 2001 From: Cameron Garnham Date: Thu, 7 Sep 2023 14:49:01 +0200 Subject: [PATCH] dev: vairous fixes --- .github/workflows/container.yaml | 15 +++++++++------ docs/containers.md | 6 ++++-- share/container/message | 2 ++ 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/container.yaml b/.github/workflows/container.yaml index da38db71f..354544a63 100644 --- a/.github/workflows/container.yaml +++ b/.github/workflows/container.yaml @@ -65,11 +65,14 @@ jobs: - id: check name: Check Context run: | - if [[ "${{ github.event_name }}" == "push" && ( "${{ github.ref }}" == "refs/heads/main" || "${{ github.ref }}" == "refs/heads/develop" || "${{ github.ref }}" == "refs/heads/docker" ) ]] || - [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" =~ ^refs/tags/v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - if [[ "${{ github.repository }}" == "torrust/torrust-tracker" ]]; then - echo "Context is torrust/torrust-tracker, and push is: main, develop, docker, or a tag of v*.*.*" - echo "continue=true" >> $GITHUB_OUTPUT + if [[ "${{ github.repository }}" == "torrust/torrust-tracker" ]]; then + if [[ "${{ github.event_name }}" == "push" ]]; then + if [[ ( "${{ github.ref }}" == "refs/heads/main" || "${{ github.ref }}" == "refs/heads/develop" ]] || + "${{ github.ref }}" =~ ^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ ]]; then + + echo "Context is torrust/torrust-tracker, and push is: main, develop, docker, or a tag with a semantic version" + echo "continue=true" >> $GITHUB_OUTPUT + fi fi fi @@ -126,7 +129,7 @@ jobs: uses: docker/build-push-action@v4 with: file: ./Containerfile - push: ${{ github.event_name != 'pull_request' }} + push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} cache-from: type=gha diff --git a/docs/containers.md b/docs/containers.md index b9aa05a7a..dcf281e6e 100644 --- a/docs/containers.md +++ b/docs/containers.md @@ -196,7 +196,7 @@ mkdir -p ./storage/tracker/lib/ ./storage/tracker/log/ ./storage/tracker/etc/ ## Run Torrust Tracker Container Image docker run -it \ --env TORRUST_TRACKER_API_ADMIN_TOKEN="MySecretToken" \ - --env USER_ID"$(id -u)" \ + --env USER_ID="$(id -u)" \ --publish 0.0.0.0:7070:7070/tcp \ --publish 0.0.0.0:6969:6969/udp \ --publish 0.0.0.0:1212:1212/tcp \ @@ -218,7 +218,7 @@ mkdir -p ./storage/tracker/lib/ ./storage/tracker/log/ ./storage/tracker/etc/ ## Run Torrust Tracker Container Image podman run -it \ --env TORRUST_TRACKER_API_ADMIN_TOKEN="MySecretToken" \ - --env USER_ID"$(id -u)" \ + --env USER_ID="$(id -u)" \ --publish 0.0.0.0:7070:7070/tcp \ --publish 0.0.0.0:6969:6969/udp \ --publish 0.0.0.0:1212:1212/tcp \ @@ -367,6 +367,7 @@ And finally, you can run the container: ```s docker run \ + --env USER_ID="$(id -u)" \ --publish 6969:6969/udp \ --publish 7070:7070/tcp \ --publish 1212:1212/tcp \ @@ -381,6 +382,7 @@ Detach from container logs when the container starts. By default, the command li ```s docker run \ --detach + --env USER_ID="$(id -u)" \ --publish 6969:6969/udp \ --publish 7070:7070/tcp \ --publish 1212:1212/tcp \latest diff --git a/share/container/message b/share/container/message index cd88b44ae..6bfd6bfb8 100644 --- a/share/container/message +++ b/share/container/message @@ -1,2 +1,4 @@ +Lovely welcome to our Torrust Tracker Container! + run 'torrust-tracker' to start tracker