Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Acme Downloader
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
Geant DevOps
Acme Downloader
Commits
60a5c7ca
Unverified
Commit
60a5c7ca
authored
3 years ago
by
Massimiliano Adamo
Browse files
Options
Downloads
Patches
Plain Diff
add self-update option to shell script
parent
b96faeef
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitlab-ci-psnc.yml
+0
-3
0 additions, 3 deletions
.gitlab-ci-psnc.yml
acme-downloader.sh
+17
-1
17 additions, 1 deletion
acme-downloader.sh
with
17 additions
and
4 deletions
.gitlab-ci-psnc.yml
+
0
−
3
View file @
60a5c7ca
...
@@ -25,7 +25,6 @@ upload_linux_shell:
...
@@ -25,7 +25,6 @@ upload_linux_shell:
stage
:
upload_linux_shell
stage
:
upload_linux_shell
only
:
only
:
-
tags
-
tags
-
branches
image
:
curlimages/curl:7.76.1
image
:
curlimages/curl:7.76.1
script
:
script
:
-
'
curl
-sSf
-H
"X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}"
-X
PUT
-T
./acme-downloader.sh
${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}.sh'
-
'
curl
-sSf
-H
"X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}"
-X
PUT
-T
./acme-downloader.sh
${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}.sh'
...
@@ -36,7 +35,6 @@ upload_linux_amd64_binary:
...
@@ -36,7 +35,6 @@ upload_linux_amd64_binary:
stage
:
upload_linux_amd64_binary
stage
:
upload_linux_amd64_binary
only
:
only
:
-
tags
-
tags
-
branches
script
:
script
:
-
./build.sh --os=linux --arch=amd64 --version=$CI_COMMIT_TAG --upx
-
./build.sh --os=linux --arch=amd64 --version=$CI_COMMIT_TAG --upx
-
'
curl
-sSf
-H
"X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}"
-X
PUT
-T
./acme-downloader
${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}_linux_amd64'
-
'
curl
-sSf
-H
"X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}"
-X
PUT
-T
./acme-downloader
${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}_linux_amd64'
...
@@ -47,7 +45,6 @@ upload_windows_amd64_binary:
...
@@ -47,7 +45,6 @@ upload_windows_amd64_binary:
stage
:
upload_windows_amd64_binary
stage
:
upload_windows_amd64_binary
only
:
only
:
-
tags
-
tags
-
branches
script
:
script
:
-
./build.sh --os=windows --arch=amd64 --version=$CI_COMMIT_TAG --upx
-
./build.sh --os=windows --arch=amd64 --version=$CI_COMMIT_TAG --upx
-
'
curl
-sSf
-H
"X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}"
-X
PUT
-T
./acme-downloader.exe
${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}_windows_amd64.exe'
-
'
curl
-sSf
-H
"X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}"
-X
PUT
-T
./acme-downloader.exe
${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}_windows_amd64.exe'
...
...
This diff is collapsed.
Click to expand it.
acme-downloader.sh
+
17
−
1
View file @
60a5c7ca
...
@@ -66,7 +66,7 @@ usage() {
...
@@ -66,7 +66,7 @@ usage() {
echo
" --redis-token (Redis access token)"
echo
" --redis-token (Redis access token)"
echo
" --vault-token (Vault access token)"
echo
" --vault-token (Vault access token)"
echo
" --cert-name (Certificate name)"
echo
" --cert-name (Certificate name)"
echo
" --team-name (Team name: swd, dream_team, it, ne, ti...)"
echo
" --team-name (Team name: swd, dream_team, it, ne, ti
, nmaas
...)"
echo
" --days [OPTIONAL check days before expiration. Default: 30)"
echo
" --days [OPTIONAL check days before expiration. Default: 30)"
echo
" --type [OPTIONAL. OV or EV. Default: EV]"
echo
" --type [OPTIONAL. OV or EV. Default: EV]"
echo
" --cert-destination [OPTIONAL Default:
${
CERT_BASE
}
/<cert-name>.crt]"
echo
" --cert-destination [OPTIONAL Default:
${
CERT_BASE
}
/<cert-name>.crt]"
...
@@ -74,6 +74,7 @@ usage() {
...
@@ -74,6 +74,7 @@ usage() {
echo
" --key-destination [OPTIONAL Default:
${
KEY_BASE
}
/<cert-name>.key]"
echo
" --key-destination [OPTIONAL Default:
${
KEY_BASE
}
/<cert-name>.key]"
echo
" --ca-destination [OPTIONAL Default:
${
CERT_BASE
}
/COMODO_<type>.crt]"
echo
" --ca-destination [OPTIONAL Default:
${
CERT_BASE
}
/COMODO_<type>.crt]"
echo
" --wildcard [OPTIONAL if the certificate is wildcard]"
echo
" --wildcard [OPTIONAL if the certificate is wildcard]"
echo
" --update [OPTIONAL self-updates the script and exit]"
echo
""
echo
""
clean_up
clean_up
}
}
...
@@ -130,6 +131,9 @@ while true; do
...
@@ -130,6 +131,9 @@ while true; do
--wildcard
)
--wildcard
)
WILDCARD
=
'WILDCARD'
WILDCARD
=
'WILDCARD'
;;
;;
--update
)
UPDATE
=
'UPDATE'
;;
--
)
--
)
shift
shift
break
break
...
@@ -140,6 +144,18 @@ done
...
@@ -140,6 +144,18 @@ done
TYPE
=
$(
echo
$TYPE
|
tr
'[:lower:]'
'[:upper:]'
)
TYPE
=
$(
echo
$TYPE
|
tr
'[:lower:]'
'[:upper:]'
)
if
[
-n
$UPDATE
]
;
then
curl
$SCRIPT_URL
-o
$0
UPDATE_STATUS
=
$?
if
[
$UPDATE_STATUS
==
0
]
;
then
echo
-e
"
\n
$0
updated successfully
\n
"
else
echo
-e
"
\n
failed to update
$0
"
echo
-e
"Please download the script manually from this URL:
${
SCRIPT_URL
}
\n
"
fi
exit
$UPDATE_STATUS
fi
if
[[
-z
$REDIS_TOKEN
]]
||
[[
-z
$VAULT_TOKEN
]]
||
[[
-z
$CERT_NAME
]]
||
[[
-z
$TEAM_NAME
]]
;
then
if
[[
-z
$REDIS_TOKEN
]]
||
[[
-z
$VAULT_TOKEN
]]
||
[[
-z
$CERT_NAME
]]
||
[[
-z
$TEAM_NAME
]]
;
then
echo
-e
"
\n
--redis-token, --vault-token, --cert-name and --team-name are mandatory
\n
"
echo
-e
"
\n
--redis-token, --vault-token, --cert-name and --team-name are mandatory
\n
"
usage
usage
...
...
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