-
Notifications
You must be signed in to change notification settings - Fork 51
/
Makefile
55 lines (48 loc) · 1.75 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
all: build
help:
@echo ""
@echo "-- Help Menu"
@echo ""
@echo " 1. make build - build the gitlab-ci image"
@echo " 2. make quickstart - start gitlab-ci"
@echo " 3. make stop - stop gitlab-ci"
@echo " 4. make logs - view logs"
@echo " 5. make purge - stop and remove the container"
build:
@docker build --tag=sameersbn/gitlab-ci .
release: build
@docker build --tag=sameersbn/gitlab-ci:$(shell cat VERSION) .
quickstart:
@echo "Starting postgresql..."
@docker run --name=gitlab-ci-postgresql -d \
--env='DB_NAME=gitlab_ci_production' \
--env='DB_USER=gitlab' --env='DB_PASS=password' \
sameersbn/postgresql:latest >/dev/null
@echo "Starting redis..."
@docker run --name=gitlab-ci-redis -d \
sameersbn/redis:latest >/dev/null
@echo "Starting gitlab-ci..."
@docker run --name=gitlab-ci-demo -d \
--link=gitlab-ci-postgresql:postgresql --link=gitlab-ci-redis:redisio \
--publish=10081:80 \
--env='GITLAB_CI_PORT=10081' --env='GITLAB_URL=http://localhost:10080' \
--env='GITLAB_APP_ID=xxx' --env='GITLAB_APP_SECRET=yyy' \
sameersbn/gitlab-ci:latest >/dev/null
@echo "Please be patient. This could take a while..."
@echo "GitLab CI will be available at http://localhost:10080"
@echo "Type 'make logs' for the logs"
stop:
@echo "Stopping gitlab-ci..."
@docker stop gitlab-ci-demo >/dev/null
@echo "Stopping redis..."
@docker stop gitlab-ci-redis >/dev/null
@echo "Stopping postgresql..."
@docker stop gitlab-ci-postgresql >/dev/null
@echo "Type 'make purge' to remove stopped containers"
purge: stop
@echo "Removing stopped container..."
@docker rm -v gitlab-ci-demo >/dev/null
@docker rm -v gitlab-ci-redis >/dev/null
@docker rm -v gitlab-ci-postgresql >/dev/null
logs:
@docker logs -f gitlab-ci-demo