Skip to content

Commit ea9485c

Browse files
authored
feat(build): cstor repo migration to mayadata-io org (#91)
Signed-off-by: Pawan <[email protected]>
1 parent 3582b69 commit ea9485c

File tree

6 files changed

+42
-13
lines changed

6 files changed

+42
-13
lines changed

.github/workflows/build.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ jobs:
5353
- name: Set Branch
5454
run: |
5555
BRANCH="${GITHUB_REF##*/}"
56-
REPO_ORG=${{ github.repository_owner }}
56+
CSTOR_ORG="mayadata-io"
5757
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
58-
echo "REPO_ORG=${REPO_ORG}" >> $GITHUB_ENV
58+
echo "CSTOR_ORG=${CSTOR_ORG}" >> $GITHUB_ENV
5959
6060
- name: Install Tool dependencies
6161
run: buildscripts/install-tool-dep.sh
@@ -121,6 +121,11 @@ jobs:
121121
with:
122122
platforms: all
123123

124+
- name: Set Repo Org
125+
run: |
126+
CSTOR_ORG="mayadata-io"
127+
echo "CSTOR_ORG=${CSTOR_ORG}" >> $GITHUB_ENV
128+
124129
- name: Set up Docker Buildx
125130
id: buildx
126131
uses: docker/setup-buildx-action@v1
@@ -161,6 +166,7 @@ jobs:
161166
DBUILD_REPO_URL=https://github.com/openebs/libcstor
162167
DBUILD_SITE_URL=https://openebs.io
163168
BRANCH=${{ env.BRANCH }}
169+
CSTOR_ORG=${{ env.CSTOR_ORG }}
164170
165171
cstor:
166172
runs-on: ubuntu-latest

.github/workflows/pull_request.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@ jobs:
5050
- name: Set Branch
5151
run: |
5252
BRANCH="${GITHUB_REF##*/}"
53-
REPO_ORG=${{ github.repository_owner }}
53+
CSTOR_ORG="mayadata-io"
5454
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
55-
echo "REPO_ORG=${REPO_ORG}" >> $GITHUB_ENV
55+
echo "CSTOR_ORG=${CSTOR_ORG}" >> $GITHUB_ENV
5656
5757
- name: Install Tool dependencies
5858
run: buildscripts/install-tool-dep.sh
@@ -79,6 +79,11 @@ jobs:
7979
with:
8080
platforms: all
8181

82+
- name: Set Repo Org
83+
run: |
84+
CSTOR_ORG="mayadata-io"
85+
echo "CSTOR_ORG=${CSTOR_ORG}" >> $GITHUB_ENV
86+
8287
- name: Set up Docker Buildx
8388
id: buildx
8489
uses: docker/setup-buildx-action@v1
@@ -94,3 +99,6 @@ jobs:
9499
platforms: linux/amd64, linux/arm64
95100
tags: |
96101
openebs/cstor-base:ci
102+
build-args: |
103+
CSTOR_ORG=${{ env.CSTOR_ORG }}
104+

.github/workflows/release.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ jobs:
4444
echo "TAG=${TAG}" >> $GITHUB_ENV
4545
echo "RELEASE_TAG=${TAG}" >> $GITHUB_ENV
4646
47+
- name: Set Repo Org
48+
run: |
49+
CSTOR_ORG="mayadata-io"
50+
echo "CSTOR_ORG=${CSTOR_ORG}" >> $GITHUB_ENV
51+
4752
- name: Docker meta
4853
id: docker_meta
4954
uses: crazy-max/ghaction-docker-meta@v1
@@ -107,6 +112,7 @@ jobs:
107112
DBUILD_REPO_URL=https://github.com/openebs/libcstor
108113
DBUILD_SITE_URL=https://openebs.io
109114
RELEASE_TAG=${{ env.RELEASE_TAG }}
115+
CSTOR_ORG=${{ env.CSTOR_ORG }}
110116
111117
cstor:
112118
runs-on: ubuntu-latest

buildscripts/install-test-dep.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17-
if [ -z "${REPO_ORG}" ]; then
18-
echo "REPO_ORG variable not set. Required for fetching dependent build repositories"
17+
if [ -z "${CSTOR_ORG}" ]; then
18+
echo "CSTOR_ORG variable not set. Required for fetching dependent build repositories"
1919
exit 1
2020
else
21-
echo "Using repository organization: ${REPO_ORG}"
21+
echo "Using repository organization: ${CSTOR_ORG}"
2222
fi
2323

2424
if [ -z "${BRANCH}" ]; then
@@ -57,7 +57,7 @@ make -j4
5757
cd ..
5858

5959
# we need cstor headers
60-
git clone "https://github.com/${REPO_ORG}/cstor.git"
60+
git clone "https://github.com/${CSTOR_ORG}/cstor.git"
6161
cd cstor || exit 1
6262
if [ "${BRANCH}" == "develop" ]; then
6363
git checkout develop

docker/build.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,14 @@
1414
# See the License for the specific language governing permissions and
1515
# limitations under the License.
1616

17+
if [ -z "${CSTOR_ORG}" ]; then
18+
echo "CSTOR_ORG variable not set. Required for fetching dependent build repositories"
19+
exit 1
20+
else
21+
echo "Using cstor organization: ${CSTOR_ORG}"
22+
fi
23+
24+
1725
# enable gtest for builds
1826
cd /usr/src/gtest && \
1927
cmake -DBUILD_SHARED_LIBS=ON CMakeLists.txt && \
@@ -22,24 +30,24 @@ cd /usr/src/gtest && \
2230
cd /libcstor
2331

2432
# clone cstor repo for required library files
25-
git clone https://github.com/openebs/cstor.git && \
33+
git clone https://github.com/$CSTOR_ORG/cstor.git && \
2634
cd cstor && \
2735
git checkout develop && \
2836
cd ..
2937

3038
# build libcstor
3139
sh autogen.sh && \
32-
./configure --with-zfs-headers=$PWD/cstor/include --with-spl-headers=$PWD/cstor/lib/libspl/include && \
33-
make -j$(nproc) && \
40+
./configure --with-zfs-headers="$PWD"/cstor/include --with-spl-headers="$PWD"/cstor/lib/libspl/include && \
41+
make -j"$(nproc)" && \
3442
make install && \
3543
ldconfig
3644

3745
# build cstor
3846
cd cstor && \
3947
sh autogen.sh && \
40-
./configure --enable-uzfs=yes --with-config=user --with-jemalloc --with-libcstor=$PWD/../include && \
48+
./configure --enable-uzfs=yes --with-config=user --with-jemalloc --with-libcstor="$PWD"/../include && \
4149
make clean && \
42-
make -j$(nproc) && \
50+
make -j"$(nproc)" && \
4351
cd /libcstor
4452

4553
# build zrepl

docker/cstor-base.Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ RUN apt-get update -qq && \
3030
unlink /usr/bin/gcc && ln -s /usr/bin/gcc-6 /usr/bin/gcc && \
3131
unlink /usr/bin/g++ && ln -s /usr/bin/g++-6 /usr/bin/g++
3232

33+
ARG CSTOR_ORG
3334
# build using script
3435
RUN ./docker/build.sh
3536

0 commit comments

Comments
 (0)