Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 15 additions & 42 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,15 @@ include:
artifact_map: artifacts.json
email: ${NOTIFY_EMAIL}
action: FULL
nspect_id: ${NSPECT_ID}
public: True
needs:
- job: bootstrap
artifacts: true
- job: assemble-artifacts
- job: create-operator-json
optional: true
artifacts: true
- job: create-agent-json
optional: true
artifacts: true

## setup vault creds
Expand Down Expand Up @@ -166,12 +169,11 @@ create-operator-json:
artifacts: true
script:
- |
export version="${CI_COMMIT_TAG#operator/}"
cat > operator.json << EOF
cat > artifacts.json << EOF
{
"skyhook": {
"source": {
"org": "nvstaging",
"org": "${NGC_PRIVATE_ORG}",
"team": "skyhook"
},
"target": {
Expand All @@ -181,16 +183,17 @@ create-operator-json:
"artifacts": [
{
"name": "operator",
"version": "${version}",
"version": "${CI_COMMIT_TAG#operator/}",
"type": "container"
}
]
],
"nspect_id": "${OPERATOR_NSPECT_ID}"
}
}
EOF
artifacts:
paths:
- operator.json
- artifacts.json

create-agent-json:
rules:
Expand All @@ -200,8 +203,7 @@ create-agent-json:
artifacts: true
script:
- |
export version="${CI_COMMIT_TAG#agent/}"
cat > agent.json << EOF
cat > artifacts.json << EOF
{
"skyhook": {
"source": {
Expand All @@ -215,43 +217,14 @@ create-agent-json:
"artifacts": [
{
"name": "agent",
"version": "${version}",
"version": "${CI_COMMIT_TAG#agent/}",
"type": "container"
}
]
],
"nspect_id": "${AGENT_NSPECT_ID}"
}
}
EOF
artifacts:
paths:
- agent.json

assemble-artifacts:
needs:
- job: create-operator-json
optional: true
artifacts: true
- job: create-agent-json
optional: true
artifacts: true
rules:
- if: '$CI_COMMIT_TAG =~ /^(operator|agent)\/v\d+\.\d+\.\d+$/'
before_script:
- apt update
- apt install -y jq
script:
- |
if [ -f operator.json ] && [ -f agent.json ]; then
# Merge both JSON files
jq -s '.[0].skyhook.artifacts += .[1].skyhook.artifacts | .[0]' operator.json agent.json > artifacts.json
elif [ -f operator.json ]; then
cp operator.json artifacts.json
elif [ -f agent.json ]; then
cp agent.json artifacts.json
else
echo "No JSON files found"
exit 1
fi
artifacts:
paths:
- artifacts.json