Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
exphost
exphost-helms
Commits
58a68447
Commit
58a68447
authored
3 years ago
by
torgiren
Browse files
Options
Download
Email Patches
Plain Diff
ci
parent
a1ef28bb
1 merge request
!10
ci
Pipeline
#117
passed with stages
in 48 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci.yml
+14
-10
.gitlab-ci.yml
make_ci.sh
+14
-10
make_ci.sh
with
28 additions
and
20 deletions
+28
-20
.gitlab-ci.yml
+
14
-
10
View file @
58a68447
...
...
@@ -6,9 +6,13 @@ stages:
upload_all
:
stage
:
upload
image
:
curlimages/curl:latest
image
:
name
:
alpine/helm:3.2.1
script
:
-
'
for
char
in
*tgz;
do
curl
--request
POST
--user
gitlab-ci-token:$CI_JOB_TOKEN
--form
"chart=@${chart}"
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/api/stable/charts";
done'
-
apk add --no-cache ca-certificates git
-
helm plugin install https://github.com/chartmuseum/helm-push.git
-
helm repo add --username ${CI_REGISTRY_USER} --password ${CI_REGISTRY_PASSWORD} my-repo "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/helm/stable"
-
sh -c 'for file in *tgz; do helm push ${file} my-repo; done'
only
:
-
master
...
...
@@ -19,7 +23,7 @@ check_ci_script:
-
sh -ec 'for i in $(ls */Chart.yaml); do chart=$(dirname $i); grep "^build_${chart}:" .gitlab-ci.yml; done'
versions_check_exphost
:
.
versions_check_exphost
:
stage
:
checks
image
:
curlimages/curl:latest
script
:
...
...
@@ -28,7 +32,7 @@ versions_check_exphost:
-
export VER; sh -c 'curl -v https://gitlab.home.exphost.pl/api/v4/projects/6/packages/helm/stable/charts/exphost-${VER}.tgz --output /dev/null --fail; [ $? -gt 0 ]'
only
:
changes
:
-
${chart}
/**/*
-
exphost
/**/*
lint_exphost
:
stage
:
checks
...
...
@@ -36,9 +40,9 @@ lint_exphost:
before_script
:
script
:
-
helm lint exphost
only
:
changes
:
-
${chart}
/**/*
#
only:
#
changes:
#
-
exphost
/**/*
build_exphost
:
stage
:
pack
...
...
@@ -49,6 +53,6 @@ build_exphost:
artifacts
:
paths
:
-
"
exphost-*.tgz"
only
:
changes
:
-
${chart}
/**/*
#
only:
#
changes:
#
-
exphost
/**/*
This diff is collapsed.
Click to expand it.
make_ci.sh
+
14
-
10
View file @
58a68447
...
...
@@ -8,9 +8,13 @@ stages:
upload_all:
stage: upload
image: curlimages/curl:latest
image:
name: alpine/helm:3.2.1
script:
- 'for char in *tgz; do curl --request POST --user gitlab-ci-token:
\$
CI_JOB_TOKEN --form "chart=@
\$
{chart}" "
\$
{CI_API_V4_URL}/projects/
\$
{CI_PROJECT_ID}/packages/helm/api/stable/charts"; done'
- apk add --no-cache ca-certificates git
- helm plugin install https://github.com/chartmuseum/helm-push.git
- helm repo add --username
\$
{CI_REGISTRY_USER} --password
\$
{CI_REGISTRY_PASSWORD} my-repo "
\$
{CI_API_V4_URL}/projects/
\$
{CI_PROJECT_ID}/packages/helm/stable"
- sh -c 'for file in *tgz; do helm push
\$
{file} my-repo; done'
only:
- master
...
...
@@ -27,7 +31,7 @@ for i in $(ls */Chart.yaml); do
echo
"adding
$chart
"
cat
<<
EOF
>> .gitlab-ci.yml
versions_check_
$(
echo
${
chart
}
|tr
'-'
'_'
)
:
.
versions_check_
$(
echo
${
chart
}
|tr
'-'
'_'
)
:
stage: checks
image: curlimages/curl:latest
script:
...
...
@@ -36,7 +40,7 @@ versions_check_$(echo ${chart}|tr '-' '_'):
- export VER; sh -c 'curl -v https://gitlab.home.exphost.pl/api/v4/projects/6/packages/helm/stable/charts/
${
chart
}
-
\$
{VER}.tgz --output /dev/null --fail; [
\$
? -gt 0 ]'
only:
changes:
-
\
$
{chart}/**/*
-
${
chart
}
/**/*
lint_
$(
echo
${
chart
}
|tr
'-'
'_'
)
:
stage: checks
...
...
@@ -44,9 +48,9 @@ lint_$(echo ${chart}|tr '-' '_'):
before_script:
script:
- helm lint
${
chart
}
only:
changes:
-
\
$
{chart}/**/*
#
only:
#
changes:
#
-
${
chart
}
/**/*
build_
$(
echo
${
chart
}
|tr
'-'
'_'
)
:
stage: pack
...
...
@@ -57,8 +61,8 @@ build_$(echo ${chart}|tr '-' '_'):
artifacts:
paths:
- "
${
chart
}
-*.tgz"
only:
changes:
-
\
$
{chart}/**/*
#
only:
#
changes:
#
-
${
chart
}
/**/*
EOF
done
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment
Menu
Projects
Groups
Snippets
Help