File tree Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Expand file tree Collapse file tree 4 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1
1
set -xeo pipefail
2
2
# extract the PR number from the PR link
3
3
PR_NUM=${CODEBUILD_WEBHOOK_TRIGGER##*/ }
4
+ PROJECT_USERNAME=aws-amplify
5
+ REPO_NAME=amplify-codegen
4
6
5
7
if [ -z " $PR_NUM " ]; then
6
8
echo " Could not determine PR number. Cannot determine fork point for linting. Skipping linting."
Original file line number Diff line number Diff line change 1
1
#! /bin/bash -e
2
2
3
+ if [[ " $CODEBUILD_WEBHOOK_TRIGGER " == " pr/" * ]]; then
4
+ BRANCH_NAME=${CODEBUILD_WEBHOOK_BASE_REF##*/ }
5
+ fi
6
+
3
7
if [ -z " $BRANCH_NAME " ]; then
4
8
echo " BRANCH_NAME is missing"
5
9
exit 1
Original file line number Diff line number Diff line change @@ -19,19 +19,19 @@ function buildModels() {
19
19
20
20
cd ${tempDirectory} /models
21
21
for model in * /; do
22
+ cd ${tempDirectory} /models/$model
22
23
echo " Building model $model "
23
- buildAndRunModel $model $ pathToSwiftPackage
24
+ buildAndRunModel $pathToSwiftPackage
24
25
done
25
26
}
26
27
27
28
function buildAndRunModel() {
28
- modelName=$1
29
- pathToSwiftPackage=$2
29
+ pathToSwiftPackage=$1
30
30
31
31
# copy with replace all model files to the swift package
32
32
mkdir -p $pathToSwiftPackage /Sources/models
33
33
rm -rf $pathToSwiftPackage /Sources/models/*
34
- cp -r $modelName /* $pathToSwiftPackage /Sources/models
34
+ cp -r . /* $pathToSwiftPackage /Sources/models
35
35
ls $pathToSwiftPackage /Sources/models
36
36
37
37
# build and run the model
Original file line number Diff line number Diff line change @@ -115,11 +115,16 @@ function _publishToLocalRegistry {
115
115
echo " Publish To Local Registry"
116
116
loadCacheFromBuildJob
117
117
if [ -z " $BRANCH_NAME " ]; then
118
- export BRANCH_NAME=" $( git symbolic-ref HEAD --short 2> /dev/null) "
119
- if [ " $BRANCH_NAME " = " " ] ; then
120
- BRANCH_NAME=" $( git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed ' s/remotes\/origin\///g' ) " ;
118
+ if [ -z " $CODEBUILD_WEBHOOK_TRIGGER " ]; then
119
+ export BRANCH_NAME=" $( git symbolic-ref HEAD --short 2> /dev/null) "
120
+ if [ " $BRANCH_NAME " = " " ] ; then
121
+ BRANCH_NAME=" $( git rev-parse HEAD | xargs git name-rev | cut -d' ' -f2 | sed ' s/remotes\/origin\///g' ) " ;
122
+ fi
123
+ elif [[ " $CODEBUILD_WEBHOOK_TRIGGER " == " pr/" * ]]; then
124
+ export BRANCH_NAME=${CODEBUILD_WEBHOOK_BASE_REF##*/ }
121
125
fi
122
126
fi
127
+ echo $BRANCH_NAME
123
128
git checkout $BRANCH_NAME
124
129
125
130
# Fetching git tags from upstream
You can’t perform that action at this time.
0 commit comments