-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
trigger gitlab pipleine from gh action
- Loading branch information
Showing
12 changed files
with
70 additions
and
198 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,22 @@ | ||
name: Build Images | ||
name: Trigger GitLab CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- github-runner | ||
workflow_run: | ||
workflows: ["Srtool build", "Deploy Chain docs"] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
build-images: | ||
trigger_gitlab: | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 120 | ||
env: | ||
DOCKER_HUB_PARACHAIN: kiltprotocol/kilt-node | ||
DOCKER_HUB_STANDALONE: kiltprotocol/standalone-node | ||
DOCKER_HUB_DIP_PROVIDER_TEMPLATE: kiltprotocol/dip-provider-node-template | ||
DOCKER_HUB_DIP_CONSUMER_TEMPLATE: kiltprotocol/dip-consumer-node-template | ||
AWS_REGISTRY: ${{ secrets.ECR_REGISTRY }} | ||
CI_COMMIT_SHORT_SHA: ${{ github.sha }} | ||
CI_COMMIT_BRANCH: ${{ github.ref_name }} | ||
CI_COMMIT_TAG: ${{ github.ref_name }} | ||
steps: | ||
- name: Free Disk Space | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: true | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Display AWS and Docker Versions | ||
run: | | ||
aws --version | ||
docker --version | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USER }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
- name: Login to ECR | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ${{ secrets.ECR_REGISTRY }} | ||
username: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
|
||
- name: Build Docker Images | ||
run: | | ||
./.maintain/build-image.sh build | ||
- name: Push Image - Tag | ||
if: startsWith(github.ref, 'refs/tags/') | ||
run: | | ||
./.maintain/push-image.sh build "${{ env.CI_COMMIT_TAG }}" | ||
- name: Push Image - Latest | ||
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref, '-rc') && !contains(github.ref, 'dev-') | ||
- name: Trigger GitLab CI | ||
env: | ||
GITLAB_TRIGGER_TOKEN: ${{ secrets.GITLAB_TRIGGER_TOKEN }} | ||
GITLAB_PROJECT_ID: ${{ secrets.GITLAB_PROJECT_ID }} | ||
run: | | ||
./.maintain/push-image.sh build "latest" | ||
curl -X POST \ | ||
-F token=$GITLAB_TRIGGER_TOKEN \ | ||
-F ref=${{ github.ref_name }} \ | ||
https://gitlab.com/api/v4/projects/$GITLAB_PROJECT_ID/trigger/pipeline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Build and Deploy Chain docs | ||
name: Deploy Chain docs | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,31 @@ | ||
default: | ||
interruptible: true | ||
|
||
.check_skip_rust: | ||
build-images: | ||
timeout: 2 hours | ||
image: | ||
name: kiltprotocol/kilt-ci:2.7.31 | ||
entrypoint: [""] | ||
stage: build | ||
only: | ||
refs: | ||
- develop | ||
- master | ||
- /^[0-9]+(?:\.[0-9]+){2}(?:-(rc)*([0-9])+)?$/ | ||
- /^[dev-](\w*-)*[0-9]?$/ | ||
variables: | ||
DOCKER_HUB_PARACHAIN: "kiltprotocol/kilt-node" | ||
DOCKER_HUB_STANDALONE: "kiltprotocol/standalone-node" | ||
DOCKER_HUB_DIP_PROVIDER_TEMPLATE: "kiltprotocol/dip-provider-node-template" | ||
DOCKER_HUB_DIP_CONSUMER_TEMPLATE: "kiltprotocol/dip-consumer-node-template" | ||
before_script: | ||
- |- | ||
if echo "$CI_COMMIT_TITLE" | grep -q "ci-skip-rust"; then | ||
echo "Skipping rust tests due to commit title" | ||
exit 0 | ||
fi | ||
include: | ||
- local: '.gitlab/check.yml' | ||
- local: '.gitlab/test.yml' | ||
- local: '.gitlab/build.yml' | ||
|
||
variables: | ||
CARGO_CACHE_PATH: $CARGO_CACHE_PATH | ||
CARGO_HOME: ${CI_PROJECT_DIR}/.cargo | ||
- aws --version | ||
- docker --version | ||
script: | ||
- echo -n $CI_REGISTRY_TOKEN | docker login -u "$CI_REGISTRY_USER" --password-stdin $CI_REGISTRY | ||
- aws ecr get-login-password | docker login --username AWS --password-stdin $AWS_REGISTRY | ||
- ./.maintain/docker-auth-config.sh | ||
|
||
workflow: | ||
auto_cancel: | ||
on_new_commit: interruptible | ||
- ./.maintain/build-image.sh build | ||
- "if [[ ! -z ${CI_COMMIT_BRANCH} ]]; then ./.maintain/push-image.sh build ${CI_COMMIT_SHORT_SHA}; fi" | ||
- "if [[ ! -z ${CI_COMMIT_BRANCH} ]]; then ./.maintain/push-image.sh build latest-${CI_COMMIT_BRANCH}; fi" | ||
- "if [[ ! -z ${CI_COMMIT_TAG} ]]; then ./.maintain/push-image.sh build ${CI_COMMIT_TAG}; fi" | ||
- "if [[ ! -z ${CI_COMMIT_TAG} && ! -z ${CI_COMMIT_TAG##*-rc*} && ! -z ${CI_COMMIT_TAG##*dev-*} ]]; then ./.maintain/push-image.sh build latest; fi" | ||
|
||
stages: | ||
- check | ||
- test | ||
- build |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters