Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
entsoe-fetcher
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Isaac AFAMBO
entsoe-fetcher
Commits
ccfad965
Commit
ccfad965
authored
4 years ago
by
Pierre Dittgen
Browse files
Options
Downloads
Patches
Plain Diff
Update .gitlab-ci.yml for k8s
parent
4cff543e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+38
-22
38 additions, 22 deletions
.gitlab-ci.yml
with
38 additions
and
22 deletions
.gitlab-ci.yml
+
38
−
22
View file @
ccfad965
...
...
@@ -5,28 +5,21 @@ variables:
JOB
:
convert
PROVIDER_SLUG
:
entsoe
before_script
:
# Display info about environment.
-
date
-
locale
-
echo "Running job ${JOB} for provider ${PROVIDER_SLUG}"
# Install fetcher dependencies.
-
'
[
-f
requirements.txt
]
&&
pip3
install
--requirement
requirements.txt'
# Run ssh-agent (inside the build environment).
-
eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store.
-
ssh-add <(echo "$SSH_PRIVATE_KEY")
# Add the SSH keys of remote Git servers, to disable host key checking questions.
-
mkdir -p ~/.ssh
-
ssh-keyscan -t rsa git.nomics.world >> ~/.ssh/known_hosts
-
git config --global push.default simple
-
git config --global user.email "${PROVIDER_SLUG}-fetcher@db.nomics.world"
-
git config --global user.name "${PROVIDER_SLUG} fetcher"
Build Docker image
:
stage
:
build
rules
:
-
if
:
$CI_PIPELINE_SOURCE == "push" && $CI_COMMIT_BRANCH == "master"
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
"
"
]
script
:
-
>
if [ -f $CI_PROJECT_DIR/Dockerfile ]; then
mkdir -p /kaniko/.docker
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 --destination $CI_REGISTRY_IMAGE:latest
fi
job
:
stage
:
build
...
...
@@ -34,6 +27,29 @@ job:
-
pushes
tags
:
-
docker
before_script
:
# Display info about environment.
-
date
-
locale
-
echo "Running job ${JOB} for provider ${PROVIDER_SLUG}"
# Install fetcher dependencies.
-
'
[
-f
requirements.txt
]
&&
pip3
install
--requirement
requirements.txt'
# Run ssh-agent (inside the build environment).
-
eval $(ssh-agent -s)
# Add the SSH key stored in SSH_PRIVATE_KEY variable to the agent store.
-
ssh-add <(echo "$SSH_PRIVATE_KEY")
# Add the SSH keys of remote Git servers, to disable host key checking questions.
-
mkdir -p ~/.ssh
-
ssh-keyscan -t rsa git.nomics.world >> ~/.ssh/known_hosts
-
git config --global push.default simple
-
git config --global user.email "${PROVIDER_SLUG}-fetcher@db.nomics.world"
-
git config --global user.name "${PROVIDER_SLUG} fetcher"
script
:
-
set -x
-
|
...
...
@@ -45,7 +61,7 @@ job:
time python3 download.py ${PROVIDER_SLUG}-source-data
cd ${PROVIDER_SLUG}-source-data
time git add -A
time git commit -m "New download" --quiet || true
time git commit -m "New download" --quiet
--ignore-removal .
|| true
time git push
# Move errors.json file, if present; to be kept as artifact
[ -f errors.json ] && mv errors.json .. || true
...
...
This diff is collapsed.
Click to expand it.
Preview
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!
Save comment
Cancel
Please
register
or
sign in
to comment