Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DAACDemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Syed Bilal Raees
DAACDemo
Commits
e87f844d
Commit
e87f844d
authored
Apr 12, 2023
by
Waqas Riaz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated .gitlab-ci.yml
parent
245a7364
Pipeline
#4132
failed with stage
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
46 deletions
+7
-46
.gitlab-ci.yml
.gitlab-ci.yml
+7
-46
No files found.
.gitlab-ci.yml
View file @
e87f844d
...
...
@@ -10,11 +10,12 @@ build_job:
-
tar --version
script
:
-
echo "Starting script for deploying to Jfrog"
-
files_list=$(find . -type f -name "*.jsonnet" ! -path "./grafonnet-lib/*")
-
existing_files=$(find . -type f -name "*.jsonnet" ! -path "./grafonnet-lib/*" | xargs -I{} basename {} )
-
last_commit_files=$(git diff --name-only HEAD^ HEAD)
-
files_list=$(comm -12 <(echo "${last_commit_files[@]}" | tr ' ' '\n' | sort) <(echo "${existing_files[@]}" | tr ' ' '\n' | sort))
-
echo "Creating directory"
-
mkdir grafonnet
# - export version=$(echo "$(cat version.txt) + 0.1" | bc)
# - export version=$(cat version.txt)
-
ls
-
|
while IFS= read -r jsonnet_file;
...
...
@@ -27,50 +28,10 @@ build_job:
jsonnet $jsonnet_file > grafonnet/$filename.json
done <<< "$files_list"
-
tar -cvzf grafonnet.tar.gz grafonnet/
# - echo "version.txt is `cat version.txt` and uploading version is $version"
-
echo "Uploading to $ARTIFACTORY_URL/grafonet/$CI_PIPELINE_ID/grafonnet.tar.gz"
-
curl -u $ARTIFACTORY_USER:$ARTIFACTORY_PASS -T grafonnet.tar.gz "$ARTIFACTORY_URL/grafonet/$CI_PIPELINE_ID/grafonnet.tar.gz"
# brew install jsonnet
# jsonnet -v
tags
:
-
ci
only
:
-
master
deploy_job
:
stage
:
deploy
before_script
:
-
curl --version
-
jq --version
-
tar --version
script
:
# - export version=$(echo "$(cat version.txt) + 0.1" | bc)
# - export version=$(cat version.txt)
-
mkdir -p build/$CI_BUILD_ID
-
cd build/$CI_BUILD_ID
-
echo "Downloading artifact from $ARTIFACTORY_URL/grafonet/$CI_PIPELINE_ID/grafonnet.tar.gz"
-
curl -O -u $ARTIFACTORY_USER:$ARTIFACTORY_PASS "$ARTIFACTORY_URL/grafonet/$CI_PIPELINE_ID/grafonnet.tar.gz"
-
ls -larth
-
pwd
-
tar -xzvf grafonnet.tar.gz
-
cd grafonnet
-
ls -larth
-
curl -u $ARTIFACTORY_USER:$ARTIFACTORY_PASS -T grafonnet.tar.gz "$ARTIFACTORY_URL/generic-local/$CI_PIPELINE_ID/grafonnet.tar.gz"
-
|
for FILE in *;
do
echo "$FILE \n";
DASHBOARD="{\"dashboard\": $(jq . $FILE), \"overwrite\": true}"
curl -X POST \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d "$DASHBOARD" \
$GRAFANA_URL/api/dashboards/db
echo "\n"
done
#grafonnet.tar.gz
tags
:
-
cd
-
testing-ci
only
:
-
master
\ No newline at end of file
-
restructuring
\ No newline at end of file
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