Skip to content

Commit

Permalink
Update open-pr.yml - --workload-source-url (#100)
Browse files Browse the repository at this point in the history
* Update open-pr.yml - --workload-source-url

* Create score-with-env-values.yaml

* Update open-pr.yml

* Update open-pr.yml

* Update open-pr.yml

* Update open-pr.yml - github.head_ref
  • Loading branch information
mathieu-benoit authored Feb 18, 2024
1 parent a9833d1 commit 74e17cf
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/open-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ jobs:
version: ${{ env.SCORE_COMPOSE_VERSION }}
- name: generate docker compose files
run: |
docker build -t ${{ env.IMAGE_NAME }}:${{ env.ENVIRONMENT_ID }} app/
score-compose run \
--build app/ \
-f score/score.yaml \
-o ${{ env.WORKLOAD_NAME }}-compose.yaml
cat <<EOF > base-compose.yaml
-o compose.yaml
cat <<EOF > compose.override.yaml
services:
${{ env.WORKLOAD_NAME }}:
image: ${{ env.IMAGE_NAME }}:${{ env.ENVIRONMENT_ID }}
Expand All @@ -45,8 +46,6 @@ jobs:
- name: build & run container
run: |
docker compose \
-f ${{ env.WORKLOAD_NAME }}-compose.yaml \
-f base-compose.yaml \
up \
--build \
-d \
Expand Down Expand Up @@ -184,6 +183,7 @@ jobs:
--extensions score/humanitec.score.yaml \
--message "$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "${{ github.event.pull_request.commits_url }}?per_page=10" | jq -r .[-1].commit.message)" \
--image ${{ env.IMAGE_NAME }}@${IMAGE_DIGEST} \
--workload-source-url "https://github.com/${{ github.repository }}/blob/${{ github.head_ref }}/score/score.yaml" \
| tee score_output.json
- name: wait for deployment
run: |
Expand Down
37 changes: 37 additions & 0 deletions score/score-with-env-values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
apiVersion: score.dev/v1b1
metadata:
name: my-sample-app
containers:
my-sample-app:
image: .
resources:
limits:
memory: "256Mi"
cpu: "250m"
requests:
memory: "64Mi"
cpu: "25m"
variables:
MESSAGE: "${resources.env.MESSAGE}"
POD_NAME: "${pod.metadata.name}"
NAMESPACE_NAME: "${pod.metadata.namespace}"
files:
- target: /app/config/appsettings.json
mode: "444"
content: "${resources.env.APP_SETTINGS}"
resources:
env:
type: environment
dns:
type: dns
route:
type: route
params:
host: ${resources.dns.host}
path: /
port: 8080
service:
ports:
tcp:
port: 8080
targetPort: 8080

0 comments on commit 74e17cf

Please sign in to comment.