Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
docker-ci
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Show more breadcrumbs
UNL ITS
docker-ci
Commits
a719af80
Commit
a719af80
authored
6 years ago
by
Alan Nelson
Browse files
Options
Downloads
Plain Diff
Merge branch 'publish-to-its-registry' into 'develop'
Publish to its registry See merge request
!12
parents
aa226e62
143dc690
Branches
Branches containing commit
No related tags found
2 merge requests
!15
Merge Develop into Master
,
!12
Publish to its registry
Changes
2
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+12
-2
12 additions, 2 deletions
.gitlab-ci.yml
Makefile
+51
-18
51 additions, 18 deletions
Makefile
with
63 additions
and
20 deletions
.gitlab-ci.yml
+
12
−
2
View file @
a719af80
...
@@ -2,6 +2,7 @@ stages:
...
@@ -2,6 +2,7 @@ stages:
-
verify
-
verify
-
build
-
build
-
test
-
test
-
publish
-
security
-
security
Check Makefile
:
Check Makefile
:
...
@@ -33,7 +34,16 @@ test:
...
@@ -33,7 +34,16 @@ test:
script
:
script
:
-
docker run --rm unl-its/static-code-analysis sonar-scanner -v
-
docker run --rm unl-its/static-code-analysis sonar-scanner -v
Scan with Tenable
:
Push to Container Registry
:
after_script
:
-
rm -f /var/lib/gitlab-runner/.docker/config.json
stage
:
publish
tags
:
-
linux, dockerd
script
:
-
make publish
.Scan with Tenable
:
stage
:
security
stage
:
security
tags
:
tags
:
-
linux, dockerd
-
linux, dockerd
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
51
−
18
View file @
a719af80
...
@@ -2,6 +2,10 @@
...
@@ -2,6 +2,10 @@
# Build File for Docker Images #
# Build File for Docker Images #
######################################
######################################
# Repo
####################
REPO_ORG
=
its-registry.unl.edu/unl-its/docker-ci
# All Dockerfiles
# All Dockerfiles
####################
####################
DOCKERFILES
:=
$(
shell find ./
-name
"Dockerfile"
)
DOCKERFILES
:=
$(
shell find ./
-name
"Dockerfile"
)
...
@@ -19,7 +23,7 @@ GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD))
...
@@ -19,7 +23,7 @@ GIT_COMMIT = $(strip $(shell git rev-parse --short HEAD))
####################
####################
BUILD_ARGS
:=
--build-arg
VCS_REF
=
$(
GIT_COMMIT
)
BUILD_ARGS
:=
--build-arg
VCS_REF
=
$(
GIT_COMMIT
)
.PHONY
:
all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis mobile delete_dangling_images security
.PHONY
:
all clean test $(DOCKERFILES) clean_images $(IMAGES_TO_CLEAN) static-code-analysis mobile delete_dangling_images security
publish
all
:
php-lint php-unit-test magento2 mobile static-code-analysis
all
:
php-lint php-unit-test magento2 mobile static-code-analysis
...
@@ -34,60 +38,80 @@ static-code-analysis: static-code-analysis_latest static-code-analysys_php stati
...
@@ -34,60 +38,80 @@ static-code-analysis: static-code-analysis_latest static-code-analysys_php stati
# PHP Lint Images
# PHP Lint Images
####################
####################
php-lint_5.6
:
php-lint/5.6/Dockerfile
php-lint_5.6
:
php-lint/5.6/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/php-lint:5.6
-f
php-lint/5.6/Dockerfile php-lint
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/php-lint:5.6
-f
php-lint/5.6/Dockerfile php-lint
docker tag
${
REPO_ORG
}
/php-lint:5.6 unl-its/php-lint:5.6
php-lint_7.0
:
php-lint/7.0/Dockerfile
php-lint_7.0
:
php-lint/7.0/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/php-lint:7.0
-f
php-lint/7.0/Dockerfile php-lint
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/php-lint:7.0
-f
php-lint/7.0/Dockerfile php-lint
docker tag
${
REPO_ORG
}
/php-lint:7.0 unl-its/php-lint:7.0
php-lint_7.1
:
php-lint/7.1/Dockerfile
php-lint_7.1
:
php-lint/7.1/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/php-lint:7.1
-f
php-lint/7.1/Dockerfile php-lint
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/php-lint:7.1
-f
php-lint/7.1/Dockerfile php-lint
docker tag
${
REPO_ORG
}
/php-lint:7.1 unl-its/php-lint:7.1
php-lint_7.2
:
php-lint/7.2/Dockerfile
php-lint_7.2
:
php-lint/7.2/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/php-lint:7.2
-f
php-lint/7.2/Dockerfile php-lint
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/php-lint:7.2
-f
php-lint/7.2/Dockerfile php-lint
docker tag
${
REPO_ORG
}
/php-lint:7.2 unl-its/php-lint:7.2
php-lint_latest
:
php-lint_7.2
php-lint_latest
:
php-lint_7.2
docker tag unl-its/php-lint:7.2 unl-its/php-lint:latest
docker tag unl-its/php-lint:7.2
${
REPO_ORG
}
/php-lint:latest
docker tag
${
REPO_ORG
}
/php-lint:latest unl-its/php-lint:latest
# PHP Unit Test Images
# PHP Unit Test Images
####################
####################
php-unit-test_5.6
:
php-unit-test/5.6/Dockerfile
php-unit-test_5.6
:
php-unit-test/5.6/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/php-unit-test:5.6
-f
php-unit-test/5.6/Dockerfile php-unit-test
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/php-unit-test:5.6
-f
php-unit-test/5.6/Dockerfile php-unit-test
docker tag
${
REPO_ORG
}
/php-unit-test:5.6 unl-its/php-unit-test:5.6
php-unit-test_7.0
:
php-unit-test/7.0/Dockerfile
php-unit-test_7.0
:
php-unit-test/7.0/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/php-unit-test:7.0
-f
php-unit-test/7.0/Dockerfile php-unit-test
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/php-unit-test:7.0
-f
php-unit-test/7.0/Dockerfile php-unit-test
docker tag
${
REPO_ORG
}
/php-unit-test:7.0 unl-its/php-unit-test:7.0
php-unit-test_7.1
:
php-unit-test/7.1/Dockerfile
php-unit-test_7.1
:
php-unit-test/7.1/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/php-unit-test:7.1
-f
php-unit-test/7.1/Dockerfile php-unit-test
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/php-unit-test:7.1
-f
php-unit-test/7.1/Dockerfile php-unit-test
docker tag
${
REPO_ORG
}
/php-unit-test:7.1 unl-its/php-unit-test:7.1
php-unit-test_7.2
:
php-unit-test/7.2/Dockerfile
php-unit-test_7.2
:
php-unit-test/7.2/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/php-unit-test:7.2
-f
php-unit-test/7.2/Dockerfile php-unit-test
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/php-unit-test:7.2
-f
php-unit-test/7.2/Dockerfile php-unit-test
docker tag
${
REPO_ORG
}
/php-unit-test:7.2 unl-its/php-unit-test:7.2
php-unit-test_latest
:
php-unit-test_7.2
php-unit-test_latest
:
php-unit-test_7.2
docker tag unl-its/php-unit-test:7.2 unl-its/php-unit-test:latest
docker tag
${
REPO_ORG
}
/php-unit-test:7.2
${
REPO_ORG
}
/php-unit-test:latest
docker tag
${
REPO_ORG
}
/php-unit-test:7.2 unl-its/php-unit-test:latest
# Application Images
# Application Images
####################
####################
magento2-unit-test
:
magento2-unit-test/latest/Dockerfile
magento2-unit-test
:
magento2-unit-test/latest/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/magento2-unit-test:latest magento2-unit-test/latest
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/magento2-unit-test:latest magento2-unit-test/latest
docker tag
${
REPO_ORG
}
/magento2-unit-test:latest unl-its/magento2-unit-test:latest
magento2-xml-lint
:
magento2-unit-test magento2-xml-lint/latest/Dockerfile
magento2-xml-lint
:
magento2-unit-test magento2-xml-lint/latest/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/magento2-xml-lint:latest magento2-xml-lint/latest
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/magento2-xml-lint:latest magento2-xml-lint/latest
docker tag
${
REPO_ORG
}
/magento2-xml-lint:latest unl-its/magento2-xml-lint:latest
# Mobile Applications
# Mobile Applications
####################
####################
android-build-server
:
android-build-server/Dockerfile
android-build-server
:
android-build-server/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/android-build-server:latest android-build-server
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/android-build-server:latest android-build-server
docker tag
${
REPO_ORG
}
/android-build-server:latest unl-its/android-build-server:latest
# Sonarqube static-code-analysis
# Sonarqube static-code-analysis
# #####################
# #####################
static-code-analysis_latest
:
static-code-analysis/Dockerfile
static-code-analysis_latest
:
static-code-analysis/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/static-code-analysis:latest static-code-analysis/
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/static-code-analysis:latest static-code-analysis/
docker tag
${
REPO_ORG
}
/static-code-analysis:latest unl-its/static-code-analysis:latest
static-code-analysys_php
:
static-code-analysis/Dockerfile
static-code-analysys_php
:
static-code-analysis/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/static-code-analysis:php static-code-analysis/
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/static-code-analysis:php static-code-analysis/
docker tag
${
REPO_ORG
}
/static-code-analysis:php unl-its/static-code-analysis:php
static-code-analysys_python
:
static-code-analysis/Dockerfile
static-code-analysys_python
:
static-code-analysis/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/static-code-analysis:python static-code-analysis/
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/static-code-analysis:python static-code-analysis/
docker tag
${
REPO_ORG
}
/static-code-analysis:python unl-its/static-code-analysis:python
static-code-analysys_android
:
android-build-server static-code-analysis/android/Dockerfile
static-code-analysys_android
:
android-build-server static-code-analysis/android/Dockerfile
docker build
$(
BUILD_ARGS
)
-t
unl-its/static-code-analysis:android static-code-analysis/android/
docker build
$(
BUILD_ARGS
)
-t
${
REPO_ORG
}
/static-code-analysis:android static-code-analysis/android/
docker tag
${
REPO_ORG
}
/static-code-analysis:android unl-its/static-code-analysis:android
# Cleanup
# Cleanup
####################
####################
...
@@ -112,6 +136,13 @@ security:
...
@@ -112,6 +136,13 @@ security:
docker push registry.cloud.tenable.com/
`
echo
$$
image |
cut
-d
"/"
-f
2
`
;
\
docker push registry.cloud.tenable.com/
`
echo
$$
image |
cut
-d
"/"
-f
2
`
;
\
done
done
IMAGES_TO_PUBLISH
=
$(
shell docker images
--format
'{{.Repository
}
}:{{.Tag}}'
--filter
'dangling=false'
|
grep
$(
REPO_ORG
)
|
grep
-v
':<none>$$'
)
publish
:
@
docker login
-u
gitlab-ci-token
-p
${
CI_JOB_TOKEN
}
${
CI_REGISTRY
}
@
for
image
in
$(
IMAGES_TO_PUBLISH
);
do
\
docker push
$$
image
;
\
done
delete_dangling_images
:
delete_dangling_images
:
@
echo
"Removing dangling images"
@
echo
"Removing dangling images"
@
docker image prune
-f
@
docker image prune
-f
...
@@ -119,9 +150,11 @@ help:
...
@@ -119,9 +150,11 @@ help:
@
echo
-e
"make [all]
\n\t
# Creates all the images"
@
echo
-e
"make [all]
\n\t
# Creates all the images"
@
echo
-e
"make <TARGET>
\n\t
# Creates an specific image"
@
echo
-e
"make <TARGET>
\n\t
# Creates an specific image"
@
echo
-e
"make clean
\n\t
# Cleanup"
@
echo
-e
"make clean
\n\t
# Cleanup"
@
echo
-e
"make publish
\n\t
# Push the images to the UNL registry"
@
echo
-e
"make security
\n\t
# Send the images to Tenable. Use env variables TENABLE_IO_ACCESS_KEY and TENABLE_IO_SECRET_KEY"
@
echo
-e
"make security
\n\t
# Send the images to Tenable. Use env variables TENABLE_IO_ACCESS_KEY and TENABLE_IO_SECRET_KEY"
debug
:
debug
:
@
echo
-e
"DOCKERFILES:
\t
$(
DOCKERFILES
)
"
@
echo
-e
"DOCKERFILES:
\t
$(
DOCKERFILES
)
"
@
echo
-e
"IMAGES_TO_CLEAN:
\t
$(
IMAGES_TO_CLEAN
)
"
@
echo
-e
"IMAGES_TO_CLEAN:
\t
$(
IMAGES_TO_CLEAN
)
"
@
echo
-e
"IMAGES_TO_SCAN:
\t
$(
IMAGES_TO_SCAN
)
"
@
echo
-e
"IMAGES_TO_SCAN:
\t
$(
IMAGES_TO_SCAN
)
"
@
echo
-e
"IMAGES_TO_PUBLISH:
\t
$(
IMAGES_TO_PUBLISH
)
"
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