Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cgit-docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
shore
cgit-docker
Commits
a67ad417
Commit
a67ad417
authored
4 years ago
by
nimrod
Browse files
Options
Downloads
Patches
Plain Diff
Updates.
What I have in production and GitLab CI/CD.
parent
7dacb31f
No related branches found
No related tags found
No related merge requests found
Pipeline
#73
passed
4 years ago
Stage: test
Stage: build
Stage: run
Changes
4
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
.gitlab-ci.yml
+46
-0
46 additions, 0 deletions
.gitlab-ci.yml
.pre-commit-config.yaml
+10
-4
10 additions, 4 deletions
.pre-commit-config.yaml
Dockerfile
+3
-2
3 additions, 2 deletions
Dockerfile
docker-compose.yml
+6
-11
6 additions, 11 deletions
docker-compose.yml
with
65 additions
and
17 deletions
.gitlab-ci.yml
0 → 100644
+
46
−
0
View file @
a67ad417
---
image
:
adarnimrod/ci-images:docker
stages
:
-
test
-
build
-
run
pre-commit
:
stage
:
test
image
:
adarnimrod/ci-images:pre-commit
variables
:
XDG_CACHE_HOME
:
"
$CI_PROJECT_DIR/.cache"
# Disabled until https://github.com/pre-commit/pre-commit/issues/1387 is
# resolved.
SKIP
:
"
hadolint,docker-compose"
script
:
-
pre-commit run --all-files
cache
:
paths
:
-
.cache/
build
:
stage
:
build
tags
:
[
"
host01.shore.co.il"
]
variables
:
COMPOSE_DOCKER_CLI_BUILD
:
"
1"
DOCKER_BUILDKIT
:
"
1"
script
:
-
docker-compose build --no-cache --pull
-
docker-compose pull --quiet
run
:
stage
:
run
tags
:
[
"
host01.shore.co.il"
]
when
:
manual
script
:
-
docker-compose up --detach --remove-orphans
# yamllint disable rule:line-length
-
|
for i in $(seq 12)
do
docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$' || break
sleep 10
done
! docker container inspect --format '{{ .State.Health.Status }}' $(docker-compose ps -q) | grep -v '^healthy$'
This diff is collapsed.
Click to expand it.
.pre-commit-config.yaml
+
10
−
4
View file @
a67ad417
...
@@ -2,14 +2,15 @@
...
@@ -2,14 +2,15 @@
---
---
repos
:
repos
:
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
-
repo
:
https://github.com/pre-commit/pre-commit-hooks
rev
:
v2.
4
.0
rev
:
v2.
3
.0
hooks
:
hooks
:
-
id
:
check-added-large-files
-
id
:
check-added-large-files
-
id
:
check-merge-conflict
-
id
:
check-merge-conflict
-
id
:
detect-private-key
-
id
:
trailing-whitespace
-
id
:
trailing-whitespace
exclude
:
\.diff$
exclude
:
\.diff$
-
repo
:
https://github.com/adrienverge/yamllint
-
repo
:
https://github.com/adrienverge/yamllint
rev
:
v1.1
9
.0
rev
:
v1.1
7
.0
hooks
:
hooks
:
-
id
:
yamllint
-
id
:
yamllint
-
repo
:
https://github.com/amperser/proselint/
-
repo
:
https://github.com/amperser/proselint/
...
@@ -17,9 +18,14 @@ repos:
...
@@ -17,9 +18,14 @@ repos:
hooks
:
hooks
:
-
id
:
proselint
-
id
:
proselint
types
:
[
plain-text
]
types
:
[
plain-text
]
exclude
:
LICENSE
|requirements
exclude
:
LICENSE
-
repo
:
https://
www
.shore.co.il/
git
/docker-pre-commit
-
repo
:
https://
git
.shore.co.il/
nimrod
/docker-pre-commit
.git/
rev
:
v0.3.0
rev
:
v0.3.0
hooks
:
hooks
:
-
id
:
hadolint
-
id
:
hadolint
-
id
:
docker-compose
-
id
:
docker-compose
-
repo
:
https://github.com/Yelp/detect-secrets
rev
:
v0.13.0
hooks
:
-
id
:
detect-secrets
exclude
:
\.diff$
This diff is collapsed.
Click to expand it.
Dockerfile
+
3
−
2
View file @
a67ad417
...
@@ -10,6 +10,7 @@ RUN apt-get update && \
...
@@ -10,6 +10,7 @@ RUN apt-get update && \
python3-docutils
\
python3-docutils
\
python3-markdown
\
python3-markdown
\
python3-pygments
\
python3-pygments
\
wget
\
&&
\
&&
\
setcap
CAP_NET_BIND_SERVICE
=
+ep /usr/sbin/apache2
&&
\
setcap
CAP_NET_BIND_SERVICE
=
+ep /usr/sbin/apache2
&&
\
a2enmod cgid
&&
\
a2enmod cgid
&&
\
...
@@ -31,9 +32,9 @@ ENV APACHE_RUN_DIR=/run/apache2 \
...
@@ -31,9 +32,9 @@ ENV APACHE_RUN_DIR=/run/apache2 \
APACHE_PID_FILE=/run/apache2/apache2.pid
APACHE_PID_FILE=/run/apache2/apache2.pid
RUN
patch
--strip
0
--verbose
--directory
/etc/apache2
--input
/root/patch.diff
&&
\
RUN
patch
--strip
0
--verbose
--directory
/etc/apache2
--input
/root/patch.diff
&&
\
apache2
-t
apache2
-t
EXPOSE
80
80
EXPOSE
80
CMD
[ "apache2", "-DFOREGROUND" ]
CMD
[ "apache2", "-DFOREGROUND" ]
VOLUME
["/srv/git"]
VOLUME
["/srv/git"]
USER
"www-data"
USER
"www-data"
WORKDIR
/var/www
WORKDIR
/var/www
HEALTHCHECK
CMD wget --spider --quiet http://localhost:80
80
/cgit/ --user-agent 'Healthcheck' || exit 1
HEALTHCHECK
CMD wget --spider --quiet http://localhost:80/cgit/ --user-agent 'Healthcheck' || exit 1
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
6
−
11
View file @
a67ad417
...
@@ -4,19 +4,14 @@ version: '3.5'
...
@@ -4,19 +4,14 @@ version: '3.5'
services
:
services
:
cgit
:
cgit
:
build
:
build
:
# cache_from:
# - adarnimrod/cgit
context
:
.
context
:
.
cache_from
:
# image: adarnimrod/cgit
-
adarnimrod/cgit
restart
:
always
image
:
adarnimrod/cgit
ports
:
-
80:80
volumes
:
volumes
:
-
git:/srv/git:ro
-
/var/lib/git:/srv/git:ro
-
/etc/passwd:/etc/passwd:ro
volumes
:
git
:
labels
:
snapshot
:
'
true'
networks
:
networks
:
default
:
default
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment