Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci(sage-monorepo): fix how env vars are passed to the dev container #2459

Merged
merged 3 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 44 additions & 12 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "Sage Dev Container",
"image": "ghcr.io/sage-bionetworks/sage-devcontainer:be08406",

"containerEnv": {
"NX_BASE": "${localEnv:NX_BASE}",
"NX_BRANCH": "${localEnv:NX_BRANCH}",
Expand All @@ -11,20 +10,21 @@
"NX_HEAD": "${localEnv:NX_HEAD}",
"NX_RUN_GROUP": "${localEnv:NX_RUN_GROUP}",
"SONAR_TOKEN": "${localEnv:SONAR_TOKEN}",
"SONAR_PULL_REQUEST_NUMBER": "${localEnv:SONAR_PULL_REQUEST_NUMBER}",
"DOCKER_USERNAME": "${localEnv:DOCKER_USERNAME}",
"DOCKER_PASSWORD": "${localEnv:DOCKER_PASSWORD}"
},

"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2.4.0": {
"version": "24.0.5",
"moby": false
}
},

"customizations": {
"codespaces": {
"openFiles": ["README.md"]
"openFiles": [
"README.md"
]
},
"vscode": {
"extensions": [
Expand Down Expand Up @@ -66,13 +66,43 @@
}
}
},

"forwardPorts": [
2432, 3000, 3306, 4200, 4211, 5017, 5200, 5432, 5601, 7010, 7080, 7200, 7888, 8010, 8071, 8000,
8080, 8081, 8082, 8083, 8084, 8085, 8086, 8090, 8091, 8092, 8200, 8787, 8888, 8889, 9090, 9104,
9200, 9411, 27017
2432,
3000,
3306,
4200,
4211,
5017,
5200,
5432,
5601,
7010,
7080,
7200,
7888,
8010,
8071,
8000,
8080,
8081,
8082,
8083,
8084,
8085,
8086,
8090,
8091,
8092,
8200,
8787,
8888,
8889,
9090,
9104,
9200,
9411,
27017
],

"portsAttributes": {
"2432": {
"label": "itlas-postgres",
Expand Down Expand Up @@ -219,8 +249,10 @@
"onAutoForward": "silent"
}
},

"remoteUser": "vscode",
"shutdownAction": "stopContainer",
"runArgs": ["--name", "sage_devcontainer"]
}
"runArgs": [
"--name",
"sage_devcontainer"
]
}
6 changes: 3 additions & 3 deletions .github/workflows/sonar-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ jobs:
uses: nrwl/nx-set-shas@v3

- name: Set up the dev container
uses: ./.github/actions/setup-dev-container

- name: Scan the affected projects with Sonar
env:
SONAR_PULL_REQUEST_NUMBER: ${{ github.event.pull_request.number }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
uses: ./.github/actions/setup-dev-container

- name: Scan the affected projects with Sonar
run: |
devcontainer exec --workspace-folder ../sage-monorepo bash -c ". ./dev-env.sh \
&& nx affected --target=sonar"
1 change: 0 additions & 1 deletion apps/openchallenges/app/src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<openchallenges-google-tag-manager *ngIf="useGoogleTagManager" />
<!-- XXX -->
<openchallenges-navbar
class="mat-elevation-z6"
[title]="title"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.ComponentScan;

// XXX to trigger Sonar scan
@ComponentScan(basePackages = {"org.sagebionetworks.openchallenges"})
@EnableEurekaClient
@EnableFeignClients
Expand Down
Loading