Skip to content

Commit

Permalink
Fixed files names.
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexSkrypnyk committed Feb 27, 2024
1 parent 22b37c8 commit be7ffff
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
32 changes: 19 additions & 13 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,10 @@ jobs:
name: Prepare test file.
command: |
export TEST_FILE="test-file--force-push--circleci--${CIRCLE_BRANCH//\//-}.txt"
echo "Deployment 1 for branch $CIRCLE_BRANCH" >> $TEST_FILE
echo "Deployment 1 for branch $CIRCLE_BRANCH" > $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
cat $TEST_FILE
echo $TEST_FILE > $HOME/test-file.txt
- run:
name: Deployment 1
Expand All @@ -101,7 +103,7 @@ jobs:
DEPLOYED_BRANCH=$(sed -n 's/Remote branch://p' $HOME/report--mode--force-push.txt | sed 's/ //g')
echo "Deployed to $DEPLOYED_BRANCH"
echo
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$TEST_FILE"
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$(cat $HOME/test-file.txt)"
rm $HOME/report--mode--force-push.txt
- run:
Expand All @@ -110,6 +112,7 @@ jobs:
export TEST_FILE="test-file--force-push--circleci--${CIRCLE_BRANCH//\//-}.txt"
echo "Deployment 2 for branch $CIRCLE_BRANCH" >> $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
cat $TEST_FILE
- run:
name: Deployment 2
Expand All @@ -125,7 +128,7 @@ jobs:
DEPLOYED_BRANCH=$(sed -n 's/Remote branch://p' $HOME/report--mode--force-push.txt | sed 's/ //g')
echo "Deployed to $DEPLOYED_BRANCH"
echo
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$TEST_FILE"
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$(cat $HOME/test-file.txt)"
# Demonstration of deployment in 'branch' mode.
# Note that by design, pushing into the same branch will result in the failure
Expand Down Expand Up @@ -155,8 +158,10 @@ jobs:
name: Prepare test file.
command: |
export TEST_FILE="test-file--branch--circleci--${CIRCLE_BRANCH//\//-}.txt"
echo "Deployment 1 for branch $CIRCLE_BRANCH" >> $TEST_FILE
echo "Deployment 1 for branch $CIRCLE_BRANCH" > $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
cat $TEST_FILE
echo $TEST_FILE > $HOME/test-file.txt
- run:
name: Deployment 1
Expand All @@ -172,16 +177,9 @@ jobs:
DEPLOYED_BRANCH=$(sed -n 's/Remote branch://p' $HOME/report--mode--branch.txt | sed 's/ //g')
echo "Deployed to $DEPLOYED_BRANCH"
echo
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$TEST_FILE"
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$(cat $HOME/test-file.txt)"
rm $HOME/report--mode--branch.txt
- run:
name: Update the test file to simulate changes in the source repository.
command: |
export TEST_FILE="test-file--branch--circleci--${CIRCLE_BRANCH//\//-}.txt"
echo "Deployment 2 for branch $CIRCLE_BRANCH" >> $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
- run:
name: Deployment 2 - same branch
command: |
Expand All @@ -194,6 +192,14 @@ jobs:
--debug \
&& { echo "Expected to fail as repeated pushes to the same branch are not allowed, but succeeded" >&2; exit 1; } || echo "Failed as expected"
- run:
name: Update the test file to simulate changes in the source repository.
command: |
export TEST_FILE="test-file--branch--circleci--${CIRCLE_BRANCH//\//-}.txt"
echo "Deployment 2 for branch $CIRCLE_BRANCH" > $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
cat $TEST_FILE
- run:
name: Deployment 2 - new branch
command: |
Expand All @@ -208,7 +214,7 @@ jobs:
DEPLOYED_BRANCH=$(sed -n 's/Remote branch://p' $HOME/report--mode--branch.txt | sed 's/ //g')
echo "Deployed to $DEPLOYED_BRANCH"
echo
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$TEST_FILE"
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$(cat $HOME/test-file.txt)"
workflows:
version: 2
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/test-php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,10 @@ jobs:
- name: Prepare test file.
run: |
export TEST_FILE="test-file--force-push--gha--${GITHUB_BRANCH//\//-}.txt"
echo "Deployment 1 for branch $GITHUB_BRANCH" >> $TEST_FILE
echo "Deployment 1 for branch $GITHUB_BRANCH" > $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
cat $TEST_FILE
echo $TEST_FILE > $HOME/test-file.txt
- name: Deployment 1
run: |
Expand All @@ -132,14 +134,15 @@ jobs:
DEPLOYED_BRANCH=$(sed -n 's/Remote branch://p' $HOME/report--mode--force-push.txt | sed 's/ //g')
echo "Deployed to $DEPLOYED_BRANCH"
echo
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$TEST_FILE"
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$(cat $HOME/test-file.txt)"
rm $HOME/report--mode--force-push.txt
- name: Update the test file to simulate changes in the source repository.
run: |
export TEST_FILE="test-file--force-push--gha--${GITHUB_BRANCH//\//-}.txt"
echo "Deployment 2 for branch $GITHUB_BRANCH" >> $TEST_FILE
echo "Deployment 2 for branch $GITHUB_BRANCH" > $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
cat $TEST_FILE
- name: Deployment 2
run: |
Expand All @@ -154,7 +157,7 @@ jobs:
DEPLOYED_BRANCH=$(sed -n 's/Remote branch://p' $HOME/report--mode--force-push.txt | sed 's/ //g')
echo "Deployed to $DEPLOYED_BRANCH"
echo
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$TEST_FILE"
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$(cat $HOME/test-file.txt)"
# Demonstration of deployment in 'branch' mode.
# Note that by design, pushing into the same branch will result in the failure
Expand Down Expand Up @@ -213,8 +216,10 @@ jobs:
- name: Prepare test file.
run: |
export TEST_FILE="test-file--branch--gha--${GITHUB_BRANCH//\//-}.txt"
echo "Deployment 1 for branch $GITHUB_BRANCH" >> $TEST_FILE
echo "Deployment 1 for branch $GITHUB_BRANCH" > $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
cat $TEST_FILE
echo $TEST_FILE > $HOME/test-file.txt
- name: Deployment 1
run: |
Expand All @@ -229,14 +234,15 @@ jobs:
DEPLOYED_BRANCH=$(sed -n 's/Remote branch://p' $HOME/report--mode--branch.txt | sed 's/ //g')
echo "Deployed to $DEPLOYED_BRANCH"
echo
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$TEST_FILE"
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$(cat $HOME/test-file.txt)"
rm $HOME/report--mode--branch.txt
- name: Update the test file to simulate changes in the source repository.
run: |
export TEST_FILE="test-file--branch--gha--${GITHUB_BRANCH//\//-}.txt"
echo "Deployment 2 for branch $GITHUB_BRANCH" >> $TEST_FILE
echo "Deployment 2 for branch $GITHUB_BRANCH" > $TEST_FILE
date "+%Y%m%d-%H%M%S" >> $TEST_FILE
cat $TEST_FILE
- name: Deployment 2 - same branch
run: |
Expand All @@ -262,4 +268,4 @@ jobs:
DEPLOYED_BRANCH=$(sed -n 's/Remote branch://p' $HOME/report--mode--branch.txt | sed 's/ //g')
echo "Deployed to $DEPLOYED_BRANCH"
echo
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$TEST_FILE"
echo "See https://github.com/drevops/git-artifact-destination/blob/$DEPLOYED_BRANCH/$(cat $HOME/test-file.txt)"

0 comments on commit be7ffff

Please sign in to comment.