Skip to content

Commit

Permalink
[ci/docs] Publish images to Docker Hub and README update #244
Browse files Browse the repository at this point in the history
Closes #244
  • Loading branch information
pandafy authored Jul 7, 2022
1 parent 179a956 commit f722a5a
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 16 deletions.
34 changes: 24 additions & 10 deletions .github/workflows/branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ jobs:
- name: Git Checkout
uses: actions/checkout@v2

# echo "$DOCKER_TOKEN" | docker login registry.gitlab.com --username "$DOCKER_USER" --password-stdin
- name: Login to GitLab
uses: docker/login-action@v1
with:
registry: registry.gitlab.com
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}

- name: Install Testing Requirements
run: sudo pip install -r requirements-test.txt

Expand All @@ -32,7 +24,29 @@ jobs:
run: |
echo "127.0.0.1 dashboard.openwisp.org api.openwisp.org" | sudo tee -a /etc/hosts
- name: Build & Publish
run: make publish TAG=edge || (docker-compose logs && exit 1)
# the following action is equivalent to
# echo "$DOCKER_HUB_TOKEN" | docker login --username "$DOCKER_HUB_USER" --password-stdin
- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}

- name: Build & Publish to Docker Hub
run: |
make publish TAG=edge USER=registry.docker.com/openwisp || (docker-compose logs && exit 1)
env:
SELENIUM_HEADLESS: 1

- name: Login to GitLab Container Registry
uses: docker/login-action@v1
with:
registry: registry.gitlab.com
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_TOKEN }}

# Skip image builds and tests since they were done when
# publishing to Docker Hub
- name: Build & Publish to GitLab Container Registry
run: |
make publish TAG=edge SKIP_BUILD=true SKIP_TESTS=true
11 changes: 10 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,16 @@ stop:
# Publish
USER = registry.gitlab.com/openwisp/docker-openwisp
TAG = latest
publish: compose-build runtests nfs-build
SKIP_BUILD = false
SKIP_TESTS = false

publish:
if [[ "$(SKIP_BUILD)" == "false" ]]; then \
make compose-build nfs-build; \
fi
if [[ "$(SKIP_TESTS)" == "false" ]]; then \
make runtests; \
fi
for image in 'openwisp-base' 'openwisp-nfs' 'openwisp-api' 'openwisp-dashboard' \
'openwisp-freeradius' 'openwisp-nginx' 'openwisp-openvpn' 'openwisp-postfix' \
'openwisp-websocket' ; do \
Expand Down
35 changes: 30 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ The sample files for deployment on kubernetes are available in the `deploy/examp
- [Docker-OpenWISP](#docker-openwisp)
- [Table of contents](#table-of-contents)
- [Images Available](#images-available)
- [Image Tags](#image-tags)
- [Architecture](#architecture)
- [Deployment](#deployment)
- [Quick Setup](#quick-setup)
Expand All @@ -30,6 +31,7 @@ The sample files for deployment on kubernetes are available in the `deploy/examp
- [Development](#development)
- [Workbench setup](#workbench-setup)
- [Runtests](#runtests)
- [Run Quality Assurance Checks](#run-quality-assurance-checks)
- [Usage](#usage)
- [Makefile Options](#makefile-options)

Expand All @@ -45,8 +47,31 @@ The sample files for deployment on kubernetes are available in the `deploy/examp

\* Roughly the same features would be available but it's not an exact one-to-one mapping.

The images are hosted on [Docker Hub](https://hub.docker.com/u/openwisp)
and [GitLab Container Registry](https://gitlab.com/openwisp/docker-openwisp/container_registry).

### Image Tags

All images are tagged using the following convention:

| Tag | Software Version |
| ------ |---------------------------------------------- |
| latest | Images built on the **latest git tag** |
| edge | Images built on the **current master branch** |

## Architecture

A typical OpenWISP installation is made of multiple components
(e.g. application servers, background workers, web servers,
database, messaging queue, VPN server, etc. ) that have different
scaling requirements.

The aim of Docker OpenWISP is to allow deploying
OpenWISP in cloud based environments which
allow potentially infinite horizontal scaling.
That is the reason for which there are different
docker images shipped in this repository.

![Architecture](docs/images/architecture.jpg)

- **openwisp-dashboard**: Your OpenWISP device administration dashboard.
Expand Down Expand Up @@ -257,15 +282,15 @@ You can run tests either with `geckodriver` (firefox) or `chromedriver` (chromiu

- Setup chromedriver

1. Install chromium:
1. Install chromium:

```bash
# On debian
# On debian
sudo apt --yes install chromium
# On ubuntu
# On ubuntu
sudo apt --yes install chromium-browser
```

3. Check version: `chromium --version`
4. Install Driver for your version: [`https://chromedriver.chromium.org/downloads`](https://chromedriver.chromium.org/downloads)
5. Extract chromedriver to one of directories from your `$PATH`. (example: `/usr/bin/`)
Expand Down

0 comments on commit f722a5a

Please sign in to comment.