File tree 13 files changed +208
-179
lines changed
13 files changed +208
-179
lines changed Original file line number Diff line number Diff line change
1
+ ---
1
2
# https://circleci.com/docs/docker
2
3
version : 2
3
4
jobs :
9
10
steps :
10
11
- checkout
11
12
13
+ - run :
14
+ name : Bootstrap the devenv
15
+ command : |
16
+ ci/bootstrap
17
+
12
18
- run :
13
19
name : Build the image
14
20
command : |
21
27
22
28
- deploy :
23
29
name : Deploy from master branch
30
+ # yamllint disable rule:line-length
24
31
command : |
25
32
if [[ ${CIRCLE_BRANCH} = master ]] && [[ -z ${CIRCLE_PR_NUMBER} ]]; then
26
33
ci/publish
Original file line number Diff line number Diff line change
1
+ src/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ set -eEu
3
+ set -o pipefail
4
+
5
+ . src/bootstrap
6
+
7
+ main () {
8
+ mkbin
9
+ install_shellcheck
10
+ install_shfmt
11
+ }
12
+
13
+ mkbin () {
14
+ mkdir -p ~ /bin || :
15
+ if ! grep -E ' :~/bin[:$]' <<< " $(printenv PATH)" & > /dev/null; then
16
+ export PATH=" ${PATH} :~/bin"
17
+ fi
18
+ }
19
+
20
+ install_shellcheck () {
21
+ if ! command -v shellcheck; then
22
+ # Install latest statically-linked version of
23
+ # https://github.com/koalaman/shellcheck
24
+ local -r tarball=" shellcheck-latest.linux.x86_64.tar.xz"
25
+
26
+ cd /tmp
27
+ curl -L -ssL -O https://storage.googleapis.com/shellcheck/${tarball}
28
+ tar xvJf ${tarball}
29
+ cp /tmp/shellcheck-latest/shellcheck ~ /bin/
30
+ rm -fr /tmp/shellcheck*
31
+ fi
32
+ }
33
+
34
+ install_shfmt () {
35
+ if ! command -v shfmt; then
36
+ # Install statically-linked version of shfmt from
37
+ # https://github.com/mvdan/sh
38
+ local -r SHFMT_VERSION=" v2.3.0"
39
+ curl -L -ssL -o ~ /bin/shfmt \
40
+ " https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION} /shfmt_${SHFMT_VERSION} _linux_amd64"
41
+ chmod 0755 ~ /bin/shfmt
42
+ fi
43
+ }
44
+
45
+ main
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- set -e
3
- set -u
4
-
5
- . ci/functions.sh
6
- verbosity=1
2
+ set -eEu
3
+ set -o pipefail
7
4
8
5
echo
9
6
echo Remove mb container if it has been created.
10
- docker rm mb & > /dev/null || :
7
+ docker rm mb & > /dev/null || :
11
8
12
9
echo
13
10
echo Build mb image.
@@ -24,4 +21,4 @@ docker-compose build
24
21
25
22
echo
26
23
echo Show images.
27
- docker images | egrep ' jumanjiman/cci\b'
24
+ docker images | grep -E ' jumanjiman/cci\b'
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- set -e
3
- set -u
4
-
5
- . ci/functions.sh
6
- verbosity=1
2
+ set -eEu
3
+ set -o pipefail
7
4
8
5
BUILD_DATE=$( date +%Y%m%dT%H%M)
9
6
VCS_REF=$( git describe --abbrev=7 --tags --always)
10
7
TAG=${BUILD_DATE} -git-${VCS_REF}
11
8
12
- docker login -u ${user} -p ${pass}
13
- docker tag jumanjiman/cci jumanjiman/cci:${TAG}
14
- docker push jumanjiman/cci:${TAG}
9
+ # shellcheck disable=SC2154
10
+ docker login -u " ${user} " -p " ${pass} "
11
+ docker tag jumanjiman/cci " jumanjiman/cci:${TAG} "
12
+ docker push " jumanjiman/cci:${TAG} "
15
13
docker push jumanjiman/cci:latest
16
14
docker logout
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
- set -e
3
- set -u
2
+ set -eEu
3
+ set -o pipefail
4
4
5
- . ci/functions.sh
5
+ . ci/bootstrap
6
6
7
- echo
8
- echo Run CI tests.
9
- docker-compose run ci
7
+ main () {
8
+ run_ci
9
+ run_precommit
10
+ }
10
11
11
- echo
12
- echo Check for thinkgs like trailing whitespace.
13
- # Hint: -v1 shows just the names of offending files.
14
- # -v2 shows lines with trailing whitespace.
15
- ci/check-files -v1
12
+ run_ci () {
13
+ echo
14
+ echo Run CI tests.
15
+ docker-compose run ci
16
+ }
17
+
18
+ run_precommit () {
19
+ echo
20
+ echo Run various file checks.
21
+
22
+ # http://pre-commit.com/#pre-commit-run
23
+ readonly DEFAULT_PRECOMMIT_OPTS=" --all-files --verbose"
24
+
25
+ # Allow user to override our defaults by setting an env var.
26
+ readonly PRECOMMIT_OPTS=" ${PRECOMMIT_OPTS:- $DEFAULT_PRECOMMIT_OPTS } "
27
+
28
+ # shellcheck disable=SC2086
29
+ /usr/bin/time pre-commit run ${PRECOMMIT_OPTS}
30
+ }
31
+
32
+ main
Original file line number Diff line number Diff line change
1
+ ---
1
2
version : ' 2.1'
2
3
3
4
services :
Original file line number Diff line number Diff line change
1
+ ---
1
2
version : ' 2.1'
2
3
3
4
services :
Original file line number Diff line number Diff line change
1
+ ---
2
+ # This file configures https://pre-commit.com/
3
+ # to use specific hooks and options.
4
+
5
+ fail_fast : false
6
+
7
+ repos :
8
+ - repo : https://github.com/jumanjihouse/pre-commit-hooks
9
+ sha : 1.5.1
10
+ hooks :
11
+ - id : forbid-binary
12
+ - id : git-check # Configure in .gitattributes
13
+ - id : git-dirty # Configure in .gitignore
14
+ - id : shellcheck
15
+ - id : shfmt
16
+
17
+ - repo : https://github.com/adrienverge/yamllint.git
18
+ sha : v1.11.1
19
+ hooks :
20
+ - id : yamllint
21
+ args : ['--format', 'parsable', '--strict']
22
+
23
+ - repo : https://github.com/pre-commit/pre-commit-hooks
24
+ sha : v1.2.3
25
+ hooks :
26
+ - id : check-added-large-files
27
+ - id : check-case-conflict
28
+ - id : check-executables-have-shebangs
29
+ - id : check-json
30
+ - id : detect-private-key
31
+
32
+ - repo : https://github.com/Lucas-C/pre-commit-hooks
33
+ sha : v1.1.5
34
+ hooks :
35
+ - id : forbid-crlf
36
+ - id : forbid-tabs
37
+ exclude : >
38
+ (?x)^(
39
+ Makefile|
40
+ .*\.go
41
+ )$
42
+
43
+ - repo : https://github.com/chriskuehl/puppet-pre-commit-hooks.git
44
+ sha : v2.0.1
45
+ hooks :
46
+ - id : puppet-validate
47
+ - id : erb-validate
48
+ - id : epp-validate
49
+ - id : puppet-lint
50
+ args :
51
+ - --fail-on-warnings
52
+ - --no-documentation-check
You can’t perform that action at this time.
0 commit comments