Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
senpy
senpy
Commits
c72094b9
Commit
c72094b9
authored
Feb 27, 2017
by
J. Fernando Sánchez
Browse files
Fixed IMAGE names in GL CI
parent
15d456d0
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
c72094b9
...
...
@@ -10,8 +10,7 @@ variables:
stages
:
-
test
-
images
-
release
-
push
-
clean
.test
:
&test_definition
...
...
@@ -31,7 +30,7 @@ test-2.7:
.image
:
&image_definition
stage
:
images
stage
:
push
before_script
:
-
docker login -u gitlab-ci-token -p $CI_BUILD_TOKEN $CI_REGISTRY
script
:
...
...
@@ -41,22 +40,22 @@ test-2.7:
-
master
-
triggers
image
-3.5
:
push
-3.5
:
<<
:
*image_definition
variables
:
PYTHON_VERSION
:
"
3.5"
VERSION
:
$CI_BUILD_TAG
IMAGENAME
:
$CI_REGISTRY_IMAGE
image
-2.7
:
push
-2.7
:
<<
:
*image_definition
variables
:
PYTHON_VERSION
:
"
2.7"
VERSION
:
$CI_BUILD_TAG
IMAGENAME
:
$CI_REGISTRY_IMAGE
image
-latest
:
stage
:
release
push
-latest
:
stage
:
push
variables
:
IMAGENAME
:
$CI_REGISTRY_IMAGE
before_script
:
...
...
Makefile
View file @
c72094b9
...
...
@@ -4,7 +4,8 @@ NAME=senpy
REPO
=
gsiupm
VERSION
=
$(
shell
git describe
--tags
--dirty
2>/dev/null
)
TARNAME
=
$(NAME)
-
$(VERSION)
.tar.gz
IMAGENAME
=
$(REPO)
/
$(NAME)
:
$(VERSION)
IMAGENAME
=
$(REPO)
/
$(NAME)
IMAGEWTAG
=
$(IMAGENAME)
:
$(VERSION)
action
=
"test-
${PYMAIN}
"
all
:
build run
...
...
@@ -35,14 +36,14 @@ quick_build: $(addprefix build-, $(PYMAIN))
build
:
$(addprefix build-
,
$(PYVERSIONS))
build-%
:
version Dockerfile-%
docker build
-t
'
$(IMAGE
NAME
)
-python$*'
-f
Dockerfile-
$*
.
;
docker build
-t
'
$(IMAGE
WTAG
)
-python$*'
-f
Dockerfile-
$*
.
;
quick_test
:
$(addprefix test-
,
$(PYMAIN))
dev-%
:
@
docker start
$(NAME)
-dev
||
(
\
$(MAKE)
build-
$*
;
\
docker run
-d
-w
/usr/src/app/
-v
$$
PWD:/usr/src/app
--entrypoint
=
/bin/bash
-p
5000:5000
-ti
--name
$(NAME)
-dev
'
$(IMAGE
NAME
)
-python$*'
;
\
docker run
-d
-w
/usr/src/app/
-v
$$
PWD:/usr/src/app
--entrypoint
=
/bin/bash
-p
5000:5000
-ti
--name
$(NAME)
-dev
'
$(IMAGE
WTAG
)
-python$*'
;
\
)
\
docker
exec
-ti
$(NAME)
-dev
bash
...
...
@@ -52,7 +53,7 @@ dev: dev-$(PYMAIN)
test-all
:
$(addprefix test-
,
$(PYVERSIONS))
test-%
:
build-%
docker run
--rm
--entrypoint
/usr/local/bin/python
-w
/usr/src/app
$(IMAGE
NAME
)
-python
$*
setup.py
test
docker run
--rm
--entrypoint
/usr/local/bin/python
-w
/usr/src/app
$(IMAGE
WTAG
)
-python
$*
setup.py
test
test
:
test-$(PYMAIN)
...
...
@@ -66,15 +67,6 @@ pip_test-%: sdist
pip_test
:
$(addprefix pip_test-
,
$(PYVERSIONS))
upload-%
:
test-%
docker push
'
$(IMAGENAME)
-python$*'
upload
:
test $(addprefix upload-
,
$(PYVERSIONS))
docker tag
'
$(IMAGENAME)
-python
$(PYMAIN)
'
'
$(IMAGENAME)
'
docker tag
'
$(IMAGENAME)
-python
$(PYMAIN)
'
'
$(REPO)
/
$(NAME)
'
docker push
'
$(IMAGENAME)
'
docker push
'
$(REPO)
/
$(NAME)
'
clean
:
@
docker ps
-a
|
awk
'/
$(REPO)
\/
$(NAME)
/{ split($$2, vers, "-"); if(vers[0] != "
${VERSION}
"){ print $$1;}}'
| xargs docker
rm
-v
2>/dev/null||
true
@
docker images |
awk
'/
$(REPO)
\/
$(NAME)
/{ split($$2, vers, "-"); if(vers[0] != "
${VERSION}
"){ print $$1":"$$2;}}'
| xargs docker rmi 2>/dev/null||
true
...
...
@@ -96,16 +88,18 @@ pip_upload:
pip_test
:
$(addprefix pip_test-
,
$(PYVERSIONS))
run-%
:
build-%
docker run
--rm
-p
5000:5000
-ti
'
$(IMAGE
NAME
)
-python
$(PYMAIN)
'
--default-plugins
docker run
--rm
-p
5000:5000
-ti
'
$(IMAGE
WTAG
)
-python
$(PYMAIN)
'
--default-plugins
run
:
run-$(PYMAIN)
push-latest
:
build-$(PYMAIN)
docker tag
$(IMAGENAME)
-python
$(PYMAIN)
$(IMAGENAME)
docker push
$(IMAGENAME)
docker tag
'
$(IMAGEWTAG)
-python
$(PYMAIN)
'
'
$(IMAGEWTAG)
'
docker tag
'
$(IMAGEWTAG)
-python
$(PYMAIN)
'
'
$(IMAGENAME)
'
docker push
'
$(IMAGENAME)
'
docker push
'
$(IMAGEWTAG)
'
push-%
:
build-%
docker push
$(IMAGE
NAME
)
-python
$*
docker push
$(IMAGE
WTAG
)
-python
$*
ci
:
gitlab-runner
exec
docker
--docker-volumes
/var/run/docker.sock:/var/run/docker.sock
--env
CI_PROJECT_NAME
=
$(NAME)
${action}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment