Compare commits
12 Commits
dceb23de17
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f8286fd627 | ||
|
|
1d9627f24c | ||
|
|
01ca1e6919 | ||
|
|
cbe863eede | ||
|
|
eff7fd01ca | ||
|
|
52d41e9b68 | ||
|
|
a89ebbf558 | ||
|
|
80d07b2cba | ||
|
|
3d2f3a92a5 | ||
|
|
bca4f22eef | ||
|
|
fe6748a0ae | ||
|
|
e48614f8b5 |
@@ -3,6 +3,8 @@ on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
schedule:
|
||||
- cron: '2 2 * * 0'
|
||||
|
||||
jobs:
|
||||
pull:
|
||||
@@ -11,32 +13,21 @@ jobs:
|
||||
steps:
|
||||
- name: pull
|
||||
run: |
|
||||
was=$(docker images | grep registry-app.inhome.blapointe.com:5001/docker:latest | awk '{print $3}')
|
||||
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
|
||||
docker pull registry-app.inhome.blapointe.com:5001/bel/dind:latest || true
|
||||
shell: sh
|
||||
cicd:
|
||||
name: cicd
|
||||
runs-on: dind
|
||||
steps:
|
||||
- name: checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: cicd
|
||||
run: |
|
||||
was=$(docker images | grep registry-app.inhome.blapointe.com:5001/docker:latest | awk '{print $3}')
|
||||
|
||||
env
|
||||
|
||||
echo clone ${{ gitea.repository }}
|
||||
git clone ${{ gitea.repository }}
|
||||
cd ./*/
|
||||
pwd
|
||||
ls
|
||||
find . -type d
|
||||
ps aux www
|
||||
which git
|
||||
if ! sh ./build.sh; then
|
||||
exit 1
|
||||
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,3 +1,3 @@
|
||||
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
|
||||
|
||||
17
build.sh
17
build.sh
@@ -1,6 +1,19 @@
|
||||
#! /bin/sh
|
||||
|
||||
img=registry-app.inhome.blapointe.com:5001/bel/dind
|
||||
t=latest
|
||||
|
||||
set -e
|
||||
|
||||
docker build -f ./Dockerfile -t registry-app.inhome.blapointe.com:5001/docker:latest .
|
||||
docker push registry-app.inhome.blapointe.com:5001/docker:latest
|
||||
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
|
||||
now=$(get_sha)
|
||||
if [ -n "$was" ] && [ "$was" != "$now" ]; then
|
||||
echo pruning old $was
|
||||
docker rmi "$was" || true
|
||||
fi
|
||||
|
||||
10
entrypoint.sh
Normal file
10
entrypoint.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#! /bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
if [ -n "$GITHUB_SERVER_URL" ] && [ -n "$GITHUB_REPOSITORY" ]; then
|
||||
git clone "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY" ./git.d
|
||||
cd ./git.d
|
||||
fi
|
||||
|
||||
exec bash "$@"
|
||||
Reference in New Issue
Block a user