a new approach with less docker fiddeling and more gitlab ci

This commit is contained in:
Micha Gläß-Stöcker 2021-08-23 22:13:46 +02:00
parent 7fb882b61d
commit 85cbd66c19

View file

@ -3,13 +3,35 @@ image: egon0/docker-with-buildx-and-git
variables: variables:
DOCKER_HOST: tcp://docker:2375/ DOCKER_HOST: tcp://docker:2375/
DOCKER_DRIVER: overlay2 DOCKER_DRIVER: overlay2
DOCKER_TLS_CERTDIR: "" DOCKER_TLS_CERTDIR: ''
services: services:
- docker:dind - docker:dind
build: build_collect:
stage: build stage: build
image: python:bullseye
script:
- git clone https://github.com/sudhanshu16/openwrt-firmware-selector.git
- cd openwrt-firmware-selector
- python ./scripts/collect.py --image-url 'https://downloads.openwrt.org/{base}/{target}' https://downloads.openwrt.org ./src ./public/
artifacts:
name: 'public_${CI_COMMIT_REF_NAME}'
paths:
- public/
- src/
build_static:
stage: build
image: node:lts-alpine
script:
- ls -lha
- cat ./src/config.ts
dependencies:
- build_collect
deploy_docker:
stage: deploy
variables: variables:
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
D_IMAGE_TAG: egon0/openwrt-firmware-selector-multiarch:$CI_COMMIT_REF_SLUG D_IMAGE_TAG: egon0/openwrt-firmware-selector-multiarch:$CI_COMMIT_REF_SLUG
@ -17,5 +39,5 @@ build:
script: script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD
- docker buildx create --use --name A$CI_COMMIT_SHORT_SHA #- docker buildx create --use --name A$CI_COMMIT_SHORT_SHA
- docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE_TAG -t $CI_REGISTRY_IMAGE:latest -t $D_IMAGE_TAG -t $D_LATEST_TAG . #- docker buildx build --platform $BUILD_PLATFORMS --push -t $IMAGE_TAG -t $CI_REGISTRY_IMAGE:latest -t $D_IMAGE_TAG -t $D_LATEST_TAG .