Skip to content

Commit

Permalink
finish hook
Browse files Browse the repository at this point in the history
Signed-off-by: Viktor Kramarenko <[email protected]>
  • Loading branch information
ViktorKram committed Aug 30, 2024
1 parent 05ab1b3 commit 70a88b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/go_modules_check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,34 +37,34 @@ jobs:
echo "Processing $go_mod_file"
while IFS= read -r line; do
if [[ "$line" == *github.com/deckhouse/sds-* || "$line" == *github.com/deckhouse/csi-* || "$line" == *github.com/deckhouse/virtualization ]]; then
if [[ ("$line" == *github.com/deckhouse/sds-* || "$line" == *github.com/deckhouse/csi-* || "$line" == *github.com/deckhouse/virtualization) && "$line" =~ *replace* ]]; then
repository=$(echo "$line" | awk '{print $1}' | awk -F'/' '{ print "https://"$1"/"$2"/"$3".git" }')
pseudo_tag=$(echo "$line" | awk '{print $2}')
echo "Cloning repo $repository into $temp_dir"
git clone "$repository" "$temp_dir/$repository" >/dev/null 2>&1
if [ -d "$temp_dir/$repository/api" ]; then
cd "$temp_dir/$repository" || continue
commit_info=$(git log -1 --pretty=format:"%H %cd" --date=iso-strict -- api/*)
short_hash=$(echo "$commit_info" | awk '{print substr($1,1,12)}')
commit_date=$(echo "$commit_info" | awk '{print $2}')
commit_date=$(date -u -d "$commit_date" +"%Y%m%d%H%M%S")
actual_pseudo_tag="v0.0.0-"$commit_date"-"$short_hash
pseudo_tag_date=$(echo $pseudo_tag | awk -F'-' '{ print $2 }')
echo "Latest commit in $repository: $short_hash $commit_date"
if [[ "$pseudo_tag_date" < "$commit_date" ]]; then
echo "Incorrect pseudo tag for repo $repository in file "$go_mod_file" (current: "$pseudo_tag", actual:"$actual_pseudo_tag")"
echo "Incorrect pseudo tag for repo $repository in file "$go_mod_file" (current: "$pseudo_tag", actual:"$actual_pseudo_tag")" >> $temp_dir"/incorrect_alert"
fi
cd - >/dev/null 2>&1
else
echo "No api directory in $repository"
fi
rm -rf "$temp_dir/$repository"
fi
done < "$go_mod_file"
Expand All @@ -75,4 +75,4 @@ jobs:
if [ $alert_lines_count != 0 ]; then
echo "We have non-actual pseudo-tags in repository's go.mod files"
exit 1
fi
fi
9 changes: 6 additions & 3 deletions images/agent/werf.inc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,18 @@ from: {{ $.BASE_GOLANG_22_ALPINE }}
final: false

git:
- add: /images/agent/src
to: /src
- add: /
to: /
includePaths:
- api
- images/agent/src
stageDependencies:
setup:
- "**/*"

shell:
setup:
- cd /src/cmd
- cd /images/agent/src/cmd
- GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o /sds-node-configurator-agent
- chmod +x /sds-node-configurator-agent

Expand Down

0 comments on commit 70a88b3

Please sign in to comment.