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: remove-old-services:
stage: prepare stage: prepare
script: script:
- podman stop little-lines - systemctl --user stop little-lines-frontend
- podman rm little-lines - podman rm --force little-lines-frontend
- cp little-lines-frontend.container ~/.config/containers/systemd
- systemctl --user daemon-reload
container-build: container-build:
stage: build stage: build
script: script:
- sed -i "s/DATE/$(date -I)/g" ${CI_PROJECT_DIR}/src/views/About.vue - 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 - 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: container-deploy:
stage: deploy stage: deploy
script: script:
- podman run --name little-lines -p 8081:80 -d little-lines - systemctl --user start little-lines-frontend
- podman generate systemd little-lines > ~/.config/systemd/user/little-lines.service
- systemctl --user daemon-reload
- systemctl --user enable little-lines

View file

@ -1,16 +1,16 @@
FROM nginx:alpine FROM alpine
# Set up environment for building # Set up environment for building
RUN apk add yarn nodejs RUN apk add yarn nodejs
# Copy files to build environment # Copy files to build environment
RUN mkdir /opt/micromobility-navigation RUN mkdir /opt/little-lines-frontend
COPY . /opt/micromobility-navigation COPY . /opt/little-lines-frontend
# Run Vite production build # Run Vite production build
WORKDIR /opt/micromobility-navigation WORKDIR /opt/little-lines-frontend
RUN yarn RUN yarn
RUN yarn run build CMD yarn dev
# Copy files to nginx path # 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