Skip to content

Commit b1ccbf4

Browse files
committed
wip: add version.txt to store full version for docker tag name's version part
1 parent 3de6e66 commit b1ccbf4

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

Makefile

100644100755
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ build: $(VERSIONS)
88

99
define pgrouting-version
1010
$1:
11-
docker build --pull -t $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1) $1
12-
docker build -t $(REPO_NAME)/$(IMAGE_NAME)-extra:$(shell echo $1) $1/extra
11+
docker build --pull -t $(REPO_NAME)/$(IMAGE_NAME):$(shell cat $1/version.txt) $1
12+
docker build -t $(REPO_NAME)/$(IMAGE_NAME)-extra:$(shell cat $1/version.txt) $1/extra
13+
if [ "$(shell echo $1)" != "$(shell cat $1/version.txt)" ]; then\
14+
docker tag $(REPO_NAME)/$(IMAGE_NAME):$(shell cat $1/version.txt) $(REPO_NAME)/$(IMAGE_NAME):$(shell echo $1);\
15+
docker tag $(REPO_NAME)/$(IMAGE_NAME)-extra:$(shell cat $1/version.txt) $(REPO_NAME)/$(IMAGE_NAME)-extra:$(shell echo $1);\
16+
fi
1317
endef
1418
$(foreach version,$(VERSIONS),$(eval $(call pgrouting-version,$(version))))
1519

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ $ docker-compose up
7171

7272
Run postgres database:
7373
```sh
74-
$ docker run --name pgrouting -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d pgrouting/pgrouting:15-3.3-3.4.1
74+
$ cd 15-3.3-3.4
75+
$ docker run --name pgrouting -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d pgrouting/pgrouting:$(cat version.txt)
7576
```
7677

7778
## How to build images
7879

7980
Building images:
8081
```sh
8182
$ cd 15-3.3-3.4
82-
$ docker build -t pgrouting/pgrouting:15-3.3-3.4.1 .
83+
$ docker build -t pgrouting/pgrouting:$(cat version.txt) .
8384
```
84-
(Check pgrouting full version from `./15-3.3-3.4/README.md`.)
8585

8686
### Using psql with Docker compose:
8787

update.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ for version in "${versions[@]}"; do
9595
sed -i 's/%%PG_MAJOR%%/'"$postgresVersion"'/g; s/%%POSTGIS_VERSION%%/'"$postgisVersion"'/g; s/%%PGROUTING_VERSION%%/'"$pgroutingVersion"'/g;' "$version/docker-compose.yml"
9696
mv "$version/extra/Dockerfile.template" "$version/extra/Dockerfile"
9797
sed -i 's/%%PG_MAJOR%%/'"$postgresVersion"'/g; s/%%POSTGIS_VERSION%%/'"$postgisVersion"'/g; s/%%PGROUTING_VERSION%%/'"$pgroutingVersion"'/g; s/%%PQXX_VERSION%%/'"$pqxxVersion"'/g;' "$version/extra/Dockerfile"
98+
echo "$postgresVersion-$postgisVersion-$pgroutingVersion" > "$version/version.txt"
9899
)
99100
done
100101

0 commit comments

Comments
 (0)