Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opensuse
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
Container Registry
Model registry
Operate
Environments
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
Show more breadcrumbs
Docker Build Images
opensuse
Commits
7fc070b6
Commit
7fc070b6
authored
5 years ago
by
Markus Frosch
Browse files
Options
Downloads
Patches
Plain Diff
Update image.mk for GitLab CI vars
parent
a97038e1
No related branches found
No related tags found
No related merge requests found
Pipeline
#14013
failed
4 years ago
Stage: build
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+1
-5
1 addition, 5 deletions
.gitlab-ci.yml
image.mk
+19
-20
19 additions, 20 deletions
image.mk
with
20 additions
and
25 deletions
.gitlab-ci.yml
+
1
−
5
View file @
7fc070b6
...
...
@@ -5,13 +5,9 @@ services:
stages
:
-
build
variables
:
DOCKER_REGISTRY
:
registry.icinga.com
DOCKER_IMAGE_PREFIX
:
${CI_PROJECT_PATH}/
before_script
:
-
docker info
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN
registry.icinga.com
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN
$CI_REGISTRY
-
apk -U add make
.build_job
:
&build_job
...
...
This diff is collapsed.
Click to expand it.
image.mk
+
19
−
20
View file @
7fc070b6
OS
:=
opensuse
IMAGE_PREFIX
:=
${
DOCKER_IMAGE_PREFIX
}
ifeq
($(IMAGE_PREFIX),)
IMAGE_PREFIX
:=
icinga/
$(
OS
)
/
ifndef
CI_REGISTRY
CI_REGISTRY
:=
registry.icinga.com
endif
REGISTRY
:=
${
DOCKER_REGISTRY
}
ifneq
($(REGISTRY),)
IMAGE_PREFIX
:=
$(
REGISTRY
)
/
$(
IMAGE_PREFIX
)
ifeq
($(CI_PROJECT_PATH),)
CI_PROJECT_PATH
:=
build-docker/opensuse
endif
FROM
:=
$(
shell
grep
FROM Dockerfile |
cut
-d
" "
-f2
)
VERSION
:=
$(
shell
basename
`
pwd
`
)
IMAGE
:=
$(
IMAGE_PREFIX
)$(
VERSION
)
:
$(
VARIANT
)
VARIANT
:=
x86_64
IMAGE
:=
$(
CI_PROJECT_PATH
)
/
$(
VERSION
)
ifneq
($(CI_REGISTRY),)
IMAGE
:=
$(
CI_REGISTRY
)
/
$(
IMAGE
)
endif
ifeq
($(VARIANT),x86_64)
IMAGE_EXTRA
:=
$(
IMAGE_PREFIX
)$(
VERSION
)
:latest
else
IMAGE_EXTRA
:=
IMAGE_EXTRA_TAG
:=
latest
endif
all
:
pull build
pull
:
docker pull
"
$(
IMAGE
)
"
||
true
docker pull
"
$(
IMAGE
)
:
$(
VARIANT
)
"
||
true
docker pull
"
$(
FROM
)
"
build
:
docker build
--tag
"
$(
IMAGE
)
"
.
if
neq
($(
IMAGE_EXTRA
),)
docker tag
"
$(
IMAGE
)
"
"
$(
IMAGE_EXTRA
)
"
docker build
--tag
"
$(
IMAGE
)
:
$(
VARIANT
)
"
.
if
def
IMAGE_EXTRA
_TAG
docker tag
"
$(
IMAGE
)
:
$(
VARIANT
)
"
"
$(
IMAGE
)
:
$(
IMAGE
_EXTRA
_TAG
)
"
endif
push
:
docker push
"
$(
IMAGE
)
"
if
neq
($(
IMAGE_EXTRA
),)
docker push
"
$(
IMAGE_EXTRA
)
"
docker push
"
$(
IMAGE
)
:
$(
VARIANT
)
"
if
def
IMAGE_EXTRA
_TAG
docker push
"
$(
IMAGE
)
:
$(
IMAGE
_EXTRA
_TAG
)
"
endif
clean
:
...
...
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