-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (110 loc) · 5.11 KB
/
debug.yaml
File metadata and controls
124 lines (110 loc) · 5.11 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: debug
# Controls when the action will run. Triggers the workflow on push that updates a docker VERSION
# or pull request events for the master branch
on:
# push:
# branches:
# - 'main'
pull_request:
branches: [ main ]
types: [ closed ]
paths-ignore:
- README.md
- .gitignore
env:
ENVIRONMENT: dev
jobs:
directories:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
outputs:
new-all: ${{ steps.clusters.outputs.new-all }}
new-dev: ${{ steps.clusters.outputs.new-dev }}
new-test: ${{ steps.clusters.outputs.new-test }}
fileTrack: ${{ steps.files-tracker.outputs.files_updated }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: clusters
run: |
# echo "::set-output name=new-all::$( git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r ${{ github.event.pull_request.head.sha }} |grep -i new |grep -iv ".github" |grep -iv .md |grep -iv images |grep -iv examples | jq -R -s -c 'split("\n")[:-1]')"
#echo "::set-output name=new-all::$( git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r ${{ github.event.pull_request.head.sha }} |grep -i new |grep -iv ".github" |grep -iv .md |grep -iv images |grep -iv examples | jq -R -s -c 'split("\n")[:-1]')"
#echo "::set-output name=new-dev::$( git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r ${{ github.event.pull_request.head.sha }} |grep -i new |grep -i egdp-dev |grep -iv ".github" |grep -iv .md |grep -iv images |grep -iv examples | jq -R -s -c 'split("\n")[:-1]')"
echo "::set-output name=new-test::$( git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r ${{ github.event.pull_request.head.sha }} |grep -i new |grep -i egdp-test |grep -iv ".github" |grep -iv .md |grep -iv images |grep -iv examples | jq -R -s -c 'split("\n")[:-1]')"
echo "::set-output name=new-all::$(git diff --name-only master... | grep -i new | grep -iv ".github" |grep -iv .md |grep -iv images |grep -iv examples | jq -R -s -c 'split("\n")[:-1]')"
echo "::set-output name=new-dev::$( git diff --name-only master... | grep -i new |grep -i egdp-dev |grep -iv ".github" |grep -iv .md |grep -iv images |grep -iv examples | jq -R -s -c 'split("\n")[:-1]')"
- name: Checking Components and Dirs
run: |
echo "All new files: ${{ steps.clusters.outputs.new-all }}"
echo "Dev new files: ${{ steps.clusters.outputs.new-dev }}"
echo "Test new files: ${{ steps.clusters.outputs.new-test }}"
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: echo commit sha
run: echo The commit sha is ${{ github.event.pull_request.head.sha }}
# - name: Changed Files Exporter
# id: files-tracker
# uses: umani/changed-files@v3.3.0
# with:
# repo-token: ${{ github.token }}
# pattern: '^.*\.(md|markdown)$'
# - name: debug file track var
# run: echo ${{ steps.files-tracker.outputs.files_updated }}
- name: debug
run: echo this base sha ${{ github.event.pull_request.base.sha }}
commit-info:
needs: [ directories ]
name: Gathering commit information
runs-on: ubuntu-latest
if: ${{ needs.directories.outputs.new-all != '[]' }}
outputs:
envi_name: ${{ steps.install_env.outputs.env_name }}
cluster_name: ${{ steps.generate_cluster_name.outputs.cluster }}
is_cluster_name_generated: ${{ steps.is_generated.outputs.generated }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Checking for the installation envs
id: install_env
run: |
if [[ ${{ needs.directories.outputs.new-all }} == *"egdp-dev"* ]]; then
echo "::set-output name=is_dev_install::yes"
echo "::set-output name=env_name::dev"
fi
if [[ ${{ needs.directories.outputs.new-all }} == *"egdp-test"* ]]; then
echo "::set-output name=is_test_install::yes"
fi
- name: Checking the install envs
run: |
echo "Checking dev: ${{ steps.install_env.outputs.is_dev_install }}"
echo "Checking test: ${{ steps.install_env.outputs.is_test_install }}"
echo "Checking var: ${{ steps.install_env.outputs.env_name }}"
new-cluster-dev:
needs: [ directories, commit-info ]
name: ${{ needs.commit-info.output.envi_name }}
runs-on: ubuntu-latest
if: |
always() &&
contains( needs.directories.outputs.new-dev, 'egdp-dev' )
steps:
- name: Checkout
uses: actions/checkout@v2
- name: debug vars
run: echo cluster env is ==> ${{ needs.commit-info.outputs.envi_name }}
provisionDev:
name: Provision dev
runs-on: ubuntu-latest
needs: new-cluster-dev
environment:
name: veera.dev
steps:
# Checkout task
- name: Checkout
uses: actions/checkout@v1
- name: debug vars
run: echo "Hi kali , you test is passed"
- name: debug env
run: env