Skip to content

Commit 6f0d06d

Browse files
authored
Merge pull request kocolosk#2 from natarajaya/master
[GPII-3624]: Makefile, GitLab config, updated README
2 parents aa5bb21 + c0b8340 commit 6f0d06d

File tree

3 files changed

+71
-0
lines changed

3 files changed

+71
-0
lines changed

.gitlab-ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
stages:
2+
- build
3+
4+
build-push-master:
5+
stage: build
6+
script:
7+
- make build
8+
- make push
9+
only:
10+
refs:
11+
- master
12+
13+
build-push-tag:
14+
stage: build
15+
script:
16+
- make build-tag
17+
- make push-tag
18+
only:
19+
- tags

Makefile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
.PHONY: help build build-tag push
2+
.DEFAULT_GOAL:= help
3+
.ONESHELL:
4+
5+
DOCKER_IMAGE = gpii/couchdb-statefulset-assembler
6+
7+
help: ## Prints list of tasks
8+
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z0-9_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' Makefile
9+
10+
build: ## Build image as latest
11+
docker build -t "${DOCKER_IMAGE}:latest" ./
12+
13+
build-tag: ## Build image as tag (use CI_COMMIT_TAG env var)
14+
@CI_COMMIT_TAG="$${CI_COMMIT_TAG:?Required variable not set}"
15+
docker build -t "${DOCKER_IMAGE}:${CI_COMMIT_TAG}" ./
16+
17+
push: ## Push image - latest
18+
docker push "${DOCKER_IMAGE}:latest"
19+
20+
push-tag: ## Push image - tag
21+
@CI_COMMIT_TAG="$${CI_COMMIT_TAG:?Required variable not set}"
22+
docker push "${DOCKER_IMAGE}:${CI_COMMIT_TAG}"

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,33 @@ cluster is automically joined up.
1111
If the deployment is scaled *up* after the initial creation those new Pods will
1212
be automatically added. Scaling *down* does not automatically remove the Pods
1313
from the membership database at this time.
14+
15+
## Building
16+
17+
### Master
18+
19+
On push/merge to master, CI will automatically build and push
20+
`gpii/couchdb-statefulset-assembler:latest` image.
21+
22+
### Tags
23+
24+
Create and push git tag and CI will build and publish corresponding `gpii/couchdb-statefulset-assembler:${git_tag}` docker image.
25+
26+
#### Tag format
27+
28+
Tags should follow actual couchdb-statefulset-assembler version, suffixed by
29+
`-gpii.${gpii_build_number}`, where `gpii_build_number` is monotonically
30+
increasing number denoting Docker image build number, starting from `0`
31+
for each upstream version.
32+
33+
Example:
34+
```
35+
0.0.3-gpii.0
36+
0.0.3-gpii.1
37+
...
38+
0.0.4-gpii.0
39+
```
40+
41+
### Manually
42+
43+
Run `make` to see all available steps.

0 commit comments

Comments
 (0)