aws-amplify / aws-amplify/amplify-hosting
Trigger a build to deploy the latest commit
- Dominant language
- Dockerfile
- Stars
- 481
- Forks
- 123
- PR merge metrics
- No merged PRs in 30d
Description
1. **Issue Description**
When I am clicking on "Redeploy this version", after cloning the repository, amplify is doing git checkout to an old commit, which I think is of the time when I connected the branch.
1. **Detailed Steps To Reproduce**
1. integrate a branch and deploy it.
2. disable Auto-Build for that branch.
3. commit something in the branch.
4. try "Redeploy this version", and after complete deployment check if new changes are coming.
1. Amplify console logs under "Cloning repository"
```
2020-04-16T15:26:39.797Z [INFO]: Git SSH Key acquired
2020-04-16T15:26:39.863Z [INFO]: # Cloning repository: SENSITIVE_DATA
2020-04-16T15:26:39.991Z [INFO]: Agent pid 117
2020-04-16T15:26:39.995Z [INFO]: Identity added: /root/.ssh/git_rsa (/root/.ssh/git_rsa)
2020-04-16T15:26:40.245Z [INFO]: Cloning into SENSITIVE_DATA
2020-04-16T15:26:40.520Z [INFO]: Warning: Permanently added the RSA host key for IP address SENSITIVE_DATA to the list of known hosts.
2020-04-16T15:26:49.307Z [INFO]: # Switching to commit: COMMIT_ID
2020-04-16T15:26:49.652Z [INFO]: Note: checking out 'COMMIT_ID'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b
HEAD is now at SENSITIVE_DATA Merge pull request SENSITIVE_DATA from SENSITIVE_DATA
2020-04-16T15:26:49.653Z [INFO]: # Checking for Git submodules at: /codebuild/output/src076219606/src/FOLDER_NAME/.gitmodules
2020-04-16T15:26:49.675Z [INFO]: # Retrieving cache...
2020-04-16T15:26:55.960Z [INFO]: # Extracting cache...
2020-04-16T15:27:02.145Z [INFO]: # Extraction completed
2020-04-16T15:27:02.501Z [INFO]: # Retrieving environment cache...
2020-04-16T15:27:02.546Z [INFO]: # Retrieved environment cache
```
1. **Expected behavior**
Each time I click on "Redeploy this version", the respective branch should be fetched from GitHub and it should be deployed with new changes, i.e. there must not be any checkout until unless I mention in the build settings.
1. **Application Details**
a. Amplify Console AppID: `d392v2bx7rclk2 `
__If the issue is related to a build, please also share:__
b. The specific Branch and Build number we should investigate
branch name: `release-6.4`
build number: 4
c. Your build spec
```
version: 1.0
frontend:
phases:
preBuild:
commands:
- cd react
- npm i
build:
commands:
- if [ "${ENV_V1}" = "x1" ] && [ "${ENV_V2}" = "y1" ]; then npm run build-test-km; fi
- if [ "${ENV_V1}" = "x2" ] && [ "${ENV_V2}" = "y1" ]; then npm run build-staging-km; fi
- if [ "${ENV_V1}" = "x1" ] && [ "${ENV_V2}" = "y2" ]; then npm run build-test-al; fi
- if [ "${ENV_V1}" = "x2" ] && [ "${ENV_V2}" = "y2" ]; then npm run build-staging-al; fi
- if [ "${ENV_V1}" = "x3" ] && [ "${ENV_V2}" = "y1" ]; then npm run build-prod-km; fi
- if [ "${ENV_V1}" = "x3" ] && [ "${ENV_V2}" = "y2" ]; then npm run build-prod-al; fi
# If no environment variable is provided then build kommunicate test bundle.
- if [ "${ENV_V1}" = "" ] || [ "${ENV_V2}" = "" ]; then npm run build-test-km; fi
artifacts:
# build output directory
baseDirectory: react/build
files:
- '**/*'
cache:
paths:
- react/node_modules/**/*
# - react/package-lock.json
customHeaders:
- pattern: '**/*'
headers:
- key: 'Cache-Control'
# 15 day
value: 'public, must-revalidate, max-age=1296000'
# dont cache index.html
- pattern: '**/*.html'
headers:
- key: 'Cache-Control'
value: 'no-cache, no-store, must-revalidate'
```
Contributor guide
Assessment
This issue has not been assessed yet.