REMOVE: clear old test
This commit is contained in:
@@ -1,44 +0,0 @@
|
|||||||
name: build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
runs-on: ubuntu
|
|
||||||
steps:
|
|
||||||
- name: Instalar y ejecutar Buildah
|
|
||||||
env:
|
|
||||||
NEXUS_USER: ${{ secrets.NEXUS_USER }}
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
echo "📦 Instalando Buildah"
|
|
||||||
sed -i 's|http://archive.ubuntu.com/ubuntu/|http://mirrors.kernel.org/ubuntu/|g' /etc/apt/sources.list
|
|
||||||
apt-get update -y -qq
|
|
||||||
apt-get install -y buildah
|
|
||||||
|
|
||||||
#echo "🔐 Configurando credenciales para el registro"
|
|
||||||
#echo "[[registry]]" > /etc/containers/registries.conf
|
|
||||||
#echo "prefix = \"nexus.rancherk3.duckdns.org\"" >> /etc/containers/registries.conf
|
|
||||||
#echo "location = \"nexus.rancherk3.duckdns.org\"" >> /etc/containers/registries.conf
|
|
||||||
#echo "insecure = true" >> /etc/containers/registries.conf
|
|
||||||
|
|
||||||
#echo "Iniciando sesión en el registro"
|
|
||||||
#echo $NEXUS_PASSWORD | buildah login -u $NEXUS_USER --password-stdin nexus.rancherk3.duckdns.org
|
|
||||||
|
|
||||||
export BUILDAH_ISOLATION=chroot
|
|
||||||
export STORAGE_DRIVER=vfs
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
|
||||||
|
|
||||||
echo "🚀 Construyendo imagen con Buildah"
|
|
||||||
buildah bud -f Dockerfile -t nexus.rancherk3.duckdns.org/tfm/microserviciospython:latest .
|
|
||||||
|
|
||||||
buildah tag nexus.rancherk3.duckdns.org/tfm/microserviciospython:latest nexus.rancherk3.duckdns.org/tfm/microserviciospython:${GITHUB_SHA}
|
|
||||||
|
|
||||||
echo "🚀 Subiendo imágenes"
|
|
||||||
buildah push nexus.rancherk3.duckdns.org/tfm/microserviciospython:latest
|
|
||||||
buildah push nexus.rancherk3.duckdns.org/tfm/microserviciospython:${GITHUB_SHA}
|
|
||||||
|
|
||||||
echo "✅ Imagen construida y subida exitosamente"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
name: Build docker container
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build image
|
|
||||||
runs-on: ubuntu
|
|
||||||
container:
|
|
||||||
image: gcr.io/kaniko-project/executor:debug
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- run: |
|
|
||||||
/kaniko/executor \
|
|
||||||
--context ${{ github.workspace }} \
|
|
||||||
--dockerfile Dockerfile \
|
|
||||||
--destination registry/imagen:tag
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
name: Workflow Example
|
|
||||||
|
|
||||||
on:
|
|
||||||
- push
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
Build and push image:
|
|
||||||
runs-on: ubuntu
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Setup QEMU
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Setup Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
with:
|
|
||||||
driver-opts: network=host
|
|
||||||
|
|
||||||
- name: Login to registry
|
|
||||||
uses: docker/login-action@v2
|
|
||||||
with:
|
|
||||||
registry: http://localhost:3000
|
|
||||||
username: <username>
|
|
||||||
password: <application-token>
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v4
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: |
|
|
||||||
localhost:3000/${{ gitea.repository }}:latest
|
|
||||||
localhost:3000/${{ gitea.repository }}:${{ gitea.sha }}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
name: build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-host:
|
|
||||||
runs-on: [host]
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Build with Docker (host)
|
|
||||||
run: |
|
|
||||||
docker build -t nexus.rancherk3.duckdns.org/tfm/microserviciospython:latest .
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
name: build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
runs-on: kaniko
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Build with Kaniko
|
|
||||||
run: |
|
|
||||||
/kaniko/executor \
|
|
||||||
--context . \
|
|
||||||
--dockerfile ./Dockerfile \
|
|
||||||
--destination nexus.rancherk3.duckdns.org/tfm/microserviciospython:${{ github.sha }} \
|
|
||||||
--destination nexus.rancherk3.duckdns.org/tfm/microserviciospython:latest \
|
|
||||||
--cache=true \
|
|
||||||
--cache-dir=/cache
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
name: build
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-push:
|
|
||||||
runs-on: kaniko
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Build & Push con Kaniko
|
|
||||||
env:
|
|
||||||
NEXUS_USER: ${{ secrets.NEXUS_USER }}
|
|
||||||
NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
|
|
||||||
run: |
|
|
||||||
echo "🔐 Configurando credenciales del registry"
|
|
||||||
mkdir -p /kaniko/.docker
|
|
||||||
|
|
||||||
AUTH="$(echo -n "$NEXUS_USER:$NEXUS_PASSWORD" | base64)"
|
|
||||||
|
|
||||||
cat > /kaniko/.docker/config.json <<EOF
|
|
||||||
{
|
|
||||||
"auths": {
|
|
||||||
"nexus.rancherk3.duckdns.org": {
|
|
||||||
"auth": "$AUTH"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "🚀 Construyendo y subiendo imagen con Kaniko"
|
|
||||||
/kaniko/executor \
|
|
||||||
--context=. \
|
|
||||||
--dockerfile=Dockerfile \
|
|
||||||
--destination=nexus.rancherk3.duckdns.org/tfm/microserviciospython:latest \
|
|
||||||
--destination=nexus.rancherk3.duckdns.org/tfm/microserviciospython:${{ gitea.sha }} \
|
|
||||||
--cache=true \
|
|
||||||
--cache-ttl=72h \
|
|
||||||
--verbosity=info
|
|
||||||
|
|
||||||
echo "✅ Build finalizado"
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
name: Build docker container
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build image
|
|
||||||
runs-on: ubuntu
|
|
||||||
|
|
||||||
services:
|
|
||||||
docker:
|
|
||||||
image: nexus3.rancherk3.duckdns.org/elgranloky/docker:23.0.6-dind
|
|
||||||
privileged: true
|
|
||||||
options: >-
|
|
||||||
--privileged
|
|
||||||
--cap-add SYS_ADMIN
|
|
||||||
--cap-add NET_ADMIN
|
|
||||||
--cap-add SETPCAP
|
|
||||||
--cap-add MKNOD
|
|
||||||
--cap-add NET_BIND_SERVICE
|
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_NAME: microserviciospython
|
|
||||||
REGISTRY: nexus3.rancherk3.duckdns.org
|
|
||||||
REPO_OWNER: tfm
|
|
||||||
DOCKER_HOST: tcp://docker:2375
|
|
||||||
DOCKER_TLS_VERIFY: ""
|
|
||||||
DOCKER_CERT_PATH: ""
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
- name: Build and push
|
|
||||||
run: |
|
|
||||||
|
|
||||||
TODAY=$(date +'%Y-%m-%d')
|
|
||||||
echo $TODAY
|
|
||||||
|
|
||||||
rm -rf /root/.docker
|
|
||||||
|
|
||||||
docker version
|
|
||||||
docker build -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${TODAY} -t ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest .
|
|
||||||
docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:${TODAY}
|
|
||||||
docker push ${REGISTRY}/${REPO_OWNER}/${IMAGE_NAME}:latest
|
|
||||||
@@ -1,45 +0,0 @@
|
|||||||
name: Test DIND Integration
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [ main ]
|
|
||||||
pull_request:
|
|
||||||
branches: [ main ]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-docker:
|
|
||||||
runs-on: ubuntu
|
|
||||||
|
|
||||||
services:
|
|
||||||
docker:
|
|
||||||
image: docker:dind
|
|
||||||
env:
|
|
||||||
DOCKER_TLS_CERTDIR: ""
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: Checkout code
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: Wait
|
|
||||||
run: sleep 10
|
|
||||||
|
|
||||||
- name: Verify Docker daemon is running
|
|
||||||
run: |
|
|
||||||
echo "Testing Docker daemon connection..."
|
|
||||||
docker info
|
|
||||||
|
|
||||||
- name: List running containers
|
|
||||||
run: |
|
|
||||||
echo "Listing all containers..."
|
|
||||||
docker ps -a
|
|
||||||
|
|
||||||
- name: Test Docker functionality
|
|
||||||
run: |
|
|
||||||
echo "Testing basic Docker operations..."
|
|
||||||
docker run --rm hello-world
|
|
||||||
|
|
||||||
- name: Verify DIND isolation
|
|
||||||
run: |
|
|
||||||
echo "Testing container isolation..."
|
|
||||||
docker run --rm alpine:latest echo "DIND is working perfectly!"
|
|
||||||
Reference in New Issue
Block a user