Skip to content

Instantly share code, notes, and snippets.

View lhmachado's full-sized avatar

Luiz Henrique Leal Machado lhmachado

View GitHub Profile
[
{
"ParameterKey": "RepoBranchName",
"ParameterValue": "<your-default-brach-name>"
},
{
"ParameterKey": "RepoName",
"ParameterValue": "<github-repo-name>"
},
{
@lhmachado
lhmachado / gist:68b9201bad81c83505e690abf7f10982
Last active May 19, 2020 03:45
gremlin-server-packer-pipeline.yml
AWSTemplateFormatVersion: "2010-09-09"
Parameters:
RepoUser:
Type: String
RepoToken:
Type: String
RepoName:
Type: String
RepoBranchName:
Type: String
---
version: 0.2
phases:
pre_build:
commands:
- echo "Installing HashiCorp Packer..."
- curl -qL -o packer.zip https://releases.hashicorp.com/packer/1.5.6/packer_1.5.6_linux_amd64.zip && unzip packer.zip -d packer-bin
- echo "Installing jq..."
- curl -qL -o jq https://stedolan.github.io/jq/download/linux64/jq && chmod +x ./jq
- name: 'Provision by ansible role'
hosts: localhost
connection: local
become: true
roles:
- gremlin-server
{
"variables": {
"region": "us-east-1"
},
"builders": [
{
"type": "amazon-ebs",
"region": "{{user `region`}}",
"source_ami_filter": {
"filters": {
#!/bin/bash
set -e
cd /opt/gremlin-server
CONF_FILE=$1
# IP substitution hack borrowed from:
# https://github.com/htaox/NEAT/blob/94a004831cf89767e116d955192fc14ac82e5069/docker-scripts/gremlin-server-3.0.0/files/default_cmd#L5
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
[Unit]
Wants=network-online.target
After=network.target network-online.target
Description=Gremlin Server as a service
[Service]
User=root
#change this directory into your workspace
#mkdir workspace
WorkingDirectory=/opt/gremlin-server
#path to the executable bash script which executes the jar file