This repository has been archived by the owner on Nov 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
/
.gitlab-ci.yml
97 lines (91 loc) · 2.54 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
stages:
- test
- build
- deploy
variables:
DOCKER_HOST: tcp://docker:2375/
lint_dockerfile:
image: hadolint/hadolint:latest-alpine
stage: test
script:
- hadolint Dockerfile
shellcheck:
image: koalaman/shellcheck-alpine:stable
stage: test
before_script:
- shellcheck --version
script:
- shellcheck **/*.sh rootfs/etc/cont-init.d/* rootfs/etc/services.d/*/run # path to your shell scripts
build:
image: ixdotai/docker-buildx-qemu:latest
stage: build
services:
- docker:dind
retry: 2
variables:
DOCKER_TLS_CERTDIR: "/certs"
DOCKER_CERT_PATH: "/certs/client"
DOCKER_TLS: "true"
DOCKER_HOST: tcp://docker:2376/
BUILDKIT_INLINE_CACHE: "1"
DOCKER_DRIVER: overlay2
BUILDX_PLATFORM: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
before_script:
- echo "$CI_REGISTRY_PASSWORD" | docker login -u "$CI_REGISTRY_USER" --password-stdin
- update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel
# Use docker-container driver to allow useful features (push/multi-platform)
- docker context create MyContext
- docker buildx create --driver docker-container --name MyContext --use MyContext
- docker buildx inspect --bootstrap
script:
- docker buildx ls
- update-binfmts --enable # Important: Ensures execution of other binary formats is enabled in the kernel
- chmod +x ./build/build.sh
- . ./build/build.sh
only:
changes:
- Dockerfile
- rootfs/**/*
- .gitlab-ci.yml
- build/**/*
# the 'pages' job will deploy and build your site to the 'public' path
dockerhub-readme:
stage: deploy
variables:
README_PATH: ./README.md
image:
name: sheogorath/readme-to-dockerhub:latest
entrypoint: [""]
script:
- node /app/index.js
only:
refs:
- master
changes:
- README.md
- .gitlab-ci.yml
# the 'pages' job will deploy and build your site to the 'public' path
pages:
stage: deploy
# requiring the environment of NodeJS 10
image: node:10
# add 'node_modules' to cache for speeding up builds
cache:
paths:
- node_modules/ # Node modules and dependencies
before_script:
- npm install gitbook-cli -g # install gitbook
- gitbook fetch 3.2.3 # fetch final stable version
- gitbook install # add any requested plugins in book.json
script:
- gitbook build . public # build to public path
artifacts:
paths:
- public
expire_in: 1 week
only:
refs:
- master
changes:
- README.md
- .gitlab-ci.yml