Try to build a Docker image

Adds password


Try accessing secrets


Try hard-coded URL


Try hard-coded values


Try again


Adds secrets


test


Removes unused locale generation


Completed repo name


a


b


c


d


e


f


debug


typo


g


h


test


Test in settings


testing double $s


Building manually


Fixes login?


a


b


hard-coded again


dot


Using variable


Adds docker socket as volume


try again


Testing docker image based mirroring


hard-coded registry


as


debugging


v2


t


d


tt


ttt


ttt


asdasdas


terst


test


test3


uff


Adapts old jobs
This commit is contained in:
Maximilian Kratz 2023-01-15 15:13:44 +01:00
parent ae5618647a
commit 8c289528ac
2 changed files with 51 additions and 18 deletions

View file

@ -3,52 +3,68 @@ clone:
image: plugins/git
depth: 1
# Define a temporary volume for communicating with the DIND service.
.dockervol: &dockervol
volumes:
- /var/run/docker.sock:/var/run/docker.sock
variables:
- &image 'debian:latest'
- &secrets
- GITEA_URL
- ACCESS_TOKEN
- GITHUB_TOKEN
- &setup 'apt-get update -q && apt-get install -yq curl jq wget'
- &setup_script 'wget https://raw.githubusercontent.com/maxkratz/github2gitea-mirror/master/github2gitea-mirror'
- &docker_registry staging.forgejo.dev
- &docker_image staging.forgejo.dev/${CI_REPO_OWNER}/${CI_REPO_NAME}:latest
pipeline:
github-personal:
image: *image
publish-docker-image:
# Uses a custom DIND job instead of the plugin because of
# the dynamic setting of the registry from secrets.
image: docker:dind
secrets:
- DOCKER_PASSWORD
commands:
- docker login $docker_registry -u ${CI_REPO_OWNER} -p $DOCKER_PASSWORD
- docker build -t $docker_image .
- docker push $docker_image
# Needs 'trusted' privileges
<<: *dockervol
environment:
docker_registry: *docker_registry
docker_image: *docker_image
github-personal:
image: *docker_image
commands:
- *setup
- *setup_script
- /bin/bash github2gitea-mirror -m user -u maxkratz
secrets: *secrets
# github-starred:
# image: *image
# commands:
# - *setup
# - *setup_script
# - /bin/bash github2gitea-mirror -m star -u maxkratz -o github-starred
# secrets: *secrets
# github-starred:
# image: *docker_image
# commands:
# - *setup_script
# - /bin/bash github2gitea-mirror -m star -u maxkratz -o github-starred
# secrets: *secrets
hipe-orga:
image: *image
image: *docker_image
commands:
- *setup
- *setup_script
- /bin/bash github2gitea-mirror -m org -o HiPE-DevOps -v public -u maxkratz
secrets: *secrets
emoflon-orga:
image: *image
image: *docker_image
commands:
- *setup
- *setup_script
- /bin/bash github2gitea-mirror -m org -o eMoflon -v public -u maxkratz
secrets: *secrets
echtzeitsysteme-orga:
image: *image
image: *docker_image
commands:
- *setup
- *setup_script
- /bin/bash github2gitea-mirror -m org -o Echtzeitsysteme -v public -u maxkratz
secrets: *secrets

17
Dockerfile Normal file
View file

@ -0,0 +1,17 @@
#
# Base image
#
# Use Debian (stable)
FROM debian:stable
LABEL maintainer="Max Kratz <account@maxkratz.com>"
ENV DEBIAN_FRONTEND=noninteractive
# Update and install various packages
RUN apt-get update -q && apt-get upgrade -yq
RUN apt-get install -yq curl jq wget
# Remove apt lists (for storage efficiency)
RUN rm -rf /var/lib/apt/lists/*
CMD ["bash"]