[gjs: 1/2] CI: build Static Analysis Docker image in GitLab
- From: Philip Chimento <pchimento src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs: 1/2] CI: build Static Analysis Docker image in GitLab
- Date: Sun, 8 Jul 2018 21:53:58 +0000 (UTC)
commit 11df86b9dcf96240c03afded5a52d77dbb8a822d
Author: Claudio André <claudioandre br gmail com>
Date: Thu Jul 5 18:46:28 2018 -0300
CI: build Static Analysis Docker image in GitLab
[dont push]
.gitlab-ci.yml | 53 ++++++++++++++++++++++++++++
test/extra/Dockerfile.fedora.static-analysis | 17 +++++++++
2 files changed, 70 insertions(+)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e0c96fec..110232f9 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -661,3 +661,56 @@ ppc64le:
when: manual
except:
- schedules
+
+#############################################
+# Create CI Docker Images #
+#############################################
+.Docker image template: &create_docker_image
+ image: docker:latest
+ stage: delivery
+ services:
+ - docker:dind
+ only:
+ variables:
+ - $CRON_TASK == "BUILD_CI_IMAGES"
+
+ script:
+ # CI starts here. Previous messages are from GitLab Runner setup.
+ - *CI_header
+
+ # Skip the build (if requested)
+ - |
+ if [[ -z "${CI_COMMIT_MESSAGE##*[skip images]*}" && -z "${CI_COMMIT_MESSAGE##*$NAME*}" ]]; then
+ echo "== Nothing to do =="
+ exit 0
+ fi
+
+ # Build using the Dockerfile
+ - |
+ if [[ -n "${DOCKERFILE}" ]]; then
+ docker build -f "$DOCKERFILE" -t "$REPO:$NAME" .
+ fi
+
+ # Prepare to publish
+ - docker tag "$REPO:$NAME" "$REPO:job-"$CI_JOB_ID"_$NAME"
+ - docker images
+ - docker login ${CI_REGISTRY} -u ${CI_REGISTRY_USER} -p ${CI_REGISTRY_PASSWORD}
+
+ # Do not push (if requested)
+ - |
+ if [[ "${CI_PIPELINE_SOURCE}" == "schedule" || -n "${CI_COMMIT_MESSAGE##*[dont push]*}" ]]; then
+ docker push $REPO
+ fi
+
+ # Done
+ - *CI_footer
+
+fedora.static-analysis:
+ <<: *create_docker_image
+ variables:
+ BASE: "fedora"
+ DOCKER_DRIVER: overlay
+ DOCKERFILE: "test/extra/Dockerfile.fedora.static-analysis"
+ NAME: "fedora.static-analysis"
+ REPO: "${CI_REGISTRY}/${CI_PROJECT_PATH}"
+ CRON_TASK: "BUILD_CI_IMAGES"
diff --git a/test/extra/Dockerfile.fedora.static-analysis b/test/extra/Dockerfile.fedora.static-analysis
new file mode 100644
index 00000000..15a03eda
--- /dev/null
+++ b/test/extra/Dockerfile.fedora.static-analysis
@@ -0,0 +1,17 @@
+FROM fedora:latest
+MAINTAINER Claudio André (c) 2018 V1.0
+
+LABEL architecture="x86_64"
+LABEL version="1.0"
+LABEL description="Docker image to run CI for GNOME GJS (JavaScript bindings for GNOME)."
+
+RUN dnf -y --nogpgcheck upgrade && \
+ dnf -y install \
+ git cppcheck tokei nodejs python-devel && \
+ mkdir -p /cwd && \
+ pip install cpplint && \
+ npm install -g eslint && \
+ dnf -y clean all
+
+CMD ["/bin/bash"]
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]