This repository has been archived on 2024-07-10. You can view files and clone it, but cannot push or open issues or pull requests.
frontend/.gitlab-ci.yml

29 lines
1.1 KiB
YAML
Raw Normal View History

2023-07-30 16:13:47 +00:00
stages: # List of stages for jobs, and their order of execution
2023-07-30 17:10:01 +00:00
- prepare
2023-07-30 16:13:47 +00:00
- build
- deploy
2023-07-30 17:10:01 +00:00
remove-old-services: # This job runs in the build stage, which runs first.
stage: prepare
2023-07-30 16:13:47 +00:00
script:
2023-07-30 17:10:01 +00:00
- podman stop little-lines
- podman rm little-lines
2023-07-30 16:13:47 +00:00
2023-07-30 17:10:01 +00:00
apply-version-tag:
stage: prepare
2023-07-30 16:13:47 +00:00
script:
2023-07-30 17:49:48 +00:00
- sed -i "s/DATE/$(date -I)/g" ${CI_PROJECT_DIR}/src/views/Setting.vue
- sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" ${CI_PROJECT_DIR}/src/views/Setting.vue
2023-07-30 16:13:47 +00:00
2023-07-30 17:10:01 +00:00
build-job: # This job runs in the test stage.
stage: build # It only starts when the job in the build stage completes successfully.
2023-07-30 16:13:47 +00:00
script:
2023-07-30 17:10:01 +00:00
- podman build -t little-lines:$(git log -1 --oneline | awk '{print $1}') .
2023-07-30 16:13:47 +00:00
deploy-job: # This job runs in the deploy stage.
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
script:
2023-07-30 17:21:52 +00:00
- podman run --name little-lines -p 8081:80 -d little-lines:$(git log -1 --oneline | awk '{print $1}')
- podman generate systemd little-lines > ~/.config/systemd/user/little-lines.service
- systemctl --user daemon-reload
- systemctl --user enable little-lines