Skip to content

Commit

Permalink
testing beta [deploy]
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmortensen committed Aug 16, 2022
1 parent 321852b commit 2e48753
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 27 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Deploys
on:
push:
branches:
- trunk
- test-deploy

jobs:
deploy:
Expand All @@ -24,17 +24,17 @@ jobs:
- name: Sets prerelease to false by default
run: echo "PRERELEASE=false" >> $GITHUB_ENV
- name: Build base image to get Grid version
run: VERSION="local" BUILD_DATE=${BUILD_DATE} make base
run: NAMESPACE=jamesmortensen1 NAME=jamesmortensen1 VERSION="local" BUILD_DATE=${BUILD_DATE} make base
- name: Get Grid version
# sed used to remove last comma of Selenium version output
run: echo "GRID_VERSION=$(docker run --rm selenium/base:local-${BUILD_DATE} java -jar /opt/selenium/selenium-server.jar hub --version | awk '{print $3}' | sed 's/\(.*\),/\1 /')" | awk '{$1=$1;print}' >> $GITHUB_ENV
run: echo "GRID_VERSION=$(docker run --rm jamesmortensen1/base:local-${BUILD_DATE} java -jar /opt/selenium/selenium-server.jar hub --version | awk '{print $3}' | sed 's/\(.*\),/\1 /')" | awk '{$1=$1;print}' >> $GITHUB_ENV
- name: Is it a prerelease?
run: echo "GRID_VERSION=${GRID_VERSION}-prerelease" >> $GITHUB_ENV && echo "PRERELEASE=true" >> $GITHUB_ENV
if: contains(toJson(github.event.commits), '[prerelease]') == true
- name: Display Grid version
run: echo ${GRID_VERSION}
- name: Remove local Docker tag
run: docker rmi selenium/base:local-${BUILD_DATE}
run: docker rmi jamesmortensen1/base:local-${BUILD_DATE}
- name: Sets env var for the next tag
run: echo "NEXT_TAG=${GRID_VERSION}-${BUILD_DATE}" >> $GITHUB_ENV
- name: Get latest tag
Expand All @@ -44,7 +44,7 @@ jobs:
- name: Update tag in docs and files
run: ./update_tag_in_docs_and_files.sh ${LATEST_TAG} ${NEXT_TAG}
- name: Build images
run: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build
run: NAMESPACE=jamesmortensen1 NAME=jamesmortensen1 VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make build
- name: Login Docker Hub
run: docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD"
env:
Expand All @@ -55,25 +55,25 @@ jobs:
with:
timeout_minutes: 20
max_attempts: 3
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release
command: NAME=jamesmortensen1 VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release
- name: Tag images as latest
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f # v2
with:
timeout_minutes: 20
max_attempts: 3
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_latest
command: NAME=jamesmortensen1 VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make tag_latest
- name: Deploy latest tag
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f # v2
with:
timeout_minutes: 20
max_attempts: 3
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_latest
command: NAME=jamesmortensen1 VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} make release_latest
- name: Tag browser images
uses: nick-invision/retry@b4fa57557dda8c2f30bcb2d19372cc3237190f7f # v2
with:
timeout_minutes: 20
max_attempts: 3
command: VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} PUSH_IMAGE=true make tag_and_push_browser_images
command: NAME=jamesmortensen1 NAMESPACE=jamesmortensen1 VERSION="${GRID_VERSION}" BUILD_DATE=${BUILD_DATE} PUSH_IMAGE=true make tag_and_push_browser_images
- name: Commit files
run: |
git config --local user.email "[email protected]"
Expand All @@ -82,10 +82,10 @@ jobs:
- name: Push changes
uses: ad-m/github-push-action@a3fd843e49cd58d296bdd2431c4853569a1b900f # master
with:
github_token: ${{ secrets.SELENIUM_CI_TOKEN }}
branch: trunk
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: test-deploy
- name: Create release notes (release_notes.md)
run: ./generate_release_notes.sh ${LATEST_TAG} origin/trunk ${GRID_VERSION} ${BUILD_DATE}
run: ./generate_release_notes.sh ${LATEST_TAG} origin/test-deploy ${GRID_VERSION} ${BUILD_DATE}
- name: Create Release
id: create_release
uses: actions/create-release@v1
Expand Down
20 changes: 11 additions & 9 deletions generate_release_notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@ HEAD_BRANCH=$2
GRID_VERSION=$3
BUILD_DATE=$4

NAMESPACE=jamesmortensen1

TAG_VERSION=${GRID_VERSION}-${BUILD_DATE}

echo "" >> release_notes.md
echo "### Changelog" > release_notes.md
git --no-pager log "${LATEST_TAG}...${HEAD_BRANCH}" --pretty=format:"* [\`%h\`](http://github.com/seleniumhq/docker-selenium/commit/%H) - %s :: %an" --reverse >> release_notes.md
git --no-pager log "${LATEST_TAG}...${HEAD_BRANCH}" --pretty=format:"* [\`%h\`](http://github.com/seleniumhq/docker-${NAMESPACE}/commit/%H) - %s :: %an" --reverse >> release_notes.md

CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}')
EDGE_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}')
CHROMEDRIVER_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}')
EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}')
FIREFOX_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}')
GECKODRIVER_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}')
FFMPEG_VERSION=$(docker run --entrypoint="" --rm selenium/video:ffmpeg-4.3.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1)
CHROME_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}')
EDGE_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}')
CHROMEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}')
EDGEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}')
FIREFOX_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}')
GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}')
FFMPEG_VERSION=$(docker run --entrypoint="" --rm ${NAMESPACE}/video:ffmpeg-4.3.1-${BUILD_DATE} ffmpeg -version | awk '{print $3}' | head -n 1)


echo "" >> release_notes.md
Expand All @@ -37,7 +39,7 @@ echo "<details>" >> release_notes.md
echo "<summary>Click to see published Docker images</summary>" >> release_notes.md
echo "" >> release_notes.md
echo '```' >> release_notes.md
docker images --filter=reference='selenium/*:*' --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" >> release_notes.md
docker images --filter=reference='${NAMESPACE}/*:*' --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}\t{{.Size}}" >> release_notes.md
echo '```' >> release_notes.md
echo "" >> release_notes.md
echo "</details>" >> release_notes.md
Expand Down
12 changes: 6 additions & 6 deletions tag_and_push_browser_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ echo "Tagging images for browser ${BROWSER}, version ${VERSION}, build date ${BU
case "${BROWSER}" in

chrome)
CHROME_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}')
CHROME_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} google-chrome --version | awk '{print $3}')
echo "Chrome version -> "${CHROME_VERSION}
CHROME_SHORT_VERSION="$(short_version ${CHROME_VERSION})"
echo "Short Chrome version -> "${CHROME_SHORT_VERSION}

CHROMEDRIVER_VERSION=$(docker run --rm selenium/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}')
CHROMEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-chrome:${TAG_VERSION} chromedriver --version | awk '{print $2}')
echo "ChromeDriver version -> "${CHROMEDRIVER_VERSION}
CHROMEDRIVER_SHORT_VERSION="$(short_version ${CHROMEDRIVER_VERSION})"
echo "Short ChromeDriver version -> "${CHROMEDRIVER_SHORT_VERSION}
Expand Down Expand Up @@ -64,12 +64,12 @@ chrome)

;;
edge)
EDGE_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}')
EDGE_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} microsoft-edge --version | awk '{print $3}')
echo "Edge version -> "${EDGE_VERSION}
EDGE_SHORT_VERSION="$(short_version ${EDGE_VERSION})"
echo "Short Edge version -> "${EDGE_SHORT_VERSION}

EDGEDRIVER_VERSION=$(docker run --rm selenium/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}')
EDGEDRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-edge:${TAG_VERSION} msedgedriver --version | awk '{print $4}')
echo "EdgeDriver version -> "${EDGEDRIVER_VERSION}
EDGEDRIVER_SHORT_VERSION="$(short_version ${EDGEDRIVER_VERSION})"
echo "Short EdgeDriver version -> "${EDGEDRIVER_SHORT_VERSION}
Expand Down Expand Up @@ -108,11 +108,11 @@ edge)

;;
firefox)
FIREFOX_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}')
FIREFOX_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} firefox --version | awk '{print $3}')
echo "Firefox version -> "${FIREFOX_VERSION}
FIREFOX_SHORT_VERSION="$(short_version ${FIREFOX_VERSION})"
echo "Short Firefox version -> "${FIREFOX_SHORT_VERSION}
GECKODRIVER_VERSION=$(docker run --rm selenium/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}')
GECKODRIVER_VERSION=$(docker run --rm ${NAMESPACE}/node-firefox:${TAG_VERSION} geckodriver --version | awk 'NR==1{print $2}')
echo "GeckoDriver version -> "${GECKODRIVER_VERSION}
GECKODRIVER_SHORT_VERSION="$(short_version ${GECKODRIVER_VERSION})"
echo "Short GeckoDriver version -> "${GECKODRIVER_SHORT_VERSION}
Expand Down

0 comments on commit 2e48753

Please sign in to comment.