Skip to content

Commit

Permalink
Merge pull request #167 from entur/gha-migration
Browse files Browse the repository at this point in the history
Gha migration
  • Loading branch information
assadriaz authored Dec 23, 2024
2 parents 4524e5c + d77134c commit 7d057eb
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 127 deletions.
92 changes: 0 additions & 92 deletions .circleci/config.yml

This file was deleted.

34 changes: 0 additions & 34 deletions .circleci/trigger_build_v2.sh

This file was deleted.

26 changes: 25 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,32 @@ jobs:
java-version: 17
distribution: temurin
cache: maven
- name: set variables
run: |
echo "GHA_DOCKER_PUSH_IMAGE_TAG=`date +%Y-%m-%dT%H-%M`" >> $GITHUB_ENV
- name: Build container image with Jib, push to Github Container Repo
run: |
image_date=`date +%Y-%m-%dT%H-%M`
mvn --batch-mode compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,$image_date
mvn --batch-mode compile com.google.cloud.tools:jib-maven-plugin:build -Djib.to.tags=latest,${{ env.GHA_DOCKER_PUSH_IMAGE_TAG }}
- name: Tag default branch with the container image tag ${{ env.GHA_DOCKER_PUSH_IMAGE_TAG }}
id: tag-version
run: |
git config user.name github-actions[bot]
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
git tag --annotate "$GHA_DOCKER_PUSH_IMAGE_TAG" -m "chore(tag): $GHA_DOCKER_PUSH_IMAGE_TAG [skip ci]" --force
git push origin "$GHA_DOCKER_PUSH_IMAGE_TAG" --force
- name: Trigger downstream CI
run: |
repo_owner="entur"
repo_name="anshar-deployment-config"
event_type="trigger-downstream-ci"
service="anshar"
echo "Triggering downstream CI for $service with version $GHA_DOCKER_PUSH_IMAGE_TAG"
curl -X POST \
-H "Authorization: token ${{ secrets.GITFLOW_PAT }}" \
-H "Accept: application/vnd.github.everest-preview+json" \
-H "Content-Type: application/json" https://api.github.com/repos/$repo_owner/$repo_name/dispatches \
-d "{\"event_type\": \"$event_type\", \"client_payload\": {\"service\": \"$service\", \"version\": \"$GHA_DOCKER_PUSH_IMAGE_TAG\", \"unit\": false, \"integration\": true}}"

0 comments on commit 7d057eb

Please sign in to comment.