Home
About
Blog
Products
Forum
Support
Contact
Sunbelt Computer Software
PL/B Language Development and Support
Home
About
Blog
Products
Forum
Support
Contact
haproxy/scripts/publish-release at master · sourcecodecheck/haproxy · GitHub
Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
See all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
sourcecodecheck
haproxy
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
master
Breadcrumbs
haproxy
/
scripts
/
publish-release
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
executable file
·
185 lines (154 loc) · 4.85 KB
master
Breadcrumbs
haproxy
/
scripts
/
publish-release
Copy path
Top
File metadata and controls
Code
Blame
executable file
·
185 lines (154 loc) · 4.85 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
#!
/usr/bin/env bash
#
puts the public files online after a release
#
Copyright (c) 2006-2016 Willy Tarreau <w@1wt.eu>
#
#
In short :
#
- requires git
#
- no restriction to master, uses last tag
#
- copies & compresses files, changelog & docs to the final destination
#
- shows a listing of the final file
USAGE=
"
Usage:
${0
##*/
}
[-a] [-q] [-y] [-b branch] [-n newver] DIR
"
CMD_GZIP=
"
${CMD_GZIP
:-
gzip -nc9}
"
TARGET_DIR=
OUTPUT=
SAYYES=
BRANCH=
DEVEL=
QUIET=
AUTO=
NEW=
DIR=
DOC=( )
die
() {
[
"
$#
"
-eq
0 ]
||
echo
"
$*
"
>&2
exit
1
}
err
() {
echo
"
$*
"
>&2
}
quit
() {
[
"
$#
"
-eq
0
-o
-n
"
$QUIET
"
]
||
echo
"
$*
"
exit
0
}
while
[
-n
"
$1
"
-a
-z
"
${1
##
-
*
}
"
]
;
do
case
"
$1
"
in
-a) AUTO=1
;
shift
;;
-q) QUIET=1
;
shift
;;
-y) SAYYES=1
;
shift
;;
-b) BRANCH=
"
$2
"
;
shift
2 ;;
-n) NEW=
"
$2
"
;
shift
2 ;;
-h|--help) quit
"
$USAGE
"
;;
*
) die
"
$USAGE
"
;;
esac
done
if
[
$#
-ne
1 ]
;
then
die
"
$USAGE
"
fi
DIR=
"
$1
"
;
shift
if
[
-z
"
$DIR
"
]
;
then
die
"
Missing target directory name.
"
fi
if
[
-n
"
${DIR
##/*
}
"
]
;
then
DIR=
"
$PWD
/
$DIR
"
fi
if
[
!
-d
"
$DIR
/.
"
]
;
then
die
"
Target directory doesn't exist :
$DIR
"
fi
if
!
git rev-parse --verify -q HEAD
>
/dev/null
;
then
die
"
Failed to check git HEAD.
"
fi
#
we want to go to the git top dir
toplvl=
$(
git rev-parse --show-toplevel
)
if
[
-n
"
$toplvl
"
]
;
then
cd
"
$toplvl
"
fi
#
ensure that a master branch exists here
if
[
-z
"
$(
git rev-parse --verify -q master
2>
/dev/null
)
"
]
;
then
die
"
Current directory doesn't seem to be a valid git directory (no master branch).
"
fi
if
[
"
$(
git rev-parse --verify -q HEAD
)
"
!=
"
$(
git rev-parse --verify -q master
)
"
]
;
then
die
"
git HEAD doesn't match master branch.
"
fi
if
[
"
$(
git diff HEAD
2>
/dev/null
|
wc -c
)
"
!=
0 ]
;
then
err
"
You appear to have uncommitted local changes, please commit them first :
"
git status -s -uno
>&2
die
fi
if
[
-z
"
$NEW
"
-o
-n
"
$AUTO
"
]
;
then
if
[
-z
"
$NEW
"
]
;
then
NEW=
"
$(
git describe --tags HEAD --abbrev=0
)
"
NEW=
"
${NEW
#
v}
"
if
[
-z
"
$NEW
"
]
;
then
die
"
Fatal: cannot determine new version, please specify it.
"
fi
fi
if
[
"
$(
git describe --tags HEAD
)
"
!=
"
v
$NEW
"
]
;
then
if
[
-n
"
$AUTO
"
]
;
then
quit
"
Not tagged, nothing to do.
"
fi
die
"
Current version doesn't seem tagged, it reports
$(
git describe --tags
"
v
$NEW
"
)
. Did you release it ?
"
fi
fi
if
!
git show-ref --tags
"
v
$NEW
"
>
/dev/null
;
then
die
"
git tag v
$NEW
doesn't exist, did you create the release ?
"
fi
#
determine the product branch from the new release
if
[
-z
"
$BRANCH
"
]
;
then
subvers=
${NEW
#
[0-9]
*
.[0-9]
*
[-.]
*
[0-9].}
[
"
${subvers}
"
=
"
${NEW}
"
]
&&
subvers=
"
"
major=
${NEW
%
.
$subvers
}
branch_ext=
${major
#*
[0-9].
*
[0-9]}
BRANCH=
${major
%
${branch_ext}
}
fi
TARGET_DIR=
"
$DIR
/
$BRANCH
"
if
[
!
-d
"
$TARGET_DIR
/.
"
]
;
then
die
"
Target directory doesn't contain branch
$BRANCH
. You may have to create it in
$DIR
.
"
fi
if
[
-z
"
${NEW
##*
-dev
*
}
"
]
;
then
DEVEL=
"
/devel
"
fi
if
[
-n
"
$AUTO
"
-a
-e
"
$TARGET_DIR
/src
${DEVEL}
/haproxy-
$NEW
.tar.gz.md5
"
]
;
then
quit
"
Version
$NEW
Already released.
"
fi
if
!
mkdir -p
"
$TARGET_DIR
/src
$DEVEL
"
"
$TARGET_DIR
/doc
"
;
then
die
"
failed to create target directories.
"
fi
case
"
$BRANCH
"
in
1.3) DOC=( doc/{haproxy-en,haproxy-fr,configuration,architecture}.txt ) ;;
1.4) DOC=( doc/{haproxy-en,haproxy-fr,configuration}.txt ) ;;
1.5) DOC=( doc/{coding-style,configuration,proxy-protocol}.txt ) ;;
1.6) DOC=( doc/{coding-style,intro,management,configuration,proxy-protocol,lua}.txt ) ;;
*
) DOC=( doc/{coding-style,intro,management,configuration,proxy-protocol,lua,SPOE}.txt ) ;;
esac
if
[
-z
"
$AUTO
"
]
;
then
echo
"
Ready to produce the following files in
$TARGET_DIR
/ :
"
echo
"
haproxy-
$NEW
.tar.gz -> src
${DEVEL}
/
"
echo
"
CHANGELOG -> src/CHANGELOG
"
echo
"
${DOC[@]}
-> doc/*{,.gz}
"
echo
git ls-tree -l --abbrev=12
"
v
$NEW
"
-- CHANGELOG
"
${DOC[@]}
"
if
[
-z
"
$SAYYES
"
]
;
then
echo
"
Press ENTER to continue or Ctrl-C to abort now!
"
read
fi
fi
echo
"
Archiving sources for version
$NEW
...
"
rm -f
"
${TARGET_DIR}
/src
${DEVEL}
/haproxy-
${NEW}
.tar.gz
"
{,.md5,.sha256}
if
!
git archive --format=tar --prefix=
"
haproxy-
${NEW}
/
"
"
v
$NEW
"
|
\
$CMD_GZIP
>
"
${TARGET_DIR}
/src
${DEVEL}
/haproxy-
${NEW}
.tar.gz
"
;
then
die
"
Failed to produce the tar.gz archive
"
fi
(
cd
"
$TARGET_DIR
/src
${DEVEL}
"
;
\
md5sum haproxy-
$NEW
.tar.gz
>
haproxy-
$NEW
.tar.gz.md5
;
\
sha256sum haproxy-
$NEW
.tar.gz
>
haproxy-
$NEW
.tar.gz.sha256 )
echo
"
Extracting doc ...
"
git show
"
v
$NEW
:CHANGELOG
"
>
"
$TARGET_DIR
/src/CHANGELOG
"
for
i
in
"
${DOC[@]}
"
;
do
git show
"
v
$NEW
:
$i
"
>
"
$TARGET_DIR
/doc/
${i
#
doc
/
}
"
$CMD_GZIP
<
"
$TARGET_DIR
/doc/
${i
#
doc
/
}
"
>
"
$TARGET_DIR
/doc/
${i
#
doc
/
}
.gz
"
done
echo
"
Done : ls -l
${TARGET_DIR}
"
(
cd
"
$TARGET_DIR
"
;
ls -l src/CHANGELOG
"
src
${DEVEL}
/haproxy-
${NEW}
"
.tar.gz{,.md5,.sha256}
$(
for i
in
"
${DOC[@]}
"
;
do
echo
"
doc/
${i
#
doc
/
}
"
{,.gz}
;
done
)
)
echo
You can’t perform that action at this time.