Skip to content

Commit

Permalink
Updated image name
Browse files Browse the repository at this point in the history
Due to moving ownership, replaced every occurence of `Tbaile/phonehome`
to `NethServer/phonehome-server`, added parametrization where needed.
  • Loading branch information
Tbaile committed Nov 16, 2022
1 parent eb31c57 commit 641db81
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 28 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ on:
required: true
registry_password:
required: true
env:
REGISTRY: ghcr.io
REPOSITORY: tbaile/phonehome
TAG: ${{ github.ref_name }}
jobs:
build-image:
name: Build ${{ matrix.image }} image and push
Expand All @@ -34,7 +30,7 @@ jobs:
with:
bake-target: ${{ matrix.image }}-release
images: |
${{ env.REGISTRY }}/${{ env.REPOSITORY }}-${{ matrix.image }}
${{ env.REGISTRY }}/${{ github.repository }}-${{ matrix.image }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
Expand All @@ -49,7 +45,13 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set REPOSITORY environment variable
run: |
echo "REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- uses: docker/bake-action@v2.3.0
env:
TAG: ${{ github.ref_name }}
with:
targets: ${{ matrix.image }}-release
files: |
Expand All @@ -72,7 +74,7 @@ jobs:
with:
bake-target: ns8-release
images: |
${{ env.REGISTRY }}/${{ env.REPOSITORY }}
${{ env.REGISTRY }}/${{ github.repository }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=ref,event=branch
Expand All @@ -87,12 +89,18 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

# TODO: when rolling releases are a thing, remember to update the PHONEHOME_TAG
- name: Set REPOSITORY environment variable
run: |
echo "REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- name: Build image with buildah
env:
TAGS: ${{ steps.meta.outputs.tags }}
LABELS: ${{ steps.meta.outputs.labels }}
ARGS: PHONEHOME_TAG=${{ github.ref_name }}
ARGS: |
PHONEHOME_TAG=${{ github.ref_name }}
PHONEHOME_SERVER_APP=$REPOSITORY-app
PHONEHOME_SERVER_WEB=$REPOSITORY-web
working-directory: deploy/ns8
run: |
./build-images.sh
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ name: Testing
on:
pull_request:
workflow_call:
env:
REPOSITORY: tbaile/phonehome
TAG: ${{ github.ref_name }}
jobs:
test-app-image:
name: Test app image
Expand All @@ -16,7 +13,13 @@ jobs:
- name: Create new buildx builder
uses: docker/setup-buildx-action@v2

- name: Set REPOSITORY environment variable
run: |
echo "REPOSITORY=${GITHUB_REPOSITORY,,}" >> $GITHUB_ENV
- uses: docker/bake-action@v2.3.0
env:
TAG: ${{ github.ref_name }}
with:
files: |
./docker-bake.hcl
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# PhoneHome
Complete rewrite from ground-up of [NethServer/nethserver-phonehome](https://github.com/NethServer/nethserver-phonehome), powered by [Laravel](https://laravel.com/).

[![Development Pipeline](https://github.com/Tbaile/phonehome/actions/workflows/development.yml/badge.svg?event=push)](https://github.com/Tbaile/phonehome/actions/workflows/development.yml)
[![Development Pipeline](https://github.com/NethServer/phonehome-server/actions/workflows/development.yml/badge.svg?event=push)](https://github.com/NethServer/phonehome-server/actions/workflows/development.yml)

- [PhoneHome](#phonehome)
- [Development](#development)
Expand Down Expand Up @@ -141,7 +141,7 @@ docker buildx bake web-develop
### Environment variables
There are few variables that handle the tags of the generated images:
- `REGISTRY`: the registry that the image will be pushed to, will be appended before the `REPOSITORY` on every tag. Defaults to 'ghcr.io';
- `REPOSITORY`: the name of the image, defaults to 'tbaile/phonehome';
- `REPOSITORY`: the name of the image, defaults to 'nethserver/phonehome-server';
- `TAG`: tag of the produced image, defaults to 'latest'.

### Release process
Expand Down
8 changes: 4 additions & 4 deletions deploy/docker-compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ services:
MYSQL_USER: phonehome
MYSQL_PASSWORD: phonehome
setup:
image: ghcr.io/tbaile/phonehome-app:${TAG:-latest}
image: ghcr.io/nethserver/phonehome-server-app:${TAG:-latest}
depends_on:
- database
- redis
Expand All @@ -32,7 +32,7 @@ services:
environment:
ROLE: "setup"
app:
image: ghcr.io/tbaile/phonehome-app:${TAG:-latest}
image: ghcr.io/nethserver/phonehome-server-app:${TAG:-latest}
healthcheck:
test: [ "CMD", "php-fpm-healthcheck" ]
depends_on:
Expand All @@ -45,7 +45,7 @@ services:
- source: env_file
target: /var/www/html/.env
scheduler:
image: ghcr.io/tbaile/phonehome-app:${TAG:-latest}
image: ghcr.io/nethserver/phonehome-server-app:${TAG:-latest}
depends_on:
setup:
condition: service_completed_successfully
Expand All @@ -59,7 +59,7 @@ services:
environment:
ROLE: "scheduler"
web:
image: ghcr.io/tbaile/phonehome-web:${TAG:-latest}
image: ghcr.io/nethserver/phonehome-server-web:${TAG:-latest}
healthcheck:
test: [ "CMD", "curl", "--fail", "--silent", "--output", "/dev/null", "http://localhost" ]
volumes:
Expand Down
6 changes: 4 additions & 2 deletions deploy/ns8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@ LABEL org.nethserver.authorizations="traefik@node:routeadm"
LABEL org.nethserver.tcp-ports-demand="1"
LABEL org.nethserver.rootfull="0"
ARG PHONEHOME_TAG=latest
ARG PHONEHOME_SERVER_APP=ghcr.io/nethserver/phonehome-server-app
ARG PHONEHOME_SERVER_WEB=ghcr.io/nethserver/phonehome-server-web
LABEL org.nethserver.images="docker.io/mariadb:10.6.11 \
docker.io/redis:6.2.7-alpine \
ghcr.io/tbaile/phonehome-app:$PHONEHOME_TAG \
ghcr.io/tbaile/phonehome-web:$PHONEHOME_TAG"
$PHONEHOME_SERVER_APP:$PHONEHOME_TAG \
$PHONEHOME_SERVER_WEB:$PHONEHOME_TAG"
ENTRYPOINT ["/"]
8 changes: 4 additions & 4 deletions deploy/ns8/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ Configuration and files to generate a NethServer 8 compliant module.

Instantiate the module with:
```bash
add-module ghcr.io/tbaile/phonehome:latest
add-module ghcr.io/nethserver/phonehome-server:latest
```

The output of the command will return the instance name.
Output example:
```
{"module_id": "phonehome1", "image_name": "phonehome", "image_url": "ghcr.io/tbaile/phonehome:latest"}
{"module_id": "phonehome1", "image_name": "phonehome", "image_url": "ghcr.io/nethserver/phonehome-server:latest"}
```

## Configure
Expand All @@ -26,7 +26,7 @@ Let's assume that the phonehome instance is named `phonehome1`.

Launch `configure-module`, by setting the following parameters:
- `hostname`: Hostname where phonehome will be reachable from, for example `phonehome.nethserver.org`;
- `geoip_token`: Valid token from MadMax, for more info [see the documentation](https://github.com/Tbaile/phonehome#geoip2);
- `geoip_token`: Valid token from MadMax, for more info [see the documentation](https://github.com/NethServer/phonehome-server#geoip2);
- `http_to_https`: Sets up Traefik to redirect all the requests from http to https, can be `true` or `false`;
- `lets_encrypt`: Boolean value that tells traefik to generate the certificates for the `hostname`.

Expand All @@ -52,7 +52,7 @@ remove-module --no-preserve phonehome1
Test the module using the `test-module.sh` script:
```bash
./test-module.sh <NODE_ADDR> ghcr.io/tbaile/phonehome:latest
./test-module.sh <NODE_ADDR> ghcr.io/nethserver/phonehome-server:latest
```
The tests are made using [Robot Framework](https://robotframework.org/)
2 changes: 1 addition & 1 deletion deploy/ns8/build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
set -e

# Set up all variables needed to build the arguments
tags=${TAGS:-ghcr.io/tbaile/phonehome:latest}
tags=${TAGS:-ghcr.io/nethserver/phonehome-server:latest}
labels=${LABELS:-}
args=${ARGS:-}

Expand Down
6 changes: 3 additions & 3 deletions deploy/ns8/ui/public/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
}
],
"docs": {
"documentation_url": "https://github.com/Tbaile/phonehome",
"documentation_url": "https://github.com/NethServer/phonehome-server",
"bug_url": "https://github.com/NethServer/dev",
"code_url": "https://github.com/Tbaile/phonehome"
"code_url": "https://github.com/NethServer/phonehome-server"
},
"source": "ghcr.io/tbaile/phonehome"
"source": "ghcr.io/nethserver/phonehome-server"
}
2 changes: 1 addition & 1 deletion docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ variable "REGISTRY" {
}

variable "REPOSITORY" {
default = "tbaile/phonehome"
default = "nethserver/phonehome-server"
}

variable "TAG" {
Expand Down

0 comments on commit 641db81

Please sign in to comment.