Skip to content

뭐냐 왜 test는 인식 잘 하냐 #9

뭐냐 왜 test는 인식 잘 하냐

뭐냐 왜 test는 인식 잘 하냐 #9

Workflow file for this run

name: Deployment
on:
push
jobs:
deploy:
name: Deploy
runs-on: self-hosted
steps:
- uses: actions/checkout@v4
- name: is the github action running
run: echo "asdasd" >> by_the_github_action.txt
- name: Change to repository root directory
run: cd $GITHUB_WORKSPACE
- name: stop and remove the previous container
run: |
docker stop HeXA_Homepage_Backend
docker container rm HeXA_Homepage_Backend
- name: build docker image
env:
Vault_Token: ${{ secrets.VAULT_TOKEN }}
run: docker build . --file dockerfile -t HeXA_Homepage_Backend:${GITHUB_REF#refs/tags/} --build-arg VAULT_TOKEN=${{Vault_Token}}

Check failure on line 30 in .github/workflows/test.yml

View workflow run for this annotation

GitHub Actions / Deployment

Invalid workflow file

The workflow is not valid. .github/workflows/test.yml (Line: 30, Col: 14): Unrecognized named-value: 'Vault_Token'. Located at position 1 within expression: Vault_Token
- name: run and test
run: |
docker run -d -p 8282:8080 --name HeXA_Homepage_Backend HeXA_Homepage_Backend
test_result="$(docker exec HeXA_Homepage_Backend ./gradlew test)"
second_last_line="$(echo "$test_result" | tail -n 2 | head -n 1)"
if [[ "$second_last_line" =~ ^BUILD\ SUCCESSFUL ]]; then
echo "TEST SUCCESSFUL"
else
docker stop HeXA_Homepage_Backend
docker container rm HeXA_Homepage_Backend
last_version=$(docker images | grep 'HeXA_Homepage_Backend' | awk '{print $2}' | tail -n 2 | head -n 1)
docker run -d -p 8282:8080 --name HeXA_Homepage_Backend HeXA_Homepage_Backend:$last_version
echo "TEST FAILED"
fi