Skip to content

Commit 7dfac95

Browse files
committed
- [github](.github/workflows/testimage.yml) Now use GitHub Actions to test image.
- [demo](demo/Makefile) Now depend on the docker-compose-plugin. - [demo](demo/Makefile) Fix the broken `-diff` target.
1 parent 6de5017 commit 7dfac95

5 files changed

Lines changed: 47 additions & 20 deletions

File tree

.github/workflows/testimage.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Docker Image Makefile CI
2+
3+
on:
4+
push:
5+
branches: [ "master" ]
6+
pull_request:
7+
branches: [ "master" ]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- name: Build docker images
16+
run: make build-all
17+
18+
- name: Run tests
19+
shell: 'script -q -e -c "bash {0}"'
20+
run: |
21+
make test-all

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# 1.0.5
2+
3+
- [github](.github/workflows/testimage.yml) Now use GitHub Actions to test image.
4+
- [demo](demo/Makefile) Now depend on the docker-compose-plugin.
5+
- [demo](demo/Makefile) Fix the broken `-diff` target.
6+
17
# 1.0.4
28

39
- [test](test) Move all tests to separate folder.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# The `mlan/gitweb` repository
22

3-
![travis-ci test](https://img.shields.io/travis/mlan/docker-gitweb.svg?label=build&style=flat-square&logo=travis)
3+
![github action ci](https://img.shields.io/github/actions/workflow/status/mlan/docker-gitweb/testimage.yml?label=build&style=flat-square&logo=github)
44
![docker version](https://img.shields.io/docker/v/mlan/gitweb?label=version&style=flat-square&logo=docker)
55
![image size](https://img.shields.io/docker/image-size/mlan/gitweb/latest.svg?label=size&style=flat-square&logo=docker)
66
![docker pulls](https://img.shields.io/docker/pulls/mlan/gitweb.svg?label=pulls&style=flat-square&logo=docker)

demo/Makefile

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ _ip = $(shell docker inspect -f \
55
$(1) | head -n1)
66

77
SRV_NAME ?= repo-gui
8-
CNT_NAME ?= $(COMPOSE_PROJECT_NAME)_$(SRV_NAME)_1
8+
CNT_NAME ?= $(COMPOSE_PROJECT_NAME)-$(SRV_NAME)-1
99
CNT_BIND ?= 127.0.0.1:8080
1010
CNT_SHEL ?= sh
1111
TST_WEBB ?= firefox
@@ -16,25 +16,25 @@ variables:
1616
init: up
1717

1818
ps:
19-
docker-compose ps
19+
docker compose ps
2020

2121
up:
22-
docker-compose up -d
22+
docker compose up -d
2323

2424
start:
25-
docker-compose start
25+
docker compose start
2626

2727
stop:
28-
docker-compose stop
28+
docker compose stop
2929

3030
down:
31-
docker-compose down
31+
docker compose down
3232

3333
destroy:
34-
docker-compose down -v
34+
docker compose down -v
3535

3636
config:
37-
docker-compose config
37+
docker compose config
3838

3939
wait_%:
4040
sleep 10
@@ -46,10 +46,10 @@ log:
4646
docker container logs $(CNT_NAME)
4747

4848
logs:
49-
docker-compose logs --tail 10
49+
docker compose logs --tail 10
5050

5151
sh:
52-
docker-compose exec $(SRV_NAME) $(CNT_SHEL)
52+
docker compose exec $(SRV_NAME) $(CNT_SHEL)
5353

5454
diff:
5555
docker container diff $(CNT_NAME)
@@ -58,24 +58,24 @@ top:
5858
docker container top $(CNT_NAME)
5959

6060
env:
61-
docker-compose exec $(SRV_NAME) env
61+
docker compose exec $(SRV_NAME) env
6262

6363
htop: tools_install
64-
docker-compose exec $(SRV_NAME) htop
64+
docker compose exec $(SRV_NAME) htop
6565

6666
ipcs:
67-
docker-compose exec $(SRV_NAME) ipcs
67+
docker compose exec $(SRV_NAME) ipcs
6868

6969
apk_list:
70-
docker-compose exec $(SRV_NAME) /bin/sh -c 'for pkg in $$(apk info 2>/dev/null); do printf "%9s %s\n" $$(apk info -s $$pkg 2>/dev/null | sed -n "2{p;q}") $$pkg; done | sort'
70+
docker compose exec $(SRV_NAME) /bin/sh -c 'for pkg in $$(apk info 2>/dev/null); do printf "%9s %s\n" $$(apk info -s $$pkg 2>/dev/null | sed -n "2{p;q}") $$pkg; done | sort'
7171

7272
apk_add_%:
73-
docker-compose exec $(SRV_NAME) apk -q --no-cache --update add $*
73+
docker compose exec $(SRV_NAME) apk -q --no-cache --update add $*
7474

7575
tools_install:
76-
docker-compose exec $(SRV_NAME) apk --no-cache --update add \
76+
docker compose exec $(SRV_NAME) apk --no-cache --update add \
7777
nano lsof htop openldap-clients bind-tools iputils strace util-linux
7878

7979
theme_kogakure:
80-
docker-compose exec $(SRV_NAME) sh -c 'git clone https://github.com/kogakure/gitweb-theme.git /tmp/gitweb-theme && apk --no-cache --update add bash && cd /tmp/gitweb-theme && ./setup --install'
80+
docker compose exec $(SRV_NAME) sh -c 'git clone https://github.com/kogakure/gitweb-theme.git /tmp/gitweb-theme && apk --no-cache --update add bash && cd /tmp/gitweb-theme && ./setup --install'
8181

dkr.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#
77
# $(call dkr_srv_cnt,app) -> d03dda046e0b90c...
88
#
9-
dkr_srv_cnt = $(shell docker-compose ps -q $(1) | head -n1)
9+
dkr_srv_cnt = $(shell docker compose ps -q $(1) | head -n1)
1010
#
1111
# $(call dkr_cnt_ip,demo-app-1) -> 172.28.0.3
1212
#
@@ -18,7 +18,7 @@ dkr_cnt_ip = $(shell docker inspect -f \
1818
#
1919
dkr_srv_ip = $(shell docker inspect -f \
2020
'{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' \
21-
$$(docker-compose ps -q $(1)) | head -n1)
21+
$$(docker compose ps -q $(1)) | head -n1)
2222
#
2323
# $(call dkr_cnt_pid,demo-app-1) -> 9755
2424
#

0 commit comments

Comments
 (0)