Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Doc

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 3

exec catalog.

create_folder @folder_name = 'MyTest'

DECLARE @ProjectBinary AS varbinary(max)


DECLARE @operation_id AS bigint
SET @ProjectBinary =
(SELECT * FROM OPENROWSET(BULK 'C:\Temp\SSIS\Mytest\MyTest\MyTest\bin\
Development\MyTest.ispac', SINGLE_BLOB) AS BinaryData)

EXEC catalog.deploy_project @folder_name = 'MyTest',


@project_name = 'MyTest',
@Project_Stream = @ProjectBinary,
@operation_id = @operation_id out

https://www.youtube.com/watch?v=jEU4suPzA4w

Push Existing Code to gitHub

cd <project path>
git init
git remote add orgin <Git Project Path>
git add.
git branch -M main
git commit -m "initial Commit"

git push -uf origin main

Certainly! Below is a sample GitLab CI/CD YAML configuration that downloads a


project from GitLab and executes a batch file (`script.bat`):

```yaml
stages:
- download
- execute

download_project:
stage: download
script:
- mkdir -p C:/Temp/Myssis # Create the directory if it doesn't exist
- cd C:/Temp/Myssis # Change to the directory where you want to clone the
project
- git clone https://gitlab.com/your-username/your-project.git . # Replace with
your GitLab project URL
tags:
- windows # Tag indicating this job should run on a Windows runner

execute_batch:
stage: execute
script:
- cd C:/Temp/Myssis # Change to the directory where the project is cloned
- script.bat # Execute the batch file
tags:
- windows # Tag indicating this job should run on a Windows runner
dependencies:
- download_project # Ensure download_project job completes before executing
this job
```

### Explanation:

- **Stages**: Define the stages of the pipeline. Here we have two stages:
- `download`: Downloads the project from GitLab.
- `execute`: Executes the batch file.

- **`download_project` Job**:
- **`script`**: Contains commands to be executed in this job.
- `mkdir -p C:/Temp/Myssis`: Creates the directory `C:\Temp\Myssis` if it does
not already exist.
- `cd C:/Temp/Myssis`: Changes the current working directory to `C:\Temp\
Myssis`.
- `git clone https://gitlab.com/your-username/your-project.git .`: Clones the
GitLab project from the specified URL (`https://gitlab.com/your-username/your-
project.git`) into the current directory (`.`). Replace `your-username` with your
GitLab username and `your-project` with your GitLab project name.
- **`tags`**: Specifies the tags for the runner where this job should execute. In
this case, `windows` indicates that this job requires a Windows runner environment.

- **`execute_batch` Job**:
- **`script`**: Contains commands to be executed in this job.
- `cd C:/Temp/Myssis`: Changes the current working directory to `C:\Temp\
Myssis`, where the project is cloned.
- `script.bat`: Executes the batch file named `script.bat` located in `C:\Temp\
Myssis`.
- **`tags`**: Specifies the tags for the runner where this job should execute. In
this case, `windows` indicates that this job requires a Windows runner environment.
- **`dependencies`**: Specifies that this job depends on the `download_project`
job. This ensures that the project is downloaded before attempting to execute the
batch file.

### Notes:

- Make sure to replace `https://gitlab.com/your-username/your-project.git` with the


actual URL of your GitLab project.

- Ensure that the batch file `script.bat` is present in the root directory of the
cloned project (`C:\Temp\Myssis` in this example).

- Adjust paths and commands (`mkdir`, `git clone`, `cd`, `script.bat`) as necessary
based on your specific project structure and requirements.

This YAML configuration sets up a simple GitLab CI/CD pipeline that downloads a
project from GitLab and then executes a batch file on a Windows runner.

*****************************************************************************
nstall Required Softwares
stages:
- setup_environment
- install_odbc_driver
- sqlcmd_commands
- run_ssis

variables:
ODBC_DRIVER_URL: "URL_TO_ODBC_DRIVER_DOWNLOAD"
ODBC_DRIVER_INSTALLER: "odbc_driver_installer.exe"
SSIS_PACKAGE_PATH: "path/to/your/ssis/package.dtsx"
SQL_SERVER_HOST: "sql_server_host"
SQL_DATABASE: "your_database"
SQL_USERNAME: "sql_username"
SQL_PASSWORD: "sql_password"
SQL_CMD_PATH: "path/to/your/sqlcmd"
SSIS_DEVOPS_PATH: "path/to/your/ssis_devops"

before_script:
# Setup environment variables
- stage: setup_environment
script:
- echo "Setting up environment..."
# Check if SQL_CMD_PATH is not already in PATH
- if [ -d "$SQL_CMD_PATH" ] && [[ ":$PATH:" != *":$SQL_CMD_PATH:"* ]]; then
echo "##vso[task.prependpath]$SQL_CMD_PATH"; fi
# Check if SSIS_DEVOPS_PATH is not already in PATH
- if [ -d "$SSIS_DEVOPS_PATH" ] && [[ ":$PATH:" != *":
$SSIS_DEVOPS_PATH:"* ]]; then echo "##vso[task.prependpath]$SSIS_DEVOPS_PATH"; fi

# Download and install ODBC Driver


- stage: install_odbc_driver
script:
- curl -o $ODBC_DRIVER_INSTALLER $ODBC_DRIVER_URL
- ./$ODBC_DRIVER_INSTALLER /silent # Adjust installer command as per your
driver's silent install option

# SQLCMD Commands
- stage: sqlcmd_commands
script:
- sqlcmd -S $SQL_SERVER_HOST -d $SQL_DATABASE -U $SQL_USERNAME -P
$SQL_PASSWORD -i path/to/your/sql_script.sql
# Replace 'path/to/your/sql_script.sql' with the path to your SQL script
containing SQLCMD commands

# Run SSIS Package in Silent Mode


- stage: run_ssis
script:
- dtexec /F $SSIS_PACKAGE_PATH /De "password=your_password"
# Replace 'password=your_password' with appropriate SSIS package
configuration

You might also like