Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions node-service/content/.devcontainer/installMoreTools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ curl -Lo ./kind https://kind.sigs.k8s.io/dl/${KIND_VERSION}/kind-linux-amd64
chmod +x ./kind
sudo mv ./kind /usr/local/bin/kind

sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq
sudo chmod +x /usr/bin/yq

cd ..
rm -rf install-more-tools
42 changes: 42 additions & 0 deletions node-service/content/.github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,40 @@ jobs:
- uses: humanitec/setup-cli-action@v1
with:
version: ${{ env.HUMCTL_VERSION }}
- name: humctl score validate - backstage
run: |
humctl score validate \
--token ${{ secrets.HUMANITEC_TOKEN }} \
--org ${{ vars.HUMANITEC_ORG_ID }} \
--strict \
--extensions humanitec.score.yaml \
score.yaml
- name: install score-compose
uses: score-spec/setup-score@v3
with:
file: score-compose
token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- name: make compose-up
run: |
make compose-up
- name: make compose-test
run: |
make compose-test
- name: install score-k8s
uses: score-spec/setup-score@v3
with:
file: score-k8s
token: ${{ secrets.GITHUB_TOKEN }}
version: "latest"
- name: make k8s-up
run: |
make kind-create-cluster
make kind-load-image
make k8s-up
- name: make k8s-test
run: |
make k8s-test
- name: Create Humanitec Env
run: |
humctl create environment ${{ env.ENVIRONMENT_ID }} \
Expand Down Expand Up @@ -156,9 +190,17 @@ jobs:
--org ${{ vars.HUMANITEC_ORG_ID }} \
--app ${{ env.APP_NAME }} \
--env ${{ env.ENVIRONMENT_ID }} -o json)

echo "#### :white_check_mark: Successfully deployed with score-compose" >> pr_message.txt
echo "" >> pr_message.txt
echo "#### :white_check_mark: Successfully deployed with score-k8s" >> pr_message.txt
echo "" >> pr_message.txt

if [ "$DEPLOYMENT_ERRORS" = "[]" ]; then
echo "## Deployment successfully completed for ${{ env.ENVIRONMENT_NAME }}! :tada:" >> pr_message.txt
echo "" >> pr_message.txt
echo "#### :white_check_mark: Successfully deployed with humctl" >> pr_message.txt
echo "" >> pr_message.txt
else
echo "## Deployment failed for ${{ env.ENVIRONMENT_NAME }}! :x:" >> pr_message.txt
echo "" >> pr_message.txt
Expand Down
1 change: 1 addition & 0 deletions node-service/content/.gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
.score-compose/
compose.yaml
compose.override.yaml
.score-k8s/
manifests.yaml
6 changes: 5 additions & 1 deletion node-service/content/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ compose.yaml: score.yaml .score-compose/state.yaml Makefile
--build '${CONTAINER_NAME}={"context":".","tags":["${CONTAINER_IMAGE}"]}' \
--override-property containers.${CONTAINER_NAME}.variables.MESSAGE="Hello, Compose!"

compose.override.yaml:
echo '{"services":{"${WORKLOAD_NAME}-${CONTAINER_NAME}":{"read_only":"true","user":"65532","cap_drop":["ALL"]}}}' | yq e -P > compose.override.yaml

## Generate a compose.yaml file from the score spec and launch it.
.PHONY: compose-up
compose-up: compose.yaml
compose-up: compose.yaml compose.override.yaml
docker compose up --build -d --remove-orphans
sleep 5

Expand Down Expand Up @@ -65,6 +68,7 @@ k8s-up: manifests.yaml
kubectl apply \
-f manifests.yaml \
-n ${NAMESPACE}
sleep 5
kubectl wait deployments/${WORKLOAD_NAME} \
-n ${NAMESPACE} \
--for condition=Available \
Expand Down
Loading