Explorar o código

Merge remote-tracking branch 'ulm/master'

Joeri Exelmans %!s(int64=2) %!d(string=hai) anos
pai
achega
93fcf9106f
Modificáronse 2 ficheiros con 47 adicións e 0 borrados
  1. 43 0
      .gitlab-ci.yml
  2. 4 0
      Dockerfile

+ 43 - 0
.gitlab-ci.yml

@@ -0,0 +1,43 @@
+stages:
+  - compile
+  - build
+
+# Workaround for ipv6 issues
+default:
+  before_script:
+    - alias npm="node --dns-result-order=ipv4first $(which npm)"
+
+compile:
+  stage: compile
+  image: node:lts-alpine
+  script:
+    - npm ci
+    - npm run webpack
+  artifacts:
+    paths:
+      - dist/
+    expire_in: 1h
+
+build-docker-image:
+  stage: build
+  variables:
+    COMPONENT_NAME: demonstrator
+    VERSION_TAG: latest
+  image:
+    name: gcr.io/kaniko-project/executor:debug
+    entrypoint: [""]
+  rules:
+    - if: '$CI_COMMIT_BRANCH == "master"'
+      when: always
+  dependencies:
+    - compile
+
+  script:
+    - mkdir -p /kaniko/.docker
+    - echo "{\"auths\":{\"${CI_REGISTRY}\":{\"auth\":\"$(printf "%s:%s" "${CI_REGISTRY_USER}" "${CI_REGISTRY_PASSWORD}" | base64 | tr -d '\n')\"}}}" > /kaniko/.docker/config.json
+    - >-
+      /kaniko/executor
+      --context "${CI_PROJECT_DIR}"
+      --dockerfile "${CI_PROJECT_DIR}/Dockerfile"
+      --destination "${CI_REGISTRY_IMAGE}/${COMPONENT_NAME}:${VERSION_TAG}"
+

+ 4 - 0
Dockerfile

@@ -0,0 +1,4 @@
+FROM httpd:alpine
+
+COPY --chown=www-data:www-data dist/ /usr/local/apache2/htdocs
+