File tree 8 files changed +212
-32
lines changed
8 files changed +212
-32
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,12 @@ RUN chmod -R 755 /tmp/mpi &&\
22
22
/tmp/mpi/install.sh "/usr/local" &&\
23
23
rm -rf /tmp/mpi &&\
24
24
# Configuration
25
- envcli config set cache-path "/cache"
25
+ mkdir -p /cache &&\
26
+ envcli config set cache-path "/cache" &&\
27
+ # Aliases
28
+ envcli install-aliases &&\
29
+ # Permissions
30
+ chmod +x /usr/local/bin/*
26
31
27
32
# ###########################################################
28
33
# Execution
Original file line number Diff line number Diff line change @@ -3,22 +3,26 @@ set -euo pipefail
3
3
4
4
# Main Function
5
5
#
6
- # Environment:
7
- # HUGO_SOURCE: source directory used to generate hugo sites
8
- #
9
6
# Returns the exit code of the last command executed or 0 otherwise.
10
7
function main()
11
8
{
12
9
# configuration
13
10
HUGO_SOURCE=${HUGO_SOURCE:- .}
14
- HUGO_URL=${HUGO_URL:- http:// localhost}
11
+ HUGO_TARGET=${HUGO_TARGET:- ${ARTIFACT_DIR} / hugo}
12
+ HUGO_URL=${HUGO_URL:-/ }
15
13
16
14
# get dependencies
17
- if test -f config.toml; then
18
- @mpi.container_command hugo --source " $HUGO_SOURCE " --destination " $ARTIFACT_DIR " --minify --gc --baseURL " $HUGO_URL "
15
+ if test -f " ${HUGO_SOURCE} /config.toml" ; then
16
+ @mpi.log_message " INFO" " Generating hugo documentation from [${HUGO_SOURCE} ], target [${HUGO_TARGET} ]!"
17
+ @mpi.container_command hugo --source " ${HUGO_SOURCE} " --minify --gc --baseUrl " /" --log --verboseLog
18
+
19
+ rm -rf " ${HUGO_TARGET} "
20
+ cp -R " ${HUGO_SOURCE} /public" " ${HUGO_TARGET} "
21
+ rm -rf " ${HUGO_SOURCE} /public"
19
22
else
20
23
@mpi.log_message " ERROR" " Hugo needs a config.toml!"
21
24
exit 1
25
+ fi
22
26
}
23
27
24
28
# entrypoint
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ set -euo pipefail
3
+
4
+ # Main Function
5
+ #
6
+ # Returns the exit code of the last command executed or 0 otherwise.
7
+ function main()
8
+ {
9
+ # configuration
10
+ HUGO_SOURCE=${HUGO_SOURCE:- .}
11
+
12
+ # get dependencies
13
+ if test -f " ${HUGO_SOURCE} /config.toml" ; then
14
+ @mpi.log_message " INFO" " Generating hugo documentation from [${HUGO_SOURCE} ] and watching directory for changes!"
15
+ @mpi.container_command --port 1313:1313 hugo server --source " ${HUGO_SOURCE} " --minify --gc --log --verboseLog --baseUrl " /" --watch
16
+ else
17
+ @mpi.log_message " ERROR" " Hugo needs a config.toml!"
18
+ exit 1
19
+ fi
20
+ }
21
+
22
+ # entrypoint
23
+ main " $@ "
Original file line number Diff line number Diff line change @@ -73,7 +73,7 @@ images:
73
73
provides :
74
74
- hugo
75
75
- htmlproofer
76
- image : docker.io/cibuilds/hugo:0.58.2
76
+ image : docker.io/cibuilds/hugo:0.71
77
77
# Infrastructure
78
78
# - Kubernetes
79
79
- name : KubeCTL
Original file line number Diff line number Diff line change 30
30
31
31
# log the message
32
32
>&2 echo " [$( date ' +%Y-%m-%d %H:%M:%S' ) ] ${log_priority} : ${log_message} "
33
+
33
34
return 0
34
35
}
Original file line number Diff line number Diff line change @@ -3,20 +3,35 @@ set -euo pipefail
3
3
4
4
# Main Function
5
5
#
6
- # Environment:
7
- # none
8
- #
9
6
# Returns the exit code of the last command executed or 0 otherwise.
10
7
function main()
11
8
{
12
- # hugo
13
- if [[ ${DOCUMENTATION_TYPE} =~ ^hugo$ ]]; then
9
+ # kind: documentation
10
+ documentationType=" ${DOCUMENTATION_TYPE:- none} "
11
+ # - hugo
12
+ if [ " ${documentationType} " == " hugo" ]; then
14
13
@mpi action hugo-build
15
- exit 0
14
+ # - default
15
+ else
16
+ @mpi.log_message " INFO" " not generating a documentation, type [${documentationType} ] is not supported!"
16
17
fi
17
18
18
- # no match
19
- @mpi.log_message " WARN" " project type ${DOCUMENTATION_TYPE} is not supported!"
19
+ # kind: changelog
20
+ # - release notes
21
+ if [ " $NCI_COMMIT_REF_TYPE " == " tag" ]; then
22
+ # generate changelog
23
+ @mpi action changelog-generate --ref=" $NCI_COMMIT_REF_NAME " --output=" ${TMP_DIR} /changelog"
24
+
25
+ # notification
26
+ # - discord
27
+ if [ -n " $RELEASE_WEBHOOK_DISCORD " ]; then
28
+ @mpi.discord.send_webhook " RELEASE_WEBHOOK_DISCORD" " Releasebot" " $( < ${TMP_DIR} /changelog) "
29
+ fi
30
+ # - rocketchat
31
+ if [ -n " $RELEASE_WEBHOOK_ROCKETCHAT " ]; then
32
+ @mpi.rocketchat.send_webhook " RELEASE_WEBHOOK_ROCKETCHAT" " Releasebot" " $( < ${TMP_DIR} /changelog) "
33
+ fi
34
+ fi
20
35
}
21
36
22
37
# entrypoint
Original file line number Diff line number Diff line change @@ -54,22 +54,6 @@ function main()
54
54
@mpi.log_message " WARN" " publishType GitHub is not supported yet!"
55
55
return 0
56
56
fi
57
-
58
- # release notes
59
- if [ " $NCI_COMMIT_REF_TYPE " == " tag" ]; then
60
- # generate changelog
61
- @mpi action changelog-generate --ref=" $NCI_COMMIT_REF_NAME " --output=" ${TMP_DIR} /changelog"
62
-
63
- # notification
64
- # - discord
65
- if [ -n " $PUBLISH_WEBHOOK_DISCORD " ]; then
66
- @mpi.discord.send_webhook " PUBLISH_WEBHOOK_DISCORD" " Releasebot" " $( < ${TMP_DIR} /changelog) "
67
- fi
68
- # - rocketchat
69
- if [ -n " $PUBLISH_WEBHOOK_ROCKETCHAT " ]; then
70
- @mpi.rocketchat.send_webhook " PUBLISH_WEBHOOK_ROCKETCHAT" " Releasebot" " $( < ${TMP_DIR} /changelog) "
71
- fi
72
- fi
73
57
}
74
58
75
59
# entrypoint
Original file line number Diff line number Diff line change
1
+ # #
2
+ # Modular Pipeline CI Configuration
3
+ # #
4
+
5
+ # Variables
6
+ variables :
7
+ # cluster
8
+ DOCKER_DRIVER : " ${DOCKER_DRIVER:-overlay2}"
9
+ # git settings
10
+ GIT_STRATEGY : clone
11
+ GIT_DEPTH : 10
12
+ # submodule support
13
+ GIT_SUBMODULE_STRATEGY : recursive
14
+ # gitlab pages
15
+ HUGO_URL : " ${HUGO_URL:-https://${CI_PROJECT_NAMESPACE}.gitlab.io/${CI_PROJECT_NAME}/}"
16
+
17
+ # Services
18
+ services :
19
+ - name : docker:19.03.9-dind
20
+
21
+ # Cache
22
+ cache : &project-cache
23
+ key : " $CI_PROJECT_ID"
24
+ paths :
25
+ - /cache/gradle/wrapper
26
+
27
+ # Stages
28
+ stages :
29
+ - build
30
+ - test
31
+ - package
32
+ - audit
33
+ - publish
34
+ - documentation
35
+ - cleanup
36
+
37
+ # Stage Template
38
+ .stage-template : &stage-template
39
+ image : docker.io/envcli/modular-pipeline:latest
40
+ artifacts :
41
+ paths :
42
+ - dist
43
+ - tmp
44
+ expire_in : 1 hour
45
+
46
+ # Stage - Build
47
+ Build :
48
+ << : *stage-template
49
+ stage : build
50
+ cache :
51
+ << : *project-cache
52
+ policy : pull-push
53
+ script :
54
+ - mpi stage build
55
+ only :
56
+ refs :
57
+ - branches
58
+ - tags
59
+ except :
60
+ variables :
61
+ - $DISABLE_BUILD
62
+
63
+ # Stage - Test
64
+ Test :
65
+ << : *stage-template
66
+ stage : test
67
+ cache :
68
+ << : *project-cache
69
+ policy : pull-push
70
+ script :
71
+ - mpi stage test
72
+ only :
73
+ refs :
74
+ - branches
75
+ - tags
76
+ except :
77
+ variables :
78
+ - $DISABLE_TEST
79
+
80
+ # Stage - Package
81
+ Package :
82
+ << : *stage-template
83
+ stage : package
84
+ script :
85
+ - mpi stage package
86
+ only :
87
+ refs :
88
+ - branches
89
+ - tags
90
+ except :
91
+ variables :
92
+ - $DISABLE_PACKAGE
93
+
94
+ # Stage - Audit
95
+ Audit :
96
+ << : *stage-template
97
+ stage : audit
98
+ script :
99
+ - mpi stage audit
100
+ only :
101
+ refs :
102
+ - branches
103
+ - tags
104
+ except :
105
+ variables :
106
+ - $DISABLE_AUDIT
107
+
108
+ # Stage - Publish
109
+ Publish :
110
+ << : *stage-template
111
+ stage : publish
112
+ script :
113
+ - mpi stage publish
114
+ only :
115
+ refs :
116
+ - branches
117
+ - tags
118
+ except :
119
+ variables :
120
+ - $DISABLE_PUBLISH
121
+
122
+ # Stage - Documentation
123
+ Documentation :
124
+ << : *stage-template
125
+ stage : documentation
126
+ script :
127
+ - mpi stage documentation
128
+ only :
129
+ refs :
130
+ - branches
131
+ - tags
132
+ except :
133
+ variables :
134
+ - $DISABLE_DOCUMENTATION
135
+
136
+ # Stage - Performance
137
+ CleanUp :
138
+ << : *stage-template
139
+ stage : cleanup
140
+ script :
141
+ - mpi stage cleanup
142
+ only :
143
+ refs :
144
+ - branches
145
+ - tags
146
+ except :
147
+ variables :
148
+ - $DISABLE_CLEANUP
You can’t perform that action at this time.
0 commit comments