Skip to content

Commit

Permalink
Add run_component script to all contianers
Browse files Browse the repository at this point in the history
  • Loading branch information
dometto committed Nov 18, 2024
1 parent 9c91dec commit 3f2f58c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,11 @@ On top of the base Linux image, Packer will execute a number of shell scripts, a

The repositories for these components are included in this repo as git submodules.

Additionally:

1. The SRC-External plugin is copied to the container so it is available for testing. Its location is `/etc/rsc/plugin-external-plugin`.
2. The `run_component.sh` script is copied to the container (`/usr/local/bin`) to facilitate testing.

### SRC-OS

Installs basic packages and services, sets permissions, etc.
Expand Down
10 changes: 10 additions & 0 deletions ubuntu/jammy-nginx/src-ubuntu-nginx.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ build {
])
}

provisioner "file" {
sources = "run_component.sh"
destination = "/usr/local/bin/run_component.sh"
}

provisioner "file" {
source = "plugin-external-plugin"
destination = "/etc/rsc/plugin-external-plugin"
}

# The autoremove command run below removes recommended and suggested packages installed by 'apt installs' executed by the components executed above.
# This makes for a smaller image (~260MB), but it may result in errors if further components implicitly rely on those recommended packages.
provisioner "shell" {
Expand Down
10 changes: 10 additions & 0 deletions ubuntu/src-ubuntu.pkr.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,16 @@ build {
inline_shebang = "/bin/sh -ex"
}

provisioner "file" {
source = "run_component.sh"
destination = "/usr/local/bin/run_component.sh"
}

provisioner "file" {
source = "plugin-external-plugin"
destination = "/etc/rsc/plugin-external-plugin"
}

post-processor "docker-tag" {
only = ["docker.ubuntu"]
repository = "${var.container_repo}${var.img_tag_suffix}"
Expand Down

0 comments on commit 3f2f58c

Please sign in to comment.