Compare commits
13 Commits
0.11-chart
...
0.0.0-spid
| Author | SHA1 | Date | |
|---|---|---|---|
| 148c0c82b7 | |||
| 8ab62bd7ab | |||
| 2afdb334af | |||
| d12a215dce | |||
| 0d012c133d | |||
| af818f3b42 | |||
| 071293ea06 | |||
| f4c7131cc6 | |||
| 42e1a9b824 | |||
| d040748efc | |||
| 74c06b64b9 | |||
| 4a5e991c2e | |||
| d2e101199b |
@@ -1,12 +1,7 @@
|
|||||||
name: ci/cd to build and push docker image debian_runner in private registry
|
name: ci/cd helm chart
|
||||||
|
|
||||||
#https://docs.docker.com/build/ci/github-actions/push-multi-registries/
|
|
||||||
#https://www.devsync.se/ci/cd/docker/2023/10/27/gitea-runner-build-docker-containers.html
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
# Be carefull, conflict with package-deb *.*.*, don't use more than on dot *.* (ex: 2.5-runner)
|
|
||||||
- '*-chart'
|
- '*-chart'
|
||||||
|
|
||||||
|
|
||||||
@@ -15,7 +10,7 @@ env:
|
|||||||
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push-internal:
|
push-helm-chart:
|
||||||
#! see on runner /data/.runner to add label (test => test:docker://debian:bullseye)
|
#! see on runner /data/.runner to add label (test => test:docker://debian:bullseye)
|
||||||
runs-on: ubuntu-runner
|
runs-on: ubuntu-runner
|
||||||
container:
|
container:
|
||||||
@@ -25,51 +20,15 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Show Information
|
- name: Show Information
|
||||||
run: echo "Runner ${{ runner.os }} working on repository ${{ gitea.repository }} and on tag ${{ gitea.ref_name }}"
|
run: echo "Runner ${{ runner.os }} working on repository ${{ gitea.repository }} and on tag ${{ gitea.ref_name }}"
|
||||||
# - name: helm create chart
|
|
||||||
# run: helm create ${{ env.GIT_REPO }}
|
|
||||||
- name: clone repo helm chart
|
- name: clone repo helm chart
|
||||||
run: git clone https://${{ secrets.REGISTRY_DOCKER_PASS }}@${{ vars.REGISTRY_DOCKER }}/${{ secrets.REGISTRY_DOCKER_USER }}/${{ env.GIT_REPO }}
|
run: git clone https://${{ secrets.REGISTRY_DOCKER_PASS }}@${{ vars.REGISTRY_DOCKER }}/${{ secrets.REGISTRY_DOCKER_USER }}/${{ env.GIT_REPO }}
|
||||||
- name: export version
|
- name: tag release
|
||||||
run: |
|
run: |
|
||||||
ls
|
export VERSION=$(echo "${{ gitea.ref_name }}" | cut -d '-' -f 1)
|
||||||
pwd
|
sed -i "s/^version: .*/version: $VERSION/" /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}/Chart.yaml
|
||||||
sleep 300
|
|
||||||
- name: export version
|
|
||||||
run: export VERSION=$(echo "${{ gitea.ref_name }}" | cut -d '-' -f 1)
|
|
||||||
- name: Add release from tag
|
|
||||||
run: 'sed -i "s/^version: .*/version: $VERSION/" /${{ env.GIT_REPO }}/Chart.yaml'
|
|
||||||
- name: helm package
|
- name: helm package
|
||||||
run: helm package ${{ env.GIT_REPO }}
|
run: helm package ${{ env.GIT_REPO }}
|
||||||
- name: push repo
|
- name: push repo
|
||||||
run: curl --user ${{ secrets.REGISTRY_DOCKER_USER }}:${{ secrets.REGISTRY_DOCKER_PASS }} -X POST --upload-file ./${{ env.GIT_REPO }}-$VERSIONtgz https://${{ vars.REGISTRY_DOCKER }}/api/packages/${{ secrets.GIT_USER_REPO }}/helm/api/charts
|
run: |
|
||||||
|
export VERSION=$(echo "${{ gitea.ref_name }}" | cut -d '-' -f 1)
|
||||||
# helm repo add --username {username} --password {password} {repo} https://gitea.example.com/api/packages/{owner}/helm
|
curl --user ${{ secrets.REGISTRY_DOCKER_USER }}:${{ secrets.REGISTRY_DOCKER_PASS }} -X POST --upload-file /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}-$VERSION.tgz https://${{ vars.REGISTRY_DOCKER }}/api/packages/${{ secrets.GIT_USER_REPO }}/helm/api/charts
|
||||||
# helm cm-push ./{chart_file}.tgz {repo}
|
|
||||||
# curl --user {username}:{password} -X POST --upload-file ./{chart_file}.tgz https://gitea.example.com/api/packages/{owner}/helm/api/charts
|
|
||||||
|
|
||||||
|
|
||||||
# - name: Git clone private repository
|
|
||||||
# uses: actions/checkout@v4
|
|
||||||
# with:
|
|
||||||
# repository: ${{ gitea.repository }}
|
|
||||||
# token: ${{ secrets.REPO_PULL_GITEA }}
|
|
||||||
|
|
||||||
# - name: Login to docker private registry
|
|
||||||
# uses: docker/login-action@v3
|
|
||||||
# with:
|
|
||||||
# registry: ${{ vars.REGISTRY_DOCKER }}
|
|
||||||
# username: ${{ secrets.REGISTRY_DOCKER_USER }}
|
|
||||||
# password: ${{ secrets.REGISTRY_DOCKER_PASS }}
|
|
||||||
|
|
||||||
|
|
||||||
# - run: git --help
|
|
||||||
|
|
||||||
# - name: Build and push image in registry
|
|
||||||
# uses: docker/build-push-action@v5
|
|
||||||
# with:
|
|
||||||
# context: .
|
|
||||||
# push: true
|
|
||||||
# tags: ${{ vars.REGISTRY_DOCKER }}/${{ env.CHART_NAME }}:latest,${{ vars.REGISTRY_DOCKER }}/${{ env.CHART_NAME }}:${{ gitea.ref_name }}
|
|
||||||
|
|
||||||
# - name: Output
|
|
||||||
# run: echo "Runner push on ${{ vars.REGISTRY_DOCKER }} image ${{ env.CHART_NAME }} tag ${{ gitea.ref_name }}"
|
|
||||||
|
|||||||
@@ -1,12 +1,8 @@
|
|||||||
name: ci/cd to build and push docker image debian_runner in private registry
|
name: ci/cd internal docker image
|
||||||
|
|
||||||
#https://docs.docker.com/build/ci/github-actions/push-multi-registries/
|
|
||||||
#https://www.devsync.se/ci/cd/docker/2023/10/27/gitea-runner-build-docker-containers.html
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
tags:
|
||||||
# Be carefull, conflict with package-deb *.*.*, don't use more than on dot *.* (ex: 2.5-runner)
|
|
||||||
- '*-internal'
|
- '*-internal'
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
81
.gitea/workflows/build_push_internal_docker_poker.yml
Normal file
81
.gitea/workflows/build_push_internal_docker_poker.yml
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
name: ci/cd internal docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*-poker'
|
||||||
|
|
||||||
|
|
||||||
|
env:
|
||||||
|
GIT_REPO: poker-master-tool
|
||||||
|
DOCKER_IMAGE_NAME: poker
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-poker:
|
||||||
|
#! see on runner /data/.runner to add label (test => test:docker://debian:bullseye)
|
||||||
|
# runs-on: test
|
||||||
|
# container: debian:bullseye
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# container: node:16-bullseye
|
||||||
|
runs-on: ubuntu-runner
|
||||||
|
container:
|
||||||
|
image: docker
|
||||||
|
# container:
|
||||||
|
# image: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_RUNNER }}:latest
|
||||||
|
# credentials:
|
||||||
|
# username: ${{ secrets.GIT_USER_REPO }}
|
||||||
|
# password: ${{ secrets.REGISTRY_DOCKER_PASS }}
|
||||||
|
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Show Information
|
||||||
|
run: echo "Runner ${{ runner.os }} working on repository ${{ gitea.repository }} and on tag ${{ gitea.ref_name }}"
|
||||||
|
- name: clone & build
|
||||||
|
run: |
|
||||||
|
git clone https://${{ secrets.REGISTRY_DOCKER_PASS }}@${{ vars.REGISTRY_DOCKER }}/${{ secrets.REGISTRY_DOCKER_USER }}/${{ env.GIT_REPO }}
|
||||||
|
cd ${{ env.GIT_REPO }}
|
||||||
|
pwd
|
||||||
|
echo "sed -i "s/^FROM .*/FROM node:18/" /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}/Dockerfile"
|
||||||
|
sed -i "s/^FROM .*/FROM node:18/" /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}/Dockerfile
|
||||||
|
cat /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}/Dockerfile
|
||||||
|
docker buildx b . -t ${{ env.DOCKER_IMAGE_NAME }}
|
||||||
|
- name: login & push
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_DOCKER_PASS }}" | docker login -u ${{ secrets.REGISTRY_DOCKER_USER }} --password-stdin ${{ vars.REGISTRY_DOCKER }}
|
||||||
|
export VERSION=$(echo "${{ gitea.ref_name }}" | cut -d '-' -f 1)
|
||||||
|
docker tag ${{ env.DOCKER_IMAGE_NAME }} ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:$VERSION
|
||||||
|
docker tag ${{ env.DOCKER_IMAGE_NAME }} ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:latest
|
||||||
|
echo "docker push ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:$VERSION"
|
||||||
|
docker push ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:$VERSION
|
||||||
|
docker push ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:latest
|
||||||
|
|
||||||
|
# docker pull gitea.jingoh.fr/staffadmin/test:0.0.1
|
||||||
|
# docker tag gitea.jingoh.fr/staffadmin/test:0.0.1 gitea.jingoh.fr/staffadmin/toto:latest
|
||||||
|
# docker push gitea.jingoh.fr/staffadmin/toto:latest
|
||||||
|
|
||||||
|
|
||||||
|
# - name: Git clone private repository
|
||||||
|
# uses: actions/checkout@v4
|
||||||
|
# with:
|
||||||
|
# repository: ${{ gitea.repository }}
|
||||||
|
# token: ${{ secrets.REPO_PULL_GITEA }}
|
||||||
|
|
||||||
|
# - name: Login to docker private registry
|
||||||
|
# uses: docker/login-action@v3
|
||||||
|
# with:
|
||||||
|
# registry: ${{ vars.REGISTRY_DOCKER }}
|
||||||
|
# username: ${{ secrets.GIT_USER_REPO }}
|
||||||
|
# password: ${{ secrets.REGISTRY_DOCKER_PASS }}
|
||||||
|
|
||||||
|
|
||||||
|
# - run: git --help
|
||||||
|
|
||||||
|
# - name: Build and push image in registry
|
||||||
|
# uses: docker/build-push-action@v5
|
||||||
|
# with:
|
||||||
|
# context: .
|
||||||
|
# push: true
|
||||||
|
# tags: ${{ vars.REGISTRY_DOCKER }}/${{ env.DOCKER_IMAGE_NAME }}:latest,${{ vars.REGISTRY_DOCKER }}/${{ env.DOCKER_IMAGE_NAME }}:${{ gitea.ref_name }}
|
||||||
|
|
||||||
|
# - name: Output
|
||||||
|
# run: echo "Runner push on ${{ vars.REGISTRY_DOCKER }} image ${{ env.DOCKER_IMAGE_NAME }} tag ${{ gitea.ref_name }}"
|
||||||
50
.gitea/workflows/build_push_internal_docker_spiderfoot.yml
Normal file
50
.gitea/workflows/build_push_internal_docker_spiderfoot.yml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
name: ci/cd internal docker image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- '*-spiderfoot'
|
||||||
|
|
||||||
|
|
||||||
|
env:
|
||||||
|
GIT_REPO: spiderfoot
|
||||||
|
DOCKER_IMAGE_NAME: spiderfoot
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-and-push-spiderfoot:
|
||||||
|
#! see on runner /data/.runner to add label (test => test:docker://debian:bullseye)
|
||||||
|
# runs-on: test
|
||||||
|
# container: debian:bullseye
|
||||||
|
# runs-on: ubuntu-latest
|
||||||
|
# container: node:16-bullseye
|
||||||
|
runs-on: ubuntu-runner
|
||||||
|
container:
|
||||||
|
image: docker
|
||||||
|
# container:
|
||||||
|
# image: ${{ vars.REGISTRY_DOCKER }}/${{ vars.DOCKER_IMAGE_RUNNER }}:latest
|
||||||
|
# credentials:
|
||||||
|
# username: ${{ secrets.GIT_USER_REPO }}
|
||||||
|
# password: ${{ secrets.REGISTRY_DOCKER_PASS }}
|
||||||
|
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Show Information
|
||||||
|
run: echo "Runner ${{ runner.os }} working on repository ${{ gitea.repository }} and on tag ${{ gitea.ref_name }}"
|
||||||
|
- name: clone & build
|
||||||
|
run: |
|
||||||
|
git clone https://${{ secrets.REGISTRY_DOCKER_PASS }}@${{ vars.REGISTRY_DOCKER }}/${{ secrets.REGISTRY_DOCKER_USER }}/${{ env.GIT_REPO }}
|
||||||
|
cd ${{ env.GIT_REPO }}
|
||||||
|
pwd
|
||||||
|
echo "sed -i "s/^FROM .*/FROM node:18/" /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}/Dockerfile"
|
||||||
|
sed -i "s/^FROM .*/FROM node:18/" /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}/Dockerfile
|
||||||
|
cat /workspace/${{ secrets.GIT_USER_REPO }}/gitea-runner/${{ env.GIT_REPO }}/Dockerfile
|
||||||
|
docker buildx b . -t ${{ env.DOCKER_IMAGE_NAME }}
|
||||||
|
- name: login & push
|
||||||
|
run: |
|
||||||
|
echo "${{ secrets.REGISTRY_DOCKER_PASS }}" | docker login -u ${{ secrets.REGISTRY_DOCKER_USER }} --password-stdin ${{ vars.REGISTRY_DOCKER }}
|
||||||
|
export VERSION=$(echo "${{ gitea.ref_name }}" | cut -d '-' -f 1)
|
||||||
|
docker tag ${{ env.DOCKER_IMAGE_NAME }} ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:$VERSION
|
||||||
|
docker tag ${{ env.DOCKER_IMAGE_NAME }} ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:latest
|
||||||
|
echo "docker push ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:$VERSION"
|
||||||
|
docker push ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:$VERSION
|
||||||
|
docker push ${{ vars.REGISTRY_DOCKER }}/${{ secrets.GIT_USER_REPO }}/${{ env.DOCKER_IMAGE_NAME }}:latest
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
name: build_package_deb
|
name: build and push deb package
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PACKAGE_NAME: test3
|
PACKAGE_NAME: test3
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
name: ci/cd to build and push docker image wafwoof in private registry
|
name: ci/cd public docker
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|||||||
Reference in New Issue
Block a user