Stubbing out very rough gitlab ci
This commit is contained in:
@@ -1,38 +1,66 @@
|
|||||||
docker-build:
|
stages:
|
||||||
# Use the official docker image.
|
- dind-build
|
||||||
# image: docker:latest
|
|
||||||
stage: build
|
before_script:
|
||||||
# services:
|
- dnf install -y podman-docker
|
||||||
# - docker:dind
|
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
|
||||||
|
# docker-build:
|
||||||
|
# # Use the official docker image.
|
||||||
|
# # image: docker:latest
|
||||||
|
# stage: build
|
||||||
|
# # services:
|
||||||
|
# # - docker:dind
|
||||||
|
# tags:
|
||||||
|
# - big-build
|
||||||
|
# before_script:
|
||||||
|
# - dnf install -y podman-docker
|
||||||
|
# - docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
||||||
|
# # Default branch leaves tag empty (= latest tag)
|
||||||
|
# # All other branches are tagged with the escaped branch name (commit ref slug)
|
||||||
|
# script:
|
||||||
|
# - |
|
||||||
|
# if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
|
||||||
|
# tag=""
|
||||||
|
# echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
|
||||||
|
# else
|
||||||
|
# tag=":$CI_COMMIT_REF_SLUG"
|
||||||
|
# echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
|
||||||
|
# fi
|
||||||
|
# - docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
|
||||||
|
# - docker push "$CI_REGISTRY_IMAGE${tag}"
|
||||||
|
# # Run this job in a branch where a Dockerfile exists
|
||||||
|
# rules:
|
||||||
|
# - if: $CI_COMMIT_BRANCH
|
||||||
|
# exists:
|
||||||
|
# - Dockerfile
|
||||||
|
|
||||||
|
|
||||||
|
build:prereleases:
|
||||||
|
stage: dind-build
|
||||||
tags:
|
tags:
|
||||||
- big-build
|
- big-build
|
||||||
before_script:
|
|
||||||
- dnf install -y podman-docker
|
|
||||||
- docker login -u "$CI_REGISTRY_USER" -p "$CI_REGISTRY_PASSWORD" $CI_REGISTRY
|
|
||||||
# Default branch leaves tag empty (= latest tag)
|
|
||||||
# All other branches are tagged with the escaped branch name (commit ref slug)
|
|
||||||
script:
|
script:
|
||||||
- |
|
- export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum]_.-' '-')
|
||||||
if [[ "$CI_COMMIT_BRANCH" == "$CI_DEFAULT_BRANCH" ]]; then
|
- docker build --pull -t "$CI_REGISTRY_IMAGE:CI_PROJECT_NAME-$IMAGE_TAG" .
|
||||||
tag=""
|
- docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG"
|
||||||
echo "Running on default branch '$CI_DEFAULT_BRANCH': tag = 'latest'"
|
only:
|
||||||
else
|
- branches
|
||||||
tag=":$CI_COMMIT_REF_SLUG"
|
except:
|
||||||
echo "Running on branch '$CI_COMMIT_BRANCH': tag = $tag"
|
- main
|
||||||
fi
|
|
||||||
- docker build --pull -t "$CI_REGISTRY_IMAGE${tag}" .
|
|
||||||
- docker push "$CI_REGISTRY_IMAGE${tag}"
|
|
||||||
# Run this job in a branch where a Dockerfile exists
|
|
||||||
rules:
|
|
||||||
- if: $CI_COMMIT_BRANCH
|
|
||||||
exists:
|
|
||||||
- Dockerfile
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
build:releases:
|
||||||
|
stage: dind-build
|
||||||
|
tags:
|
||||||
|
- big-build
|
||||||
|
script:
|
||||||
|
- export IMAGE_TAG=$(echo -en $CI_COMMIT_REF_NAME | tr -c '[:alnum]_.-' '-')
|
||||||
|
- docker build --pull -t "$CI_REGISTRY_IMAGE:CI_PROJECT_NAME-$IMAGE_TAG" .
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG"
|
||||||
|
- docker tag "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-$IMAGE_TAG" "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-latest"
|
||||||
|
- docker push "$CI_REGISTRY_IMAGE:$CI_PROJECT_NAME-latest"
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
|
||||||
|
|
||||||
# image: fedora:latest
|
# image: fedora:latest
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
FROM registry.fedoraproject.org/fedora:latest
|
FROM quay.io/podman/stable:latest
|
||||||
|
|
||||||
|
RUN dnf install -y podman-docker buildah skopeo
|
||||||
Reference in New Issue
Block a user