Skip to content

Commit

Permalink
Fixed little issues and some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkgabri committed May 13, 2022
1 parent 30599e7 commit e570bca
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 30 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/create-frameworks-package-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ jobs:
- name: 'Remove Dev Hub auth file'
run: rm --force ./DEVHUB_SFDX_AUTH_URL.txt

# --codecoverage
- name: 'Create package version - Frameworks'
id: package-frameworks
run: |
json=$(sfdx force:package:version:create --package Frameworks --installationkeybypass --skipvalidation --wait 10 --json)
json=$(sfdx force:package:version:create --package Frameworks --installationkeybypass --codecoverage --wait 10 --json)
packageVersionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId')
echo "::set-output name=packageVersionId::$packageVersionId"
Expand Down
9 changes: 7 additions & 2 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: 'Verify formatting'
run: |
git fetch origin $GITHUB_BASE_REF
CHANGED_FILES=$(git diff-tree --diff-filter=AM --no-commit-id --name-only -r origin/$GITHUB_BASE_REF HEAD -- ':(exclude)**/reports/**')
CHANGED_FILES=$(git diff-tree --diff-filter=AM --no-commit-id --name-only -r origin/$GITHUB_BASE_REF HEAD -- ':(exclude)**/reports/**' ':(exclude)**/email/**')
IFS=$'\n'
for FILE in $CHANGED_FILES;
do
Expand Down Expand Up @@ -64,7 +64,12 @@ jobs:
run: |
git fetch origin $GITHUB_BASE_REF
CHANGED_FILES=$(git diff-tree --diff-filter=AM --no-commit-id --name-only -r origin/$GITHUB_BASE_REF HEAD -- **/{aura,lwc}/**)
npx eslint $CHANGED_FILES
IFS=$'\n'
for FILE in $CHANGED_FILES;
do
npx eslint "$FILE"
done
unset IFS
verify-pmd:
name: 'Verify PMD'
Expand Down
28 changes: 14 additions & 14 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,6 @@ stages:
# - dev2
# - dev3

validate-merge-request:
stage: dispatch-child-pipeline
rules:
- if: $VALIDATE_MERGE_REQUEST && $CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^release/)
trigger:
include:
# Note: need to specify project and ref since otherwise it will try to find child pipeline in target repo rather than in this one.
# - project: 'jdkgabri/project-scaffolding'
# ref: 'main'
# file: '.gitlab/pipelines/validate.yml'
- remote: 'https://raw.githubusercontent.com/Nakama-Partnering-Services/project-scaffolding/main/.gitlab/pipelines/validate.yml'
strategy: depend

deploy-to-testing-and-backpromote:
stage: dispatch-child-pipeline
rules:
Expand Down Expand Up @@ -114,6 +101,19 @@ create-frameworks-package-version:
- remote: 'https://raw.githubusercontent.com/Nakama-Partnering-Services/project-scaffolding/main/.gitlab/pipelines/create-frameworks-package-version.yml'
strategy: depend

validate-merge-request:
stage: dispatch-child-pipeline
rules:
- if: $VALIDATE_MERGE_REQUEST && $CI_PIPELINE_SOURCE == "merge_request_event" && ($CI_MERGE_REQUEST_TARGET_BRANCH_NAME == $CI_DEFAULT_BRANCH || $CI_MERGE_REQUEST_TARGET_BRANCH_NAME =~ /^release/)
trigger:
include:
# Note: need to specify project and ref since otherwise it will try to find child pipeline in target repo rather than in this one.
# - project: 'jdkgabri/project-scaffolding'
# ref: 'main'
# file: '.gitlab/pipelines/validate.yml'
- remote: 'https://raw.githubusercontent.com/Nakama-Partnering-Services/project-scaffolding/main/.gitlab/pipelines/validate.yml'
strategy: depend

manual-deployment:
stage: dispatch-child-pipeline
rules:
Expand All @@ -138,7 +138,7 @@ manual-deployment:
scheduled-tests:
stage: dispatch-child-pipeline
rules:
- if: $CI_PIPELINE_SOURCE == "schedule"
- if: $CI_PIPELINE_SOURCE == "schedule" && $DESTINATION_ENVIRONMENT != ""
variables:
DESTINATION_ENVIRONMENT: $DESTINATION_ENVIRONMENT
trigger:
Expand Down
2 changes: 1 addition & 1 deletion .gitlab/pipelines/create-frameworks-package-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ create-package-version:
- frameworks/**/*
script:
- sfdx auth:sfdxurl:store --sfdxurlfile $DEVHUB_SFDX_AUTH_URL --setdefaultdevhubusername
- json=$(sfdx force:package:version:create --package Frameworks --installationkeybypass --skipvalidation --wait 10 --json)
- json=$(sfdx force:package:version:create --package Frameworks --installationkeybypass --codecoverage --wait 10 --json)
- versionId=$(echo $json | jq -r '.result.SubscriberPackageVersionId')
# TODO: Persist sfdx-project.json and README.md
- echo "versionId=$versionId" >> package.env
Expand Down
8 changes: 4 additions & 4 deletions .gitlab/pipelines/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ generate-deltas:
script:
- sf plugins install sfdx-git-delta
- mkdir deltas
# Note: upon rebasing release branch onto main, even if the previous commit SHA for the target environment "does not exists",
# deltas against HEAD are calculated from the previous branch status, and hence, only the changes on the rebased commits appear as deltas
# Note: upon rebasing release branch onto main, previous commit SHA for the target environment would work if it still exists as part of any other branch in the repository,
# even if that commit does not exist anymore in the rebased branch
- SFDX_LAST_DEPLOYMENT_COMMIT_SHA=$(eval echo \${${DESTINATION_ENVIRONMENT^^}_SFDX_LAST_DEPLOYMENT_COMMIT_SHA})
- sf sgd source delta --source sfdx-source --from $SFDX_LAST_DEPLOYMENT_COMMIT_SHA --to HEAD --output deltas --ignore .forceignore --generate-delta
artifacts:
Expand Down Expand Up @@ -59,8 +59,8 @@ deploy-vlocity:
resource_group: $DESTINATION_ENVIRONMENT
script:
- DELTAS_FROM=$(eval echo \${${DESTINATION_ENVIRONMENT^^}_VLOCITY_LAST_DEPLOYMENT_COMMIT_SHA})
# Note: upon rebasing release branch onto main, even if the previous commit SHA for the target environment does not exists,
# deltas against HEAD are calculated from the previous branch status, and hence, only the changes on the rebased commits appear as deltas
# Note: upon rebasing release branch onto main, previous commit SHA for the target environment would work if it still exists as part of any other branch in the repository,
# even if that commit does not exist anymore in the rebased branch
- VLOCITY_CHANGED_FILES=$(git diff-tree --diff-filter=AM --no-commit-id --name-only -r $DELTAS_FROM HEAD -- **/vlocity/**)
- VLOCITY_PACKAGES_TO_DEPLOY=$(for file in $VLOCITY_CHANGED_FILES; do echo ${file%/vlocity/*}; done | tr ' ' '\n' | sort -u)
- DESTINATION_SFDX_AUTH_URL=$(eval echo \${${DESTINATION_ENVIRONMENT^^}_SFDX_AUTH_URL})
Expand Down
6 changes: 0 additions & 6 deletions .gitlab/pipelines/environments.yml

This file was deleted.

8 changes: 7 additions & 1 deletion .gitlab/pipelines/validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ verify-linting:
- sfdx-source/**/main/**/*.js
script:
- CHANGED_FILES=$(git diff-tree --diff-filter=AM --no-commit-id --name-only -r $CI_MERGE_REQUEST_DIFF_BASE_SHA HEAD -- **/{aura,lwc}/**)
- npx eslint $CHANGED_FILES
- IFS=$'\n'
- |
for FILE in $CHANGED_FILES;
do
npx eslint "$FILE"
done
- unset IFS

verify-pmd:
stage: local-validations
Expand Down

0 comments on commit e570bca

Please sign in to comment.