Compare commits
10 Commits
fe6748a0ae
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8286fd627 | ||
|
|
1d9627f24c | ||
|
|
01ca1e6919 | ||
|
|
cbe863eede | ||
|
|
eff7fd01ca | ||
|
|
52d41e9b68 | ||
|
|
a89ebbf558 | ||
|
|
80d07b2cba | ||
|
|
3d2f3a92a5 | ||
|
|
bca4f22eef |
@@ -3,6 +3,8 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
|
schedule:
|
||||||
|
- cron: '2 2 * * 0'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
pull:
|
pull:
|
||||||
@@ -11,32 +13,21 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: pull
|
- name: pull
|
||||||
run: |
|
run: |
|
||||||
was=$(docker images | grep registry-app.inhome.blapointe.com:5001/docker:latest | awk '{print $3}')
|
docker pull registry-app.inhome.blapointe.com:5001/bel/dind:latest || true
|
||||||
docker pull registry-app.inhome.blapointe.com:5001/docker:latest
|
|
||||||
new=$(docker images | grep registry-app.inhome.blapointe.com:5001/docker:latest | awk '{print $3}')
|
|
||||||
if [ "$was" != "$new" ]; then
|
|
||||||
docker rmi "$was"
|
|
||||||
fi
|
|
||||||
shell: sh
|
shell: sh
|
||||||
cicd:
|
cicd:
|
||||||
name: cicd
|
name: cicd
|
||||||
runs-on: dind
|
runs-on: dind
|
||||||
steps:
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v3
|
||||||
- name: cicd
|
- name: cicd
|
||||||
run: |
|
run: |
|
||||||
was=$(docker images | grep registry-app.inhome.blapointe.com:5001/docker:latest | awk '{print $3}')
|
pwd
|
||||||
|
ls
|
||||||
env
|
find . -type d
|
||||||
|
ps aux www
|
||||||
echo clone ${{ gitea.repository }}
|
which git
|
||||||
git clone ${{ gitea.repository }}
|
|
||||||
cd ./*/
|
|
||||||
if ! sh ./build.sh; then
|
if ! sh ./build.sh; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
new=$(docker images | grep registry-app.inhome.blapointe.com:5001/docker:latest | awk '{print $3}')
|
|
||||||
if [ "$was" != "$new" ]; then
|
|
||||||
docker rmi "$was"
|
|
||||||
fi
|
|
||||||
shell: sh
|
|
||||||
|
|||||||
@@ -1,7 +1,3 @@
|
|||||||
FROM docker:24.0.7-dind-alpine3.18
|
FROM docker:24.0.7-dind-alpine3.18
|
||||||
|
|
||||||
RUN apk update && apk --no-cache add bash curl git
|
RUN apk update && apk --no-cache add bash curl git nodejs npm jq
|
||||||
|
|
||||||
COPY ./entrypoint.sh /bin/entrypoint.sh
|
|
||||||
RUN chmod +x /bin/entrypoint.sh
|
|
||||||
ENTRYPOINT ["/bin/entrypoint.sh"]
|
|
||||||
|
|||||||
15
build.sh
15
build.sh
@@ -1,10 +1,19 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
|
|
||||||
img=registry-app.inhome.blapointe.com:5001/docker
|
img=registry-app.inhome.blapointe.com:5001/bel/dind
|
||||||
t=latest
|
t=latest
|
||||||
docker rmi $img:$t
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
docker build -f ./Dockerfile -t $img:$t --progress plain .
|
get_sha() {
|
||||||
|
docker inspect $img:$t | grep '"Id"' | awk '{print $NF}' | sed 's/^"sha256://' | sed 's/",$//'
|
||||||
|
}
|
||||||
|
|
||||||
|
was=$(get_sha)
|
||||||
|
docker build -f ./Dockerfile -t $img:$t .
|
||||||
docker push $img:$t
|
docker push $img:$t
|
||||||
|
now=$(get_sha)
|
||||||
|
if [ -n "$was" ] && [ "$was" != "$now" ]; then
|
||||||
|
echo pruning old $was
|
||||||
|
docker rmi "$was" || true
|
||||||
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user