Skip to content

Commit

Permalink
Revert some mistakenly merged/pushed code
Browse files Browse the repository at this point in the history
* Revert "fix"

This reverts commit 93585b0.

* Revert "Version control git (#6562)"

This reverts commit 52b8775.

* Revert "Revert "[files/build/versions]: support reproduceable build for git (#5774)""

This reverts commit 1cb8daf.

* Revert "[files/build/versions]: support reproduceable build for git (#5774)"

This reverts commit 547aa9b.
  • Loading branch information
qiluo-msft committed Jun 21, 2021
1 parent 7e4d42e commit 8b7091f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 77 deletions.
55 changes: 55 additions & 0 deletions .azure-pipelines/azure-pipelines-UpgrateVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ stages:
pool:
vmImage: 'ubuntu-20.04'
steps:
- script: |
if [ -z "$(which gh)" ]; then
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key C99B11DEB97541F0
sudo apt-add-repository https://cli.github.com/packages
sudo apt update
sudo apt install gh
fi
displayName: 'Install gh'
- checkout: self
displayName: 'Checkout code'
- download: current
Expand All @@ -83,6 +91,53 @@ stages:
done
git diff files/build/versions
displayName: 'Freeze Versions'
- script: |
if [ -z "$GIT_USER" ]; then
echo "Skipped to send the pull request, GIT_USER not set."
exit 0
fi
GIT_STATUS=$(git status --porcelain files/build/versions)
if [ -z "$GIT_STATUS" ]; then
echo "Skipped to send the pull request, no version change in files/build/versions"
exit 0
fi
if [ ! -d "$HOME" ]; then
sudo mkdir -p $HOME
sudo chown -R $(id -un):$(id -gn) $HOME
fi
SOURCE_BRANCH=$(Build.SourceBranch)
REPO_NAME=$(Build.Repository.Name)
[ -z "$GIT_REPO" ] && GIT_REPO=${REPO_NAME#*/}
BRANCH_NAME=repd/versions/${SOURCE_BRANCH#refs/heads/}
echo '#!/bin/bash' > git_env_password.sh
echo 'echo $GIT_PASSWORD' >> git_env_password.sh
chmod a+x git_env_password.sh
export GIT_ASKPASS=./git_env_password.sh
git config user.name $GIT_USER
git config credential.https://github.com.username $GIT_USER
git add files/build/versions
git commit -m "[ci/build]: Upgrade SONiC package versions"
git checkout -b $BRANCH_NAME
git remote add remote https://github.com/$GIT_USER/$GIT_REPO
git push remote HEAD:refs/heads/$BRANCH_NAME -f
git branch -u remote/$BRANCH_NAME
echo $GIT_PASSWORD | gh auth login --with-token
TITLE="Upgrade SONiC Versions"
BODY="Upgrade SONiC Versions"
RET=0
if ! gh pr create -t "$TITLE" -b "$BODY" -B $(Build.SourceBranch) -R $(Build.Repository.Name) > pr.log 2>&1; then
if ! grep -q "already exists" pr.log; then
RET=1
fi
fi
cat pr.log
exit $RET
env:
GIT_USER: $(GIT_USER)
GIT_PASSWORD: $(GIT_PASSWORD)
displayName: 'Send Pull Request'
- publish: $(System.DefaultWorkingDirectory)/files/build/versions
artifact: 'sonic-buildimage.versions'
displayName: 'Archive SONiC versions'
Expand Down
2 changes: 1 addition & 1 deletion Makefile.work
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ $(shell CONFIGURED_ARCH=$(CONFIGURED_ARCH) MULTIARCH_QEMU_ENVIRON=$(MULTIARCH_QE
$(shell BUILD_SLAVE=y scripts/prepare_docker_buildinfo.sh $(SLAVE_BASE_IMAGE) $(SLAVE_DIR)/Dockerfile $(CONFIGURED_ARCH) "" $(BLDENV))

# Add the versions in the tag, if the version change, need to rebuild the slave
SLAVE_BASE_TAG = $(shell cat $(SLAVE_DIR)/Dockerfile $(SLAVE_DIR)/buildinfo/versions/versions-* src/sonic-build-hooks/hooks/* | sha1sum | awk '{print substr($$1,0,11);}')
SLAVE_BASE_TAG = $(shell cat $(SLAVE_DIR)/Dockerfile $(SLAVE_DIR)/buildinfo/versions/versions-* | sha1sum | awk '{print substr($$1,0,11);}')
SLAVE_TAG = $(shell cat $(SLAVE_DIR)/Dockerfile.user $(SLAVE_DIR)/Dockerfile $(SLAVE_DIR)/buildinfo/versions/versions-* | sha1sum | awk '{print substr($$1,0,11);}')

OVERLAY_MODULE_CHECK := \
Expand Down
76 changes: 0 additions & 76 deletions src/sonic-build-hooks/hooks/git

This file was deleted.

0 comments on commit 8b7091f

Please sign in to comment.