From 6db1aada9d6bf99aaf443794c63624e36a0319d8 Mon Sep 17 00:00:00 2001 From: Alex Lubbock Date: Sat, 10 Jun 2023 00:02:10 +0100 Subject: [PATCH] chore: rename master branch to main (#12) --- .github/workflows/test-and-deploy.yml | 8 +-- docker-deploy.sh | 71 --------------------------- 2 files changed, 4 insertions(+), 75 deletions(-) delete mode 100755 docker-deploy.sh diff --git a/.github/workflows/test-and-deploy.yml b/.github/workflows/test-and-deploy.yml index e332c801..2d231269 100644 --- a/.github/workflows/test-and-deploy.yml +++ b/.github/workflows/test-and-deploy.yml @@ -3,7 +3,7 @@ name: Test and deploy on: push: branches: - - master + - main tags: - v* pull_request: {} @@ -55,10 +55,10 @@ jobs: - name: Set release or dev mode id: release_mode run: | - if [ "$GITHUB_REF" == "refs/heads/master" ]; then + if [ "$GITHUB_REF" == "refs/heads/main" ]; then echo "::set-output name=qs_branch::dev" else - echo "::set-output name=qs_branch::master" + echo "::set-output name=qs_branch::main" echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}" fi - name: Download build image artifact @@ -79,7 +79,7 @@ jobs: - name: Update and push quickstart repo run: | set -e - if [ "$GITHUB_REF" != "refs/heads/master" ]; then + if [ "$GITHUB_REF" != "refs/heads/main" ]; then GITHUB_TAG=${GITHUB_REF/refs\/tags\//} echo "GitHub Tag: $GITHUB_TAG" fi diff --git a/docker-deploy.sh b/docker-deploy.sh deleted file mode 100755 index 09bb4498..00000000 --- a/docker-deploy.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/bin/bash -set -ex -if [ "$TRAVIS_BRANCH" != "master" ] && [ -z "$TRAVIS_TAG" ]; then - echo "Not master branch or a tag. Skipping deploy." - exit 0 -fi - -if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then - echo "Pull request. Skipping deploy." - exit 0 -fi - -if [[ $DOCKER_PASSWORD ]]; then - echo "$DOCKER_PASSWORD" | docker login -u alubbock --password-stdin -else - echo "DOCKER_PASSWORD not set, skipping login" -fi - -# sudo b/c docker runs with elevated permissions, and creates otherwise unwriteable directories -sudo python thunorbld.py build || exit $? - -# prepare SSH key for quickstart update -openssl aes-256-cbc -K $encrypted_15ee0f1bc0f8_key -iv $encrypted_15ee0f1bc0f8_iv \ - -in .thunor_web_quickstart_deploy_key.enc -out ./.thunor_web_quickstart_deploy_key -d -chmod 600 ./.thunor_web_quickstart_deploy_key -mv ./.thunor_web_quickstart_deploy_key ~/.ssh/id_rsa - -# Get the quickstart repo -git clone git@github.com:/alubbock/thunor-web-quickstart -cd thunor-web-quickstart - -if [[ $TRAVIS_TAG ]]; then - echo "Release build: $TRAVIS_TAG" - docker tag alubbock/thunorweb:dev alubbock/thunorweb:latest - docker push alubbock/thunorweb:latest - docker tag alubbock/thunorweb:dev "alubbock/thunorweb:$TRAVIS_TAG" - docker push "alubbock/thunorweb:$TRAVIS_TAG" - git checkout master -else - echo "Dev build" - docker push alubbock/thunorweb:dev - git checkout dev -fi - -# Copy files to quickstart repo and push -cp ../thunorctl.py . -cp ../docker-compose.services.yml . -cp ../docker-compose.certbot.yml . -rm -rf config-examples -cp -r ../config-examples . -if [ -z "$TRAVIS_TAG" ]; then - sed -i 's/thunorweb:latest/thunorweb:dev/' docker-compose.services.yml - echo "$TRAVIS_COMMIT" > .release -else - sed -i "s/thunorweb:latest/thunorweb:$TRAVIS_TAG/" docker-compose.services.yml - echo "$TRAVIS_TAG" > .release -fi -git add -A -git status - -if [[ $TRAVIS_TAG ]]; then - git commit -m "Travis update: $TRAVIS_TAG" - git tag "$TRAVIS_TAG" - git push --tags - # Make another commit referencing "latest" at HEAD - sed -i "s/thunorweb:$TRAVIS_TAG/thunorweb:latest/" docker-compose.services.yml - git add docker-compose.services.yml -fi - -git commit -m "Travis update: $TRAVIS_COMMIT" -git push