Skip to content

Commit 1cd9026

Browse files
committed
feat: add pipeline callback to local deployment
Signed-off-by: Simone Tollardo <[email protected]>
1 parent 4e54269 commit 1cd9026

File tree

5 files changed

+15
-1
lines changed

5 files changed

+15
-1
lines changed

localinstall/.env-api

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SECRET_KEY=b6451545d2e4635148d768f07877aade3ad8e7e160d52962badd7587a4b9a150
1+
#SECRET_KEY=
22
#algorithm=
33
#access_token_expire_minutes=
44
SMTP_HOST=localhost

localinstall/2-install_api.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ cp .env-api kernelci/kernelci-api/.env
2020
cp api-configs.yaml kernelci/kernelci-core/config/core/
2121
cp kernelci-cli.toml kernelci/kernelci-core/kernelci.toml
2222

23+
sed -i "s/#SECRET_KEY=/SECRET_KEY=${API_SECRET_KEY}/" kernelci/kernelci-api/.env
24+
2325
cd kernelci/kernelci-api
2426
mkdir -p docker/redis/data
2527
${SUDO} chmod -R 0777 docker/storage/data

localinstall/3-install_pipeline.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,12 @@ echo "KCI_API_TOKEN=${API_TOKEN}" >> .env
9191
echo "API_TOKEN=${API_TOKEN}" >> .env
9292
cp .env kernelci/kernelci-pipeline/.docker-env
9393
mv .env kernelci/kernelci-pipeline/.env
94+
95+
# Add JWT section with the secret key to kernelci.toml for pipeline callback
96+
sed -i 's/#\[jwt\]$/[jwt]/' kernelci/kernelci-pipeline/config/kernelci.toml
97+
sed -i 's/#secret = "SomeSecretString"/secret = "'"${PIPELINE_SECRET_KEY}"'"/' kernelci/kernelci-pipeline/config/kernelci.toml
98+
# Generate kci-dev token
99+
TOKEN=$(kernelci/kernelci-pipeline/tools/jwt_generator.py --toml kernelci/kernelci-pipeline/config/kernelci.toml \
100+
--email ${YOUR_EMAIL} --permissions checkout,testretry,patchset | grep "JWT token:" | cut -d' ' -f3)
101+
echo $TOKEN > kci-dev-token.txt
102+
echo "kci-dev token saved to kci-dev-token.txt"

localinstall/4-start-cycle.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ fi
1212
cd kernelci/kernelci-pipeline
1313
${DOCKER_COMPOSE} down
1414
${DOCKER_COMPOSE} up -d
15+
1516
echo "You can view now logs of containers using docker logs -f <container_id> or docker-compose logs -f in kernelci/kernelci-pipeline or kernelci/kernelci-api directories"
1617
echo "Also you can do docker ps to see running containers, and in case of ongoing builds, you can view their logs too by docker logs -f <container_id>"
1718
echo "You can also open API viewer at http://127.0.0.1:8001/viewer"

localinstall/main.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ KCI_PIPELINE_BRANCH=staging.kernelci.org
88
99
ADMIN_PASSWORD="Ch4n93m3HpL33z"
1010
STORAGE_TOKEN="FKDFLKJFLKDJFLK"
11+
PIPELINE_SECRET_KEY="0123456789"
12+
API_SECRET_KEY="9876543210"
1113
#KCI_CACHE=1

0 commit comments

Comments
 (0)