You've already forked reloading-manager
I'll explain when you're older!
This commit is contained in:
@@ -1,12 +1,15 @@
|
|||||||
stages:
|
stages:
|
||||||
- Tests
|
- Tests
|
||||||
- Build
|
- Build
|
||||||
- PostDeployPrep
|
- Update Deployment
|
||||||
- PostDeploy
|
- Create Commit
|
||||||
|
- Create Merge Request
|
||||||
|
|
||||||
NodeJs Tests:
|
NodeJs Tests:
|
||||||
stage: Tests
|
stage: Tests
|
||||||
image: node:22.14.0
|
image: node:22.14.0
|
||||||
|
except:
|
||||||
|
- tags
|
||||||
before_script:
|
before_script:
|
||||||
- cd frontend
|
- cd frontend
|
||||||
- npm install
|
- npm install
|
||||||
@@ -58,9 +61,48 @@ include:
|
|||||||
context: "frontend"
|
context: "frontend"
|
||||||
dockerfile: "frontend/Dockerfile"
|
dockerfile: "frontend/Dockerfile"
|
||||||
|
|
||||||
- project: 'shared/blueprints'
|
Update Deployment:
|
||||||
file: 'jobs/create-release.yml'
|
image: busybox:ubuntu
|
||||||
ref: master
|
rules:
|
||||||
rules:
|
- if: '$CI_COMMIT_TAG'
|
||||||
- if: '$CI_COMMIT_TAG'
|
stage: Update Deployment
|
||||||
|
script: |
|
||||||
|
echo "## Do not edit this file directly. It is auto-generated by the script." > argocd/deployment/deployment.yml
|
||||||
|
sed "s|__TAG__|${{ gitea.ref_name }}|g" argocd/template/deployment.yml >> argocd/deployment/deployment.yml
|
||||||
|
artifacts:
|
||||||
|
expire_in: 1 hour
|
||||||
|
paths:
|
||||||
|
- argocd/deployment/deployment.yml
|
||||||
|
|
||||||
|
Create Commit:
|
||||||
|
stage: Create Commit
|
||||||
|
dependencies:
|
||||||
|
- Update Deployment
|
||||||
|
image: alpine:3.18
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_TAG'
|
||||||
|
before_script: |
|
||||||
|
git config --global user.name "${GITLAB_USER_NAME}"
|
||||||
|
git config --global user.email "${GITLAB_USER_EMAIL}"
|
||||||
|
script: |
|
||||||
|
git pull origin master
|
||||||
|
git checkout -b "update-deployment-${CI_COMMIT_TAG}"
|
||||||
|
git add argocd/deployment/deployment.yml
|
||||||
|
git commit -m "Update deployment manifest with new image tags"
|
||||||
|
git push origin "update-deployment-${CI_COMMIT_TAG}"
|
||||||
|
|
||||||
|
Create Merge Request:
|
||||||
|
stage: Create Merge Request
|
||||||
|
dependencies:
|
||||||
|
- Create Commit
|
||||||
|
image: alpine:3.18
|
||||||
|
rules:
|
||||||
|
- if: '$CI_COMMIT_TAG'
|
||||||
|
script: |
|
||||||
|
curl --request POST --header "PRIVATE-TOKEN: ${GITLAB_TOKEN}" \
|
||||||
|
--data "source_branch=update-deployment-${CI_COMMIT_TAG}" \
|
||||||
|
--data "target_branch=master" \
|
||||||
|
--data "title=Update deployment manifest with new image tags" \
|
||||||
|
--data "description=This merge request updates the deployment manifest with the new image tags." \
|
||||||
|
--data "remove_source_branch=true" \
|
||||||
|
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/merge_requests"
|
||||||
Reference in New Issue
Block a user