This is an automated email from the ASF dual-hosted git repository. rlenferink pushed a commit to branch remove-unused-file in repository https://gitbox.apache.org/repos/asf/celix-site.git
commit fccd6105aeb22a959c55b2ad19b3577125e41089 Author: Roy Lenferink <[email protected]> AuthorDate: Sun Jul 17 20:28:07 2022 +0200 Delete unused publish.sh file This file was initially created to be able to upload generated website sources. This however, in 2020, was replaced with a Jenkinsfile for building and deploying from the ASF ci-builds Jenkins environment. --- publish.sh | 91 -------------------------------------------------------------- 1 file changed, 91 deletions(-) diff --git a/publish.sh b/publish.sh deleted file mode 100755 index 51429a8..0000000 --- a/publish.sh +++ /dev/null @@ -1,91 +0,0 @@ -#!/usr/bin/env bash - -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with -# this work for additional information regarding copyright ownership. -# The ASF licenses this file to You under the Apache License, Version 2.0 -# (the "License"); you may not use this file except in compliance with -# the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# A script to build the Celix site (based on Hugo) - -# Input parameters -GIT_REMOTE=$1 -if [[ -z "${GIT_REMOTE}" ]]; then - echo "Git remote is not specified!" - echo "" - echo "Usage:" - echo " ./publish.sh <remote>" - echo " e.g." - echo " ./publish.sh origin" - exit 1 -fi - -# specify source and site branches -SOURCE="master" -SITE="asf-site" - -# Make sure the SOURCE branch is active -git checkout ${SOURCE} > /dev/null 2>&1 - -# Get the latest commit SHA in SOURCE branch -last_SHA=( $(git log -n 1 --pretty=format:"%H") ) - -# Create a temporary folder -tmp_dir=`mktemp -d` -out_dir=${tmp_dir}/content -mkdir -p ${out_dir} - -# Build the site to our temporary folder -hugo --destination ${out_dir} > /dev/null 2>&1 -if [ $? = 0 ]; then - echo "Hugo build successful" -else - echo "Hugo build failed" - exit 1 -fi - -# Switch to the SITE branch -git checkout ${SITE} > /dev/null 2>&1 - -# Remove the current contents of the SITE branch and replace them with the contents of the temp folder -current_dir=${PWD} -rm -rf ${current_dir}/content -git rm -r --cached content/* > /dev/null 2>&1 -mkdir -p ${current_dir}/content -cp -rT ${tmp_dir}/* ${current_dir}/content - -# Commit the changes to the SITE branch -message="Updated site from ${SOURCE} (${last_SHA})" -git add -A -git commit -m "${message}" > /dev/null 2>&1 - -# Delete the temporary folder -rm -rf ${tmp_dir} - -# Push the SOURCE to the server -git push -u ${GIT_REMOTE} ${SOURCE} > /dev/null 2>&1 -if [ $? = 0 ]; then - echo "Push ${SOURCE} successful" -else - echo "Push ${SOURCE} failed" -fi - -# Push the SITE to the server -git push -u ${GIT_REMOTE} ${SITE} > /dev/null 2>&1 -if [ $? = 0 ]; then - echo "Push ${SITE} successful" -else - echo "Push ${SITE} failed" -fi - -# Switch back to SOURCE branch -git checkout ${SOURCE} > /dev/null 2>&1
