Skip to content

Commit 454ceaf

Browse files
change pipeline to pull private repo
1 parent c2ec8ea commit 454ceaf

File tree

5 files changed

+69
-4
lines changed

5 files changed

+69
-4
lines changed

.github/dockerfiles/syntheticbucketd/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ RUN npm install -g \
55
66
COPY package.json /app
77
COPY yarn.lock /app
8-
RUN cd /app && yarn install --network-concurrency 1
8+
9+
RUN --mount=type=secret,id=npmtoken \
10+
cd /app && \
11+
TOKEN=$(cat /run/secrets/npmtoken 2>/dev/null || echo "") && \
12+
git config --global url."https://${TOKEN}@github.com/".insteadOf "https://github.com/" && \
13+
yarn install --network-concurrency 1 && \
14+
git config --global --unset url."https://github.com/".insteadOf || true
915

1016
COPY tests/utils /app
1117

.github/workflows/docker-build.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ jobs:
1717
- name: Checkout
1818
uses: actions/checkout@v4
1919

20+
- name: Get token to access private repositories
21+
uses: actions/create-github-app-token@v1
22+
id: app-token
23+
with:
24+
app-id: ${{ vars.ACTIONS_APP_ID }}
25+
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
26+
repositories: cloudserverclient
27+
2028
- name: Set up Docker Buildk
2129
uses: docker/setup-buildx-action@v3
2230

@@ -35,6 +43,8 @@ jobs:
3543
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}
3644
cache-from: type=gha
3745
cache-to: type=gha,mode=max
46+
secrets: |
47+
npmtoken=${{ steps.app-token.outputs.token }}
3848
3949
- name: Build and push federation image
4050
uses: docker/build-push-action@v6
@@ -46,6 +56,8 @@ jobs:
4656
tags: ghcr.io/${{ github.repository }}:${{ github.sha }}-federation
4757
cache-from: type=gha,scope=federation
4858
cache-to: type=gha,scope=federation,mode=max
59+
secrets: |
60+
npmtoken=${{ steps.app-token.outputs.token }}
4961
5062
- name: Install Oras
5163
run: |

.github/workflows/tests.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323

24+
- name: Get token to access private repositories
25+
uses: actions/create-github-app-token@v1
26+
id: app-token
27+
with:
28+
app-id: ${{ vars.ACTIONS_APP_ID }}
29+
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
30+
repositories: cloudserverclient
31+
2432
- uses: actions/setup-node@v4
2533
with:
2634
node-version: '22'
@@ -54,6 +62,8 @@ jobs:
5462
tags: ghcr.io/${{ github.repository }}/syntheticbucketd:${{ github.sha }}
5563
cache-from: type=gha,scope=syntheticbucketd
5664
cache-to: type=gha,mode=max,scope=syntheticbucketd
65+
secrets: |
66+
npmtoken=${{ steps.app-token.outputs.token }}
5767
5868
- name: Build and push MongoDB
5969
uses: docker/build-push-action@v6
@@ -70,6 +80,14 @@ jobs:
7080
- name: Checkout
7181
uses: actions/checkout@v4
7282

83+
- name: Get token to access private repositories
84+
uses: actions/create-github-app-token@v1
85+
id: app-token
86+
with:
87+
app-id: ${{ vars.ACTIONS_APP_ID }}
88+
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
89+
repositories: cloudserverclient
90+
7391
- uses: actions/setup-node@v4
7492
with:
7593
node-version: '22'
@@ -128,12 +146,24 @@ jobs:
128146
steps:
129147
- name: Checkout
130148
uses: actions/checkout@v4
149+
150+
- name: Get token to access private repositories
151+
uses: actions/create-github-app-token@v1
152+
id: app-token
153+
with:
154+
app-id: ${{ vars.ACTIONS_APP_ID }}
155+
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
156+
repositories: cloudserverclient
157+
131158
- uses: actions/setup-node@v4
132159
with:
133160
node-version: '22'
134161
cache: yarn
162+
135163
- name: Install node dependencies
136164
run: yarn install --ignore-engines --frozen-lockfile --network-concurrency 1
165+
env:
166+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
137167
- name: Lint markdown
138168
run: yarn run --silent lint_md
139169
- name: Lint Javascript
@@ -227,12 +257,24 @@ jobs:
227257
steps:
228258
- name: Checkout
229259
uses: actions/checkout@v4
260+
261+
- name: Get token to access private repositories
262+
uses: actions/create-github-app-token@v1
263+
id: app-token
264+
with:
265+
app-id: ${{ vars.ACTIONS_APP_ID }}
266+
private-key: ${{ secrets.ACTIONS_APP_PRIVATE_KEY }}
267+
repositories: cloudserverclient
268+
230269
- uses: actions/setup-node@v4
231270
with:
232271
node-version: '22'
233272
cache: yarn
273+
234274
- name: Install node dependencies
235275
run: yarn install --ignore-engines --frozen-lockfile --network-concurrency 1
276+
env:
277+
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
236278
- name: Login to Registry
237279
uses: docker/login-action@v3
238280
with:

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,15 @@ RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSI
2929
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
3030

3131
COPY package.json yarn.lock /usr/src/app/
32-
RUN yarn install --ignore-engines --frozen-lockfile --production --network-concurrency 1 \
32+
33+
RUN --mount=type=secret,id=npmtoken \
34+
TOKEN=$(cat /run/secrets/npmtoken 2>/dev/null || echo "") && \
35+
git config --global url."https://${TOKEN}@github.com/".insteadOf "https://github.com/" && \
36+
yarn install --ignore-engines --frozen-lockfile --production --network-concurrency 1 \
3337
&& rm -rf /var/lib/apt/lists/* \
3438
&& rm -rf ~/.node-gyp \
35-
&& rm -rf /tmp/yarn-*
39+
&& rm -rf /tmp/yarn-* \
40+
&& git config --global --unset url."https://github.com/".insteadOf || true
3641

3742
################################################################################
3843
FROM node:${NODE_VERSION}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
"uuid": "^11.0.4",
7171
"vaultclient": "scality/vaultclient#8.5.1",
7272
"werelogs": "scality/werelogs#8.2.1",
73-
"@scality/cloudserverclient": "file:../cloudserverclient"
73+
"@scality/cloudserverclient": "git+https://github.com/scality/cloudserverclient#v1.0.0-CLDSRVCLT-1.0"
7474
},
7575
"resolutions": {
7676
"node-rdkafka-prometheus/prom-client": "^15.1.3"

0 commit comments

Comments
 (0)