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

github: update workflow to use test project and updated workflows #22

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
11 changes: 6 additions & 5 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,13 @@ jobs:
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}

- name: Install Gcloud SDK
uses: google-github-actions/setup-gcloud@master
- name: Authenticate using ServiceAccount
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
credentials_json: '${{ secrets.GCP_SA_KEY }}'

- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v2'

- name: Deploy instance
run: ../../.github/scripts/terraform-apply.sh ${{ matrix.distro }} ${{ matrix.agent_type }} ${{ matrix.version }}
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ jobs:
PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }}
PUBLIC_KEY: ${{ secrets.SSH_PUBLIC_KEY }}

- name: Install Gcloud SDK
uses: google-github-actions/setup-gcloud@master
- name: Authenticate using ServiceAccount
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ secrets.GCP_PROJECT_ID }}
service_account_key: ${{ secrets.GCP_SA_KEY }}
export_default_credentials: true
credentials_json: '${{ secrets.GCP_SA_KEY }}'

- name: Set up Cloud SDK
uses: 'google-github-actions/setup-gcloud@v2'

- name: Deploy instance
run: ../../.github/scripts/terraform-apply.sh ${{ matrix.distro }} ${{ matrix.agent_type }} ${{ matrix.version }}
Expand Down
5 changes: 3 additions & 2 deletions test/packer/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ install_puppet() {
install_gcloud() {
if ! command -v COMMAND &> /dev/null
then
curl https://sdk.cloud.google.com > install.sh
bash install.sh --disable-prompts
curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-481.0.0-linux-x86_64.tar.gz
tar -xzf google-cloud-cli-481.0.0-linux-x86_64.tar.gz
bash google-cloud-sdk/install.sh --quiet
fi
}

Expand Down
3 changes: 2 additions & 1 deletion test/packer/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ cat <<END>packer.json
"image_family": "puppet-${image_family}",
"source_image_family": "${image_family}",
"type": "googlecompute",
"project_id": "united-aura-313415",
"project_id": "stackdriver-test-143416",
"ssh_username": "packer",
"zone": "us-east1-b",
"startup_script_file": "bootstrap.sh",
"wait_to_add_ssh_keys": "20s",
"scopes": [
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/compute",
Expand Down
1 change: 1 addition & 0 deletions test/terraform/instance/instance.tf
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ resource "google_compute_instance" "instance" {

metadata = {
used_by = "github-actions"
enable_oslogin = "false"
workspace = terraform.workspace
ssh-keys = "ci:${file(var.ssh_public_key)}"
}
Expand Down
2 changes: 1 addition & 1 deletion test/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

variable "project" {
default = "united-aura-313415"
default = "stackdriver-test-143416"
}

variable "preemptible" {
Expand Down
Loading