upgrade CI to Quadlets

This commit is contained in:
Late Night Defender 2023-11-12 16:42:46 +07:00
parent 53b593086c
commit 56fc6bca3c
3 changed files with 25 additions and 13 deletions

View file

@ -6,20 +6,19 @@ stages:
remove-old-services:
stage: prepare
script:
- podman stop little-lines
- podman rm little-lines
- systemctl --user stop little-lines-frontend
- podman rm --force little-lines-frontend
- cp little-lines-frontend.container ~/.config/containers/systemd
- systemctl --user daemon-reload
container-build:
stage: build
script:
- sed -i "s/DATE/$(date -I)/g" ${CI_PROJECT_DIR}/src/views/About.vue
- sed -i "s/VERSION/$(git log -1 --oneline | awk '{print $1}')/g" ${CI_PROJECT_DIR}/src/views/About.vue
- podman build -t little-lines .
- podman build -t little-lines-frontend .
container-deploy:
stage: deploy
script:
- podman run --name little-lines -p 8081:80 -d little-lines
- podman generate systemd little-lines > ~/.config/systemd/user/little-lines.service
- systemctl --user daemon-reload
- systemctl --user enable little-lines
- systemctl --user start little-lines-frontend

View file

@ -1,16 +1,16 @@
FROM nginx:alpine
FROM alpine
# Set up environment for building
RUN apk add yarn nodejs
# Copy files to build environment
RUN mkdir /opt/micromobility-navigation
COPY . /opt/micromobility-navigation
RUN mkdir /opt/little-lines-frontend
COPY . /opt/little-lines-frontend
# Run Vite production build
WORKDIR /opt/micromobility-navigation
WORKDIR /opt/little-lines-frontend
RUN yarn
RUN yarn run build
CMD yarn dev
# Copy files to nginx path
RUN cp -r dist/* icons /usr/share/nginx/html
#RUN cp -r dist/* icons /usr/share/nginx/html

View file

@ -0,0 +1,13 @@
[Unit]
Description=Little Lines frontend container
[Container]
ContainerName=little-lines-frontend
Image=localhost/little-lines-frontend
PublishPort=8081:5173
[Service]
Restart=always
[Install]
WantedBy=multi-user.target default.target