Skip to content

Commit

Permalink
Merge pull request #21 from sonikro/map-envs
Browse files Browse the repository at this point in the history
feat(map-envs): maps runner environment variables to main ecs container
  • Loading branch information
sonikro authored Jul 20, 2023
2 parents 2af2e36 + a5ec9ed commit 44ac3d4
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ jobs:
ls -la
terraform -v
echo "Hello World. I am ${{github.repository}}"
echo "Testing $GITHUB_REPOSITORY variable"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ In the execution phase, the action will:
- [ ] Automatically create temporary security group if one is not provided
- [ ] Automatically grab list of Subnets for VPC_ID, if Subnet_IDS are not provided
- [ ] Mask secrets inside the Cloudwatch Logs
- [ ] Map all GitHub Contexts/ENVS into the ECS Container
- [X] Map all GitHub Contexts/ENVS into the ECS Container
- [ ] Ability to upload artifacts back to GitHub (if your remote execution generates artifacts)
- [ ] Find a way to map environment variables from the remote shell, back to the runner (after execution)
- [ ] Change the TearDown step to run as a **post** action on GHA, so take advantages of errors/cancellations
Expand Down
2 changes: 2 additions & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions src/providers/remoteEnvironments/AWSECSRemoteEnvironment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,19 @@ export class AWSECSRemoteEnvironment
const workspaceContainerName = 'workspace'
const workspaceContainerPath = '/workspace'

const environmentValues = Object.keys(process.env).map(key => ({
name: key,
value: process.env[key]
}))

const mainContainerDefinition: ContainerDefinition = {
image: settings.image,
essential: true,
entryPoint: [settings.shell, '-c'],
command: [unifiedCommand],
workingDirectory: workspaceContainerPath,
name: settings.uniqueExecutionId,
environment: environmentValues,
logConfiguration: {
logDriver: 'awslogs',
options: awsLogsParameters
Expand Down

0 comments on commit 44ac3d4

Please sign in to comment.