Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Observatoire
observatoire-scripts
Commits
6b1689ad
Commit
6b1689ad
authored
Dec 30, 2019
by
Christophe Benz
Browse files
Use kaniko to build Docker image
parent
59594e9b
Pipeline
#1646
failed with stage
in 1 minute and 43 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
6b1689ad
image
:
git.opendatafrance.net:4567/observatoire/observatoire-scripts:latest
stages
:
-
build_docker_image
-
docker
-
build
-
deploy
build_docker_image
:
stage
:
build_docker_image
image
:
docker:stable
services
:
-
docker:18.09-dind
variables
:
DOCKER_HOST
:
tcp://docker:2375
DOCKER_DRIVER
:
overlay2
IMAGE_TAG
:
$CI_REGISTRY_IMAGE:latest
before_script
:
-
docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
script
:
-
docker build -t $IMAGE_TAG .
-
docker push $IMAGE_TAG
Build Docker image
:
stage
:
docker
only
:
changes
:
-
Dockerfile
tags
:
-
docker-privileged
-
Dockerfile.ci
refs
:
-
master
variables
:
# Do not build Docker image from scheduled jobs.
# Cf https://gitlab.com/gitlab-org/gitlab/issues/27318#note_215688359
-
$CI_PIPELINE_SOURCE == "push"
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
script
:
-
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile.ci --destination $CI_REGISTRY_IMAGE:$CI_COMMIT_TAG
build
:
Download and generate data
:
stage
:
build
except
:
-
pushes
image
:
$CI_REGISTRY_IMAGE:latest
script
:
-
./download_and_prepare_data
-
./process_and_generate
...
...
@@ -37,13 +36,14 @@ build:
cache
:
paths
:
-
cache/georef.db
except
:
-
pushes
tags
:
-
observatoire
u
pdate
_o
bservatoire
_
data
_
repo
:
U
pdate
O
bservatoire
data
repo
:
stage
:
deploy
except
:
-
pushes
image
:
$CI_REGISTRY_IMAGE:latest
before_script
:
-
date
-
locale
...
...
@@ -81,12 +81,14 @@ update_observatoire_data_repo:
environment
:
name
:
production
url
:
https://git.opendatafrance.net/observatoire/observatoire-data/tree/master/sources
except
:
-
pushes
tags
:
-
observatoire
update-superset-db
:
Update Superset DB
:
stage
:
deploy
except
:
-
pushes
image
:
$CI_REGISTRY_IMAGE:latest
before_script
:
# Run ssh-agent (inside the build environment).
-
eval $(ssh-agent -s)
...
...
@@ -102,7 +104,5 @@ update-superset-db:
environment
:
name
:
production
url
:
https://lab.observatoire-opendata.fr/
except
:
-
pushes
tags
:
-
observatoire
Dockerfile
→
Dockerfile
.ci
View file @
6b1689ad
File moved
Christophe Benz
@cbenz
mentioned in issue
scdl/documentation#9 (closed)
·
Dec 30, 2019
mentioned in issue
scdl/documentation#9 (closed)
mentioned in issue scdl/documentation#9
Toggle commit list
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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