forked from LucaCanali/sparkMeasure
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathargocd.sh
More file actions
executable file
·48 lines (34 loc) · 1.41 KB
/
argocd.sh
File metadata and controls
executable file
·48 lines (34 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
# Install pre-requisite for fink ci
# @author Fabrice Jammes
set -euxo pipefail
DIR=$(cd "$(dirname "$0")"; pwd -P)
PROJECT_DIR=$(cd "$DIR/.."; pwd -P)
ciux ignite --selector itest "$PROJECT_DIR"
# Run the CD pipeline
export CIUXCONFIG=$PROJECT_DIR/.ciux.d/ciux_itest.sh
. $CIUXCONFIG
app_name="$CIUX_IMAGE_NAME"
NS=argocd
argocd login --core
kubectl config set-context --current --namespace="$NS"
# Add support for Github PR, which do not have a branch name in the git repository
if [ "${GITHUB_EVENT_NAME:-}" = "pull_request" ]; then
revision="${GITHUB_HEAD_REF}"
# During a PR, the git repository containing the CI code is the forked one
git_repo=$(jq -r '.pull_request.head.repo.full_name' "$GITHUB_EVENT_PATH")
else
revision="${SPARKMEASURE_WORKBRANCH:-main}"
git_repo="${GITHUB_REPOSITORY}"
fi
git_repo="https://github.com/${git_repo}"
argocd app create "$app_name" --dest-server https://kubernetes.default.svc \
--dest-namespace "$app_name" \
--repo "$git_repo" \
--path e2e/charts/apps --revision "$revision" \
-p spec.source.targetRevision.default="$revision"
argocd app sync $app_name
argocd app set spark-jobs -p image.tag="$CIUX_IMAGE_TAG"
argocd app sync -l app.kubernetes.io/part-of=$app_name,app.kubernetes.io/component=operator
argocd app wait -l app.kubernetes.io/part-of=$app_name,app.kubernetes.io/component=operator
argocd app sync -l app.kubernetes.io/part-of=$app_name