Skip to content

Commit 06db0f0

Browse files
committed
Rmoving the UID & GID change, adding workaround for the test & changing the size check test.
1 parent 914b9e6 commit 06db0f0

File tree

8 files changed

+16
-74
lines changed

8 files changed

+16
-74
lines changed

.github/actions/smoke-test/check-image-size.sh

+8-3
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ check_image_size() {
3636
# call install_bc
3737
install_bc
3838

39-
CONTAINER_ID=$(docker ps -q --filter "label=test-container=$IMAGE")
40-
# Find the image ID of the container
41-
IMAGE_ID=$(docker inspect --format='{{.Image}}' "$CONTAINER_ID")
39+
if [ $IMAGE == "universal" ]; then
40+
#Read the image id of the original image, not the modified image with uid and gid
41+
IMAGE_ID=$(docker images | grep -v "uid" | sed '1d' | awk '{print $3}')
42+
else
43+
CONTAINER_ID=$(docker ps -q --filter "label=test-container=$IMAGE")
44+
# Find the image ID of the container
45+
IMAGE_ID=$(docker inspect --format='{{.Image}}' "$CONTAINER_ID")
46+
fi
4247
# Find the size of the image
4348
IMAGE_SIZE=$(docker image inspect --format='{{.Size}}' "$IMAGE_ID")
4449
# Output the size

.github/workflows/push-again.yml

-13
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@ jobs:
4141
path: 'release'
4242
ref: ${{ github.event.inputs.release }}
4343

44-
- name: Get userUid from host machine
45-
id: get-useruid
46-
run: |
47-
set -e
48-
USER_UID=$(id -u)
49-
USER_GID=$(id -g)
50-
echo "UserUid::$USER_UID"
51-
echo "UserGid::$USER_GID"
52-
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
53-
echo "USER_GID=$USER_GID" >> $GITHUB_ENV
54-
5544
- name: Build and push
5645
id: build_and_push
5746
env:
@@ -62,8 +51,6 @@ jobs:
6251
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
6352
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
6453
PASSWORD: ${{ secrets.PASSWORD }}
65-
USER_UID: ${{ env.USER_UID }}
66-
USER_GID: ${{ env.USER_GID }}
6754
run: |
6855
set -e
6956

.github/workflows/push-dev.yml

+2-14
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,7 @@ jobs:
2929
- name: Checkout
3030
id: checkout
3131
uses: actions/checkout@v3
32-
33-
- name: Get userUid from host machine
34-
id: get-useruid
35-
run: |
36-
set -e
37-
USER_UID=$(id -u)
38-
USER_GID=$(id -g)
39-
echo "UserUid::$USER_UID"
40-
echo "UserGid::$USER_GID"
41-
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
42-
echo "USER_GID=$USER_GID" >> $GITHUB_ENV
32+
4333

4434
- name: Build and push dev tags
4535
id: build_and_push
@@ -51,9 +41,7 @@ jobs:
5141
STUB_REGISTRY_BASE_PATH: ${{ secrets.STUB_REGISTRY_BASE_PATH }}
5242
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
5343
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
54-
PASSWORD: ${{ secrets.PASSWORD }}
55-
USER_UID: ${{ env.USER_UID }}
56-
USER_GID: ${{ env.USER_GID }}
44+
PASSWORD: ${{ secrets.PASSWORD }}
5745
run: |
5846
set -e
5947

.github/workflows/push-manual-dev.yml

-13
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,6 @@ jobs:
3636
with:
3737
path: 'release'
3838
ref: ${{ github.event.inputs.release }}
39-
40-
- name: Get userUid from host machine
41-
id: get-useruid
42-
run: |
43-
set -e
44-
USER_UID=$(id -u)
45-
USER_GID=$(id -g)
46-
echo "UserUid::$USER_UID"
47-
echo "UserGid::$USER_GID"
48-
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
49-
echo "USER_GID=$USER_GID" >> $GITHUB_ENV
5039

5140
- name: Build and push
5241
id: build_and_push
@@ -58,8 +47,6 @@ jobs:
5847
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
5948
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
6049
PASSWORD: ${{ secrets.PASSWORD }}
61-
USER_UID: ${{ env.USER_UID }}
62-
USER_GID: ${{ env.USER_GID }}
6350
run: |
6451
set -e
6552

.github/workflows/push.yml

+1-14
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,7 @@ jobs:
2828
2929
- name: Checkout
3030
id: checkout
31-
uses: actions/checkout@v3
32-
33-
- name: Get userUid from host machine
34-
id: get-useruid
35-
run: |
36-
set -e
37-
USER_UID=$(id -u)
38-
USER_GID=$(id -g)
39-
echo "UserUid::$USER_UID"
40-
echo "UserGid::$USER_GID"
41-
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
42-
echo "USER_GID=$USER_GID" >> $GITHUB_ENV
31+
uses: actions/checkout@v3
4332

4433
- name: Get tag name
4534
run: echo "TAG=$(echo "${{ github.ref }}" | grep -oP 'refs/tags/\K(.+)')" >> $GITHUB_ENV
@@ -55,8 +44,6 @@ jobs:
5544
SECONDARY_REGISTRY_BASE_PATH: ${{ secrets.SECONDARY_REGISTRY_BASE_PATH }}
5645
TOKEN_NAME: ${{ secrets.TOKEN_NAME }}
5746
PASSWORD: ${{ secrets.PASSWORD }}
58-
USER_UID: ${{ env.USER_UID }}
59-
USER_GID: ${{ env.USER_GID }}
6047
run: |
6148
set -e
6249

.github/workflows/smoke-universal.yaml

+1-14
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,10 @@ jobs:
1919
- name: Checkout
2020
id: checkout
2121
uses: actions/checkout@v3
22-
23-
- name: Get userUid from host machine
24-
id: get-useruid
25-
run: |
26-
set -e
27-
USER_UID=$(id -u)
28-
USER_GID=$(id -g)
29-
echo "UserUid::$USER_UID"
30-
echo "UserGid::$USER_GID"
31-
echo "USER_UID=$USER_UID" >> $GITHUB_ENV
32-
echo "USER_GID=$USER_GID" >> $GITHUB_ENV
3322

3423
- name: Smoke test
3524
env:
36-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
37-
USER_UID: ${{ env.USER_UID }}
38-
USER_GID: ${{ env.USER_GID }}
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3926
id: smoke_test
4027
uses: ./.github/actions/smoke-test
4128
with:

src/universal/.devcontainer/devcontainer.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@
66
"features": {
77
"ghcr.io/devcontainers/features/common-utils:2": {
88
"username": "codespace",
9-
//Getting the UID & GID values of the host machine via GitHub actions
10-
"userUid": "${localEnv:USER_UID}",
11-
"userGid": "${localEnv:USER_GID}"
9+
"userUid": "1000",
10+
"userGid": "1000"
1211
},
1312
"ghcr.io/devcontainers/features/dotnet:2": {
1413
"version": "8.0",

src/universal/test-project/test.sh

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
cd $(dirname "$0")
33

44
source test-utils.sh codespace
5+
#Changing he ownership of dotnet path to ensure oryx-install-dotnet-2.1 test doesn't fail with permission issue
6+
sudo chown -R codespace:codespace /usr/share/dotnet
57

68
# Run common tests
79
checkCommon

0 commit comments

Comments
 (0)