Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

Commit

Permalink
Add fct version-read within fct version + Move fcts up and down in th…
Browse files Browse the repository at this point in the history
…e code
  • Loading branch information
pascalandy committed Apr 26, 2022
1 parent 140ecae commit bf3629d
Showing 1 changed file with 60 additions and 56 deletions.
116 changes: 60 additions & 56 deletions bashlava.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
#!/usr/bin/env bash


function mainbranch {
App_Is_edge
App_Is_commit_unpushed
App_Are_files_existing
App_Is_required_apps_installed
App_Get_var_from_dockerfile

App_Show_version_from_three_sources

# Update our local state
git checkout ${default_branch} &&\
git pull origin ${default_branch} &&\
log

# next step is to: tag and release
}

function edge {
# it assumes there will be no conflict with anybody else
# as I'm the only person using 'edge'.
App_Is_commit_unpushed

# delete branch
git branch -d edge || true &&\
# delete branch so there is no need to use the github GUI to delete it
git push origin --delete edge || true &&\

git checkout -b edge &&\
git push --set-upstream origin edge -f &&\
my_message="<edge> was freshly branched out from ${default_branch}" App_Blue
}

function commit {
# if no attribute were past, well... let's see what changed:
if [[ "${input_2}" == "not-set" ]]; then
Expand All @@ -12,6 +45,31 @@ function commit {
version-read-from-dockerfile
}

function pr {
App_Is_edge
App_Is_commit_unpushed
App_Get_var_from_dockerfile
App_Is_required_apps_installed

pr_title=$(git log --format=%B -n 1 $(git log -1 --pretty=format:"%h") | cat -)
gh pr create --fill --title "${pr_title}" --base "${default_branch}" &&\
gh pr view --web

# if the upstream is wrong, we can reset it:
# https://github.com/cli/cli/issues/2300
# git config --local --get-regexp '\.gh-resolved$' | cut -f1 -d' ' | xargs -L1 git config --unset
}

# TODO add fct ci here 0o0o

function mrg {
App_Is_edge
App_Is_commit_unpushed
App_Get_var_from_dockerfile

gh pr merge
}

function version {
# The version is tracked in a Dockerfile (it's cool if your project don't use docker)
# For BashLaVa, this Dockerfile is just a config-env file
Expand Down Expand Up @@ -51,50 +109,11 @@ function version {
App_Get_var_from_dockerfile
git add . &&\
git commit . -m "Update ${app_name} to version ${app_release} /Dockerfile" &&\
git push

log
# next step: tag
}

function mainbranch {
App_Is_edge
App_Is_commit_unpushed
App_Are_files_existing
App_Is_required_apps_installed
App_Get_var_from_dockerfile
git push && echo &&\

App_Show_version_from_three_sources
version-read && sleep 1 && echo &&\

# Update our local state
git checkout ${default_branch} &&\
git pull origin ${default_branch} &&\
log

# next step is to: tag and release
}

function pr {
App_Is_edge
App_Is_commit_unpushed
App_Get_var_from_dockerfile
App_Is_required_apps_installed

pr_title=$(git log --format=%B -n 1 $(git log -1 --pretty=format:"%h") | cat -)
gh pr create --fill --title "${pr_title}" --base "${default_branch}" &&\
gh pr view --web

# if the upstream is wrong, we can reset it:
# https://github.com/cli/cli/issues/2300
# git config --local --get-regexp '\.gh-resolved$' | cut -f1 -d' ' | xargs -L1 git config --unset
}

function mrg {
App_Is_edge
App_Is_commit_unpushed
App_Get_var_from_dockerfile

gh pr merge
}

function tag {
Expand Down Expand Up @@ -219,21 +238,6 @@ function gitio {
#
#

function edge {
# it assumes there will be no conflict with anybody else
# as I'm the only person using 'edge'.
App_Is_commit_unpushed

# delete branch
git branch -d edge || true &&\
# delete branch so there is no need to use the github GUI to delete it
git push origin --delete edge || true &&\

git checkout -b edge &&\
git push --set-upstream origin edge -f &&\
my_message="<edge> was freshly branched out from ${default_branch}" App_Blue
}

function squash {
App_Is_commit_unpushed
App_Is_input_2
Expand Down

0 comments on commit bf3629d

Please sign in to comment.