Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
ciwrappers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emmanuel Bruno
ciwrappers
Commits
9f450c7a
Commit
9f450c7a
authored
2 years ago
by
Emmanuel Bruno
Browse files
Options
Downloads
Patches
Plain Diff
fixes typos.
parent
725918c6
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ci-wrappers.sh
+15
-7
15 additions, 7 deletions
ci-wrappers.sh
with
15 additions
and
7 deletions
ci-wrappers.sh
+
15
−
7
View file @
9f450c7a
...
@@ -7,9 +7,17 @@ _init() {
...
@@ -7,9 +7,17 @@ _init() {
source
"
${
HOME
}
/.ci-wrappers/config"
source
"
${
HOME
}
/.ci-wrappers/config"
}
}
var_expand
()
{
if
[
-z
"
${
1
-
}
"
]
||
[
$#
-ne
1
]
;
then
printf
'var_expand: expected one argument\n'
>
&2
;
return
1
;
fi
eval printf
'%s'
"
\"\$
{
$1
?}
\"
"
}
ci-wrappers-usage
()
{
ci-wrappers-usage
()
{
printf
'install-
dockerclient-vagrant-terraform\n\t installs a docker client
, vagant and terraform in %s/bin\n'
"
${
HOME
}
"
printf
'install-
ci-software\n\t installs a docker client and compose plugin, Github CLI
, vag
r
ant and terraform in %s/bin\n'
"
${
CI_WRAPPERS_
HOME
}
"
printf
"new-java-project [projectname]
\n\t
create a new java+maven project ready for CI
\n
"
printf
"new-java-project [projectname]
[groupid]
\n\t
create a new java+maven project ready for CI
\n
"
echo
"docker-wrapper"
echo
"docker-wrapper"
echo
"docker-wrapper-build"
echo
"docker-wrapper-build"
echo
"docker-wrapper-build-all"
echo
"docker-wrapper-build-all"
...
@@ -90,14 +98,13 @@ _moveVBoxDefaultFolder() {
...
@@ -90,14 +98,13 @@ _moveVBoxDefaultFolder() {
}
}
_check_needed_variables
()
{
_check_needed_variables
()
{
_check_variables GITHUBLOGIN GITHUBTOKEN GITHUB
_
ORG SONAR_URL SONAR_TOKEN
_check_variables GITHUBLOGIN GITHUBTOKEN GITHUBORG SONAR_URL SONAR_TOKEN
}
}
_check_variables
()
{
_check_variables
()
{
if
[
-n
"
$ZSH_VERSION
"
]
;
then
emulate
-L
ksh
;
fi
for
varname
in
"
$@
"
;
do
for
varname
in
"
$@
"
;
do
v
=
"
$
{
!
varname
}
"
v
=
$(
var_expand
"
$varname
"
)
if
[
!
-n
"
${
v
-unset
}
"
]
;
then
if
[
-z
"
${
v
-unset
}
"
]
;
then
echo
"
$varname
is not set: exiting"
echo
"
$varname
is not set: exiting"
exit
1
exit
1
fi
fi
...
@@ -106,7 +113,8 @@ _check_variables() {
...
@@ -106,7 +113,8 @@ _check_variables() {
# This utility function computes the image name and tag from the project directory and the git branch.
# This utility function computes the image name and tag from the project directory and the git branch.
_docker_env
()
{
_docker_env
()
{
DOCKER_REPO_NAME
=
${
GITHUB_ORG
}
_check_variables GITHUBORG
DOCKER_REPO_NAME
=
${
GITHUBORG
}
IMAGE_NAME
=
$(
echo
"
${
PWD
##*/
}
"
|
tr
'[:upper:]'
'[:lower:]'
)
IMAGE_NAME
=
$(
echo
"
${
PWD
##*/
}
"
|
tr
'[:upper:]'
'[:lower:]'
)
IMAGE_TAG
=
$(
git rev-parse
--abbrev-ref
HEAD
)
IMAGE_TAG
=
$(
git rev-parse
--abbrev-ref
HEAD
)
DOCKER_TARGET
=
${
DOCKER_TARGET
:-
finalJLinkAlpine
}
DOCKER_TARGET
=
${
DOCKER_TARGET
:-
finalJLinkAlpine
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment