This commit is contained in:
66
.github/workflows/build.yaml
vendored
66
.github/workflows/build.yaml
vendored
@ -25,53 +25,25 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
path: ./version
|
path: ./version
|
||||||
|
|
||||||
- name: Install Docker
|
- name: Install Docker // Docker 설치
|
||||||
if: runner.os == 'Linux'
|
|
||||||
run: |
|
run: |
|
||||||
curl -fsSL https://get.docker.com -o get-docker.sh
|
curl -fsSL https://get.docker.com -o get-docker.sh
|
||||||
sh get-docker.sh
|
sh get-docker.sh
|
||||||
|
if: runner.os == 'Linux'
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
# uses: https://github.com/docker/setup-buildx-action@v1
|
# uses: https://github.com/docker/setup-buildx-action@v1
|
||||||
uses: docker/setup-buildx-action@v1
|
uses: docker/setup-buildx-action@v1
|
||||||
|
|
||||||
# DEBUG #
|
|
||||||
- name: DEBUG show docker & buildx info
|
|
||||||
run: |
|
|
||||||
docker version
|
|
||||||
docker info
|
|
||||||
docker buildx version
|
|
||||||
docker buildx ls
|
|
||||||
|
|
||||||
- name: Login to Registry
|
- name: Login to Registry
|
||||||
run: docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PW }} https://harbor.icurfer.com
|
run: docker login -u ${{ secrets.DOCKER_ID }} -p ${{ secrets.DOCKER_PW }} https://harbor.icurfer.com
|
||||||
|
|
||||||
- name: DEBUG Check environment
|
- name: build
|
||||||
run: |
|
run: docker build -t harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }} .
|
||||||
echo "===== WORKDIR ====="
|
|
||||||
pwd
|
|
||||||
ls -alh
|
|
||||||
|
|
||||||
echo "===== Find Dockerfile ====="
|
|
||||||
find . -maxdepth 3 -name Dockerfile
|
|
||||||
|
|
||||||
echo "===== ENV ====="
|
|
||||||
env | sort
|
|
||||||
|
|
||||||
echo "===== DOCKER INFO ====="
|
|
||||||
which docker
|
|
||||||
docker version
|
|
||||||
|
|
||||||
# DEBUG #
|
|
||||||
#- name: build
|
|
||||||
# run: docker build -t harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }} .
|
|
||||||
- name: DEBUG build with buildx logs
|
|
||||||
run: "docker build --debug -t harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }} ."
|
|
||||||
|
|
||||||
# push
|
|
||||||
- name: Push to Docker
|
- name: Push to Docker
|
||||||
run: docker push harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }}
|
run: docker push harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }}
|
||||||
|
|
||||||
## pre cd
|
## pre cd
|
||||||
- name: Setup Kustomize
|
- name: Setup Kustomize
|
||||||
uses: yokawasa/action-setup-kube-tools@v0.9.2
|
uses: yokawasa/action-setup-kube-tools@v0.9.2
|
||||||
@ -91,27 +63,7 @@ jobs:
|
|||||||
cd cd-msa-django-ansible/overlays/dev/
|
cd cd-msa-django-ansible/overlays/dev/
|
||||||
kustomize edit set image harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }}
|
kustomize edit set image harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }}
|
||||||
cat kustomization.yaml
|
cat kustomization.yaml
|
||||||
# - name: Update Kubernetes resources
|
|
||||||
# run: |
|
|
||||||
# cd cd-msa-django-ansible/overlays/dev/
|
|
||||||
|
|
||||||
# echo "✅ Updating image tag..."
|
|
||||||
# kustomize edit set image harbor.icurfer.com/msa-demo/msa-django-ansible:${{ steps.img-ver.outputs.content }}
|
|
||||||
|
|
||||||
# echo "✅ Installing yq..."
|
|
||||||
# wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.44.3/yq_linux_amd64
|
|
||||||
# chmod +x /usr/local/bin/yq
|
|
||||||
|
|
||||||
# echo "✅ Updating container name in patch-deployment.yaml..."
|
|
||||||
# yq e -i '.spec.template.spec.containers[0].name = "msa-django-ansible-${{ steps.img-ver.outputs.content }}"' patch-deployment.yaml
|
|
||||||
|
|
||||||
# echo "✅ Final patch-deployment.yaml content:"
|
|
||||||
# cat patch-deployment.yaml
|
|
||||||
|
|
||||||
# echo "✅ Final kustomization.yaml content:"
|
|
||||||
# cat kustomization.yaml
|
|
||||||
|
|
||||||
|
|
||||||
## cd commit
|
## cd commit
|
||||||
- name: Commit files
|
- name: Commit files
|
||||||
run: |
|
run: |
|
||||||
@ -119,4 +71,4 @@ jobs:
|
|||||||
git config --global user.email "icurfer@gmail.com"
|
git config --global user.email "icurfer@gmail.com"
|
||||||
git config --global user.name "icurfer"
|
git config --global user.name "icurfer"
|
||||||
git commit -am "Update image tag"
|
git commit -am "Update image tag"
|
||||||
git push -u origin main
|
git push -u origin main
|
||||||
Reference in New Issue
Block a user