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:
parent
ae5618647a
commit
8c289528ac
2 changed files with 51 additions and 18 deletions
|
@ -3,52 +3,68 @@ clone:
|
||||||
image: plugins/git
|
image: plugins/git
|
||||||
depth: 1
|
depth: 1
|
||||||
|
|
||||||
|
# Define a temporary volume for communicating with the DIND service.
|
||||||
|
.dockervol: &dockervol
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- &image 'debian:latest'
|
|
||||||
- &secrets
|
- &secrets
|
||||||
- GITEA_URL
|
- GITEA_URL
|
||||||
- ACCESS_TOKEN
|
- ACCESS_TOKEN
|
||||||
- GITHUB_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'
|
- &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:
|
pipeline:
|
||||||
github-personal:
|
publish-docker-image:
|
||||||
image: *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:
|
commands:
|
||||||
- *setup
|
|
||||||
- *setup_script
|
- *setup_script
|
||||||
- /bin/bash github2gitea-mirror -m user -u maxkratz
|
- /bin/bash github2gitea-mirror -m user -u maxkratz
|
||||||
secrets: *secrets
|
secrets: *secrets
|
||||||
|
|
||||||
# github-starred:
|
# github-starred:
|
||||||
# image: *image
|
# image: *docker_image
|
||||||
# commands:
|
# commands:
|
||||||
# - *setup
|
# - *setup_script
|
||||||
# - *setup_script
|
# - /bin/bash github2gitea-mirror -m star -u maxkratz -o github-starred
|
||||||
# - /bin/bash github2gitea-mirror -m star -u maxkratz -o github-starred
|
# secrets: *secrets
|
||||||
# secrets: *secrets
|
|
||||||
|
|
||||||
hipe-orga:
|
hipe-orga:
|
||||||
image: *image
|
image: *docker_image
|
||||||
commands:
|
commands:
|
||||||
- *setup
|
|
||||||
- *setup_script
|
- *setup_script
|
||||||
- /bin/bash github2gitea-mirror -m org -o HiPE-DevOps -v public -u maxkratz
|
- /bin/bash github2gitea-mirror -m org -o HiPE-DevOps -v public -u maxkratz
|
||||||
secrets: *secrets
|
secrets: *secrets
|
||||||
|
|
||||||
emoflon-orga:
|
emoflon-orga:
|
||||||
image: *image
|
image: *docker_image
|
||||||
commands:
|
commands:
|
||||||
- *setup
|
|
||||||
- *setup_script
|
- *setup_script
|
||||||
- /bin/bash github2gitea-mirror -m org -o eMoflon -v public -u maxkratz
|
- /bin/bash github2gitea-mirror -m org -o eMoflon -v public -u maxkratz
|
||||||
secrets: *secrets
|
secrets: *secrets
|
||||||
|
|
||||||
echtzeitsysteme-orga:
|
echtzeitsysteme-orga:
|
||||||
image: *image
|
image: *docker_image
|
||||||
commands:
|
commands:
|
||||||
- *setup
|
|
||||||
- *setup_script
|
- *setup_script
|
||||||
- /bin/bash github2gitea-mirror -m org -o Echtzeitsysteme -v public -u maxkratz
|
- /bin/bash github2gitea-mirror -m org -o Echtzeitsysteme -v public -u maxkratz
|
||||||
secrets: *secrets
|
secrets: *secrets
|
||||||
|
|
17
Dockerfile
Normal file
17
Dockerfile
Normal 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"]
|
Loading…
Reference in a new issue