Skip to content
Snippets Groups Projects
Unverified Commit 367b4c62 authored by Massimiliano Adamo's avatar Massimiliano Adamo
Browse files

try to upload files to artifactory

parent 91e05319
No related branches found
No related tags found
No related merge requests found
Pipeline #29554 passed
--- ---
stages: stages:
- sonarqube - sonarqube
- upload_linux_binary - upload_linux_shell
- upload_linux_amd64_binary
#- upload_windows_amd64_binary
variables:
ARTIFACTORY_BASE_URL: https://artifactory.software.geant.org/artifactory/acme-downloader
ARTIFACT_NAME: acme-downloader
sonarqube: sonarqube:
image: sonarsource/sonar-scanner-cli:${SONAR_SCANNER_CLI_VERSION} image: sonarsource/sonar-scanner-cli:${SONAR_SCANNER_CLI_VERSION}
...@@ -15,14 +21,36 @@ sonarqube: ...@@ -15,14 +21,36 @@ sonarqube:
tags: tags:
- sonarqube - sonarqube
upload_linux_binary: upload_linux_shell:
stage: upload_linux_binary stage: upload_linux_shell
only:
- tags
- branches
image: curlimages/curl:7.76.1
script:
- 'curl -sSf -H "X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}" -X PUT -T ./acme-downloader.sh ${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}.sh'
tags:
- sonarqube
upload_linux_amd64_binary:
stage: upload_linux_amd64_binary
only: only:
- tags - tags
- branches - 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
- echo $PROJECT_ACCESS_TOKEN $CI_PROJECT_NAME ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME} - 'curl -sSf -H "X-JFrog-Art-Api:${ARTIFACTORY_TOKEN}" -X PUT -T ./acme-downloader ${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}_linux_amd64'
- 'curl --header "JOB-TOKEN: $PROJECT_ACCESS_TOKEN" --upload-file $CI_PROJECT_NAME "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${CI_PROJECT_NAME}/${CI_COMMIT_TAG}/${CI_PROJECT_NAME}"'
tags: tags:
- visnu_shell - visnu_shell
#upload_windows_amd64_binary:
# stage: upload_windows_amd64_binary
# only:
# - tags
# - branches
# script:
# - ./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 ${ARTIFACTORY_BASE_URL}/${ARTIFACT_NAME}_windows_amd64.exe'
# tags:
# - visnu_shell
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
# and if it contains at least the cert-name # and if it contains at least the cert-name
# #
LOCAL_MD5=$(md5sum $0 | awk '{print $1}') LOCAL_MD5=$(md5sum $0 | awk '{print $1}')
REMOTE_MD5=$(curl -s https://repositories.geant.org/pub/acme/acme-downloader.sh | md5sum | awk '{print $1}') SCRIPT_URL="https://artifactory.software.geant.org/artifactory/acme-downloader/acme-downloader.sh"
REMOTE_MD5=$(curl -s $SCRIPT_URL | md5sum | awk '{print $1}')
if [[ $LOCAL_MD5 != $REMOTE_MD5 ]]; then if [[ $LOCAL_MD5 != $REMOTE_MD5 ]]; then
echo "$0 differs from https://repositories.geant.org/pub/acme/acme-downloader.sh" echo "$0 differs from $SCRIPT_URL"
echo "suggesting that you are running an older version" echo "suggesting that you are running an older version"
echo "" echo ""
fi fi
...@@ -44,7 +45,7 @@ if ! source /etc/os-release &>/dev/null; then ...@@ -44,7 +45,7 @@ if ! source /etc/os-release &>/dev/null; then
echo "no idea what to do with this OS: I was not able to access /etc/os-release" echo "no idea what to do with this OS: I was not able to access /etc/os-release"
echo "" echo ""
clean_up clean_up
elif [[ "$ID" == "ubuntu" ]] || [[ "$ID" == "debian" ]]; then elif [[ "$ID" == "ubuntu" ]] || [[ "$ID" == "debian" ]] || [[ "$ID" == "arch"* ]]; then
CERT_BASE="/etc/ssl/certs" CERT_BASE="/etc/ssl/certs"
KEY_BASE="/etc/ssl/private" KEY_BASE="/etc/ssl/private"
GROUPNAME="ssl-cert" GROUPNAME="ssl-cert"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment