Commits (8)
......@@ -50,7 +50,7 @@ In your gitlab project, go to _Settings / CI/CD / Variables_, and set these keys
```
*PHUSER:* Pantahub user that owns the to-be-updated devices.
*PHPASS:* Pantahub password.
*CI_BUILD_TOKEN:* GitLab token with writing permissions over your project.
*PERSONAL_ACCESS_TOKEN:* GitLab token with writing permissions over your project.
*AWS_ACCESS_KEY_ID:* Amazon AWS access ID.
*AWS_SECRET_ACCESS_KEY:* Amazon AWS secret key.
*AWS_BUCKET:* Amazon AWS bucket name.
......@@ -76,7 +76,7 @@ To start using the pvdeps-ci template, just import it in your project:
```
include:
project: 'pantacor/ci/device-ci'
ref: 011
ref: '011'
file: '/yml/pvdeps-ci.yml'
```
......@@ -106,7 +106,7 @@ To start using the bsp-ci template, just import it in your project:
```
include:
project: 'pantacor/ci/device-ci'
ref: 011
ref: '011'
file: '/yml/bsp-ci.yml'
```
......
......@@ -51,6 +51,7 @@ case "$op" in
fi
# take sha current submodule
git add device-ci
submodule_status=`git submodule status | grep device-ci`
submodule_status_array=($submodule_status)
submodule_sha=${submodule_status_array[0]}
......
......@@ -127,14 +127,7 @@ push-metadata:
- PLATFORM=`cat bsp/build.json | jq -r .platform`
- TARGET=`cat bsp/build.json | jq -r .target`
- PV_MANIFEST_COMMIT=`cat bsp/build.json | jq -r .commit`
# post scheduled device to stable
- echo "Posting updated device to $PH_BASE_URL/$PHUSER/$PH_STABLE_DEVICE"
- test "$DEPLOY" = "no" && echo "Deploy will not be done"
- test "$DEPLOY" = "no" || POST_RESPONSE=$(pvr -a $TOKEN post -m "auto commit for $CI_COMMIT_TAG from job $CI_PIPELINE_ID" $PH_BASE_URL/$PHUSER/$PH_STABLE_DEVICE | grep Revision)
- test "$DEPLOY" = "no" || REFERENCE_REVISION=$(echo $POST_RESPONSE | sed -e 's/.*Revision \(.*\) (.*/\1/')
- test "$DEPLOY" = "no" || REFERENCE_DEVICE=$PH_STABLE_DEVICE
- cd ..
- "echo \"Reference device: $PH_BASE_URL/$PHUSER/$REFERENCE_DEVICE/$REFERENCE_REVISION\" > $CI_JOB_NAME.meta"
# exit if aws was not set
- test -z AWS_BUCKET_PATH && exit 0
# get source code
......@@ -143,6 +136,15 @@ push-metadata:
- until repo sync -j10; do echo "Sync failed, retrying..."; done;
# build
- PVR_MERGE_SRC=reference-device/.pvr PV_BUILD_INTERACIVE=false PANTAVISOR_DEBUG=yes PANTAVISOR_ACATPM=yes ./build.docker.sh $TARGET
# post scheduled device to stable
- cd out/$PLATFORM/trail/final/trails/0/
- echo "Posting updated device to $PH_BASE_URL/$PHUSER/$PH_STABLE_DEVICE"
- test "$DEPLOY" = "no" && echo "Deploy will not be done"
- test "$DEPLOY" = "no" || POST_RESPONSE=$(pvr -a $TOKEN post -m "auto commit for $CI_COMMIT_TAG from job $CI_PIPELINE_ID" $PH_BASE_URL/$PHUSER/$PH_STABLE_DEVICE | grep Revision)
- test "$DEPLOY" = "no" || REFERENCE_REVISION=$(echo $POST_RESPONSE | sed -e 's/.*Revision \(.*\) (.*/\1/')
- test "$DEPLOY" = "no" || REFERENCE_DEVICE=$PH_STABLE_DEVICE
- "echo \"Reference device: $PH_BASE_URL/$PHUSER/$REFERENCE_DEVICE/$REFERENCE_REVISION\" > $CI_JOB_NAME.meta"
- cd -
# prepare img and metadata
- mkdir pipeline
- mv out/$PLATFORM/*.img pipeline/$PH_STABLE_DEVICE.img
......