forked from pandoc/dockerfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
102 lines (100 loc) · 3.55 KB
/
config.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
98
99
100
101
102
version: 2.1
jobs:
# Any linting checks that can be performed go here.
lint:
machine: true
steps:
- checkout
- run:
name: Download and Run ShellCheck
command: |
curl -LO https://storage.googleapis.com/shellcheck/shellcheck-stable.linux.x86_64.tar.xz
tar -xf shellcheck-stable.linux.x86_64.tar.xz
export PATH="$PWD/shellcheck-stable:$PATH"
make lint
# Builds a docker image stack (see workflows below). If getting merged to the
# master branch then the built image(s) will also be pushed to docker hub.
build_stack:
machine: true
description: Build parameterized docker image stack
parameters:
core_target:
description: Makefile target to build core image (just pandoc)
type: string
latex_target:
description: Makefile target to build latex image (on top of core_target)
type: string
# This default value is checked for in build_image.sh. If this exact
# value is found, then the script will exit 0 rather than exit 1,
# allowing for future image stacks to only have a core_target with no
# latex target if desired.
default: "nonexistent"
cron_job:
description: Whether or not this is a cron build (forces edge tag build)
type: boolean
default: false
environment:
CIRCLE_CRON_JOB: << parameters.cron_job >>
steps:
- checkout
# First build the core image
- run:
# Set a 1 hour time limit. Build/push may get silent during parts.
no_output_timeout: 1h
command: |
./.circleci/build_image.sh << parameters.core_target >>
# Test core image
- run:
command: |
version="$(./.circleci/version_for_commit_message.sh)"
PANDOC_VERSION="$version" make test-<< parameters.core_target >>
# After that is complete, now build the latex image.
- run:
# Set a 1 hour time limit. Build/push may get silent during parts.
no_output_timeout: 1h
command: |
./.circleci/build_image.sh << parameters.latex_target >>
# Test latex image
- run:
command: |
version="$(./.circleci/version_for_commit_message.sh)"
PANDOC_VERSION="$version" make test-<< parameters.latex_target >>
# We need to be able to distinguish cron jobs, something that CircleCI does not
# currently support in their default environment variables. Defining all image
# stacks here, but they are to be enumerated separately in
#
# 1. workflows.build.jobs
# 2. workflows.monthly.jobs
#
# The only difference in usage between (1) and (2) is whether or not `cron_job`
# is getting set which leads to some duplication, but at this time there is no
# known solution for fixing this.
alpine_stack: &alpine_stack
core_target: alpine
latex_target: alpine-latex
# Setup builds for each commit, as well as monthly cron job.
workflows:
build:
jobs:
- lint
- build_stack:
<<: *alpine_stack
monthly:
# NOTE: make sure all `build_stack` calls here *also* set `cron_job: true`!
jobs:
- build_stack:
<<: *alpine_stack
cron_job: true
triggers:
- schedule:
# http://pubs.opengroup.org/onlinepubs/7908799/xcu/crontab.html
# Minute: 0
# Hour: 0
# Day of month: 1
# Month of year: * (any)
# Day of week: * (any)
cron: "0 0 1 * *"
filters:
branches:
only:
- master